Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cgosqlite/cgosqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,15 @@ func (stmt *Stmt) StepResult() (row bool, lastInsertRowID, changes int64, d time
}

func (stmt *Stmt) BindDouble(col int, val float64) error {
return errCode(C.sqlite3_bind_double(stmt.stmt.ptr(), C.int(col), C.double(val)))
return errCode(C.ts_sqlite3_bind_double(stmt.stmt.int(), C.int(col), C.double(val)))
}

func (stmt *Stmt) BindInt64(col int, val int64) error {
return errCode(C.sqlite3_bind_int64(stmt.stmt.ptr(), C.int(col), C.sqlite3_int64(val)))
return errCode(C.ts_sqlite3_bind_int64(stmt.stmt.int(), C.int(col), C.sqlite3_int64(val)))
}

func (stmt *Stmt) BindNull(col int) error {
return errCode(C.sqlite3_bind_null(stmt.stmt.ptr(), C.int(col)))
return errCode(C.ts_sqlite3_bind_null(stmt.stmt.int(), C.int(col)))
}

func (stmt *Stmt) BindText64(col int, val string) error {
Expand Down
12 changes: 12 additions & 0 deletions cgosqlite/cgosqlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ static int bind_blob64(handle_sqlite3_stmt stmt, int col, char* str, sqlite3_uin
return sqlite3_bind_blob64((sqlite3_stmt*)(stmt), col, str, n, SQLITE_TRANSIENT);
}

static int ts_sqlite3_bind_double(handle_sqlite3_stmt stmt, int col, double v) {
return sqlite3_bind_double((sqlite3_stmt*)(stmt), col, v);
}

static int ts_sqlite3_bind_int64(handle_sqlite3_stmt stmt, int col, sqlite3_int64 v) {
return sqlite3_bind_int64((sqlite3_stmt*)(stmt), col, v);
}

static int ts_sqlite3_bind_null(handle_sqlite3_stmt stmt, int col) {
return sqlite3_bind_null((sqlite3_stmt*)(stmt), col);
}

// We only need the Go string's memory for the duration of the call,
// and the GC pins it for us if we pass the gostring_t to C, so we
// do the conversion here instead of with C.CString.
Expand Down