update go-sqlite3 to v0.18.0 (#3204)

This commit is contained in:
kim
2024-08-15 00:30:58 +00:00
committed by GitHub
parent 09f24e0446
commit 586639ccf0
36 changed files with 645 additions and 143 deletions

View File

@ -32,6 +32,19 @@ func (c *Conn) Begin() Txn {
return Txn{c}
}
// BeginConcurrent starts a concurrent transaction.
//
// Experimental: requires a custom build of SQLite.
//
// https://sqlite.org/cgi/src/doc/begin-concurrent/doc/begin_concurrent.md
func (c *Conn) BeginConcurrent() (Txn, error) {
err := c.Exec(`BEGIN CONCURRENT`)
if err != nil {
return Txn{}, err
}
return Txn{c}, nil
}
// BeginImmediate starts an immediate transaction.
//
// https://sqlite.org/lang_transaction.html
@ -217,7 +230,7 @@ func (c *Conn) txnExecInterrupted(sql string) error {
return err
}
// TxnState starts a deferred transaction.
// TxnState determines the transaction state of a database.
//
// https://sqlite.org/c3ref/txn_state.html
func (c *Conn) TxnState(schema string) TxnState {
@ -292,3 +305,11 @@ func updateCallback(ctx context.Context, mod api.Module, pDB uint32, action Auth
c.update(action, schema, table, int64(rowid))
}
}
// CacheFlush flushes caches to disk mid-transaction.
//
// https://sqlite.org/c3ref/db_cacheflush.html
func (c *Conn) CacheFlush() error {
r := c.call("sqlite3_db_cacheflush", uint64(c.handle))
return c.error(r)
}