Skip to content

Not support Bool type? #5

@0xfeedface1993

Description

@0xfeedface1993

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions