Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not support Bool type? #5

Open
0xfeedface1993 opened this issue Apr 10, 2019 · 0 comments
Open

Not support Bool type? #5

0xfeedface1993 opened this issue Apr 10, 2019 · 0 comments

Comments

@0xfeedface1993
Copy link

I found SQLite-StORM can't parser Bool value to right type, it convert to String type.

public class Team: SQLiteStORM {
    var id: Int = 0
    var activeState: Bool = false
    
    override open func table() -> String {
        return "team"
    }
    
    override public func to(_ this: StORMRow) {
        id = this.data["id"] as? Int ?? 0
        // notice
        activeState = this.data["activeState"] as? Bool ?? false
    }
}

Set breakpoint at activeState = this.data["activeState"] as? Int ?? 0, run lldb command

v this.data["activeState"] 

Console print activeState="true", it's String type, then activeState always false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant