SQLite Forum

string concatenation issue in prepared statement
Login
I know nothing about swift, but would guess that you are binding the null terminator as part of your string.

Maybe try something like this:

```
        XCTAssertEqual("B".utf8CString.withUnsafeBufferPointer { (buffer) -> Int32 in
            return sqlite3_bind_text(
                statement,
                1,
                buffer.baseAddress,
                Int32(buffer.count)-1,
                unsafeBitCast(-1, to: sqlite3_destructor_type.self)
            )
        }, SQLITE_OK)
```