Skip to content

EXC_BREAKPOINT String.wrap<T> #1307

Description

@milan-galitein

Image

I got one sentry related to this. this is not reproducible but one of my client has faced this.

at the time of creating table using try! db.run(table.create(ifNotExists: true) { t in inside create method, in below code block

let clauses: [Expressible?] = [ create(Table.identifier, tableName(), temporary ? .temporary : nil, ifNotExists), "".wrap(builder.definitions) as Expression<Void>, withoutRowid ? Expression<Void>(literal: "WITHOUT ROWID") : nil ]

"".wrap(builder.definitions) as Expression => May be due to below reason crash happen

builder.definitions is empty then crash happen


And also second crash in Screenshot you can see. below is code for it.

`extension Expressible {

// naïve compiler for statements that can’t be bound, e.g., CREATE TABLE
// FIXME: make internal (0.13.0)
public func asSQL() -> String {
    let expressed = expression
    var idx = 0
    return expressed.template.reduce("") { template, character in
        let transcoded: String

        if character == "?" {
            transcoded = transcode(expressed.bindings[idx])
            idx += 1
        } else {
            transcoded = String(character)
        }
        return template + transcoded
    }
}

}`

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions