add PrepareContext

This commit is contained in:
Yasuhiro Matsumoto
2016-11-04 15:11:24 +09:00
parent 29b191f206
commit 025b917610
2 changed files with 8 additions and 0 deletions

View File

@@ -644,6 +644,10 @@ func (c *SQLiteConn) Close() error {
// Prepare the query string. Return a new statement.
func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error) {
return c.prepare(context.Background(), query)
}
func (c *SQLiteConn) prepare(ctx context.Context, query string) (driver.Stmt, error) {
pquery := C.CString(query)
defer C.free(unsafe.Pointer(pquery))
var s *C.sqlite3_stmt