summaryrefslogtreecommitdiff
path: root/vendor/modernc.org/sqlite/sqlite.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-04-17 17:10:51 +0100
committerLibravatar GitHub <noreply@github.com>2024-04-17 17:10:51 +0100
commitb3f2d441439af9d36096d11036220136588def43 (patch)
tree87e7f8808fed70fa6b3d303bd139f03de67b8621 /vendor/modernc.org/sqlite/sqlite.go
parentupdate to set requesting account when deleting status (#2849) (diff)
downloadgotosocial-b3f2d441439af9d36096d11036220136588def43.tar.xz
bump to modernc.org/sqlite v1.29.7 (#2850)
Diffstat (limited to 'vendor/modernc.org/sqlite/sqlite.go')
-rw-r--r--vendor/modernc.org/sqlite/sqlite.go41
1 files changed, 15 insertions, 26 deletions
diff --git a/vendor/modernc.org/sqlite/sqlite.go b/vendor/modernc.org/sqlite/sqlite.go
index 4f0546d24..e457a79bf 100644
--- a/vendor/modernc.org/sqlite/sqlite.go
+++ b/vendor/modernc.org/sqlite/sqlite.go
@@ -1140,32 +1140,6 @@ func (c *conn) bindText(pstmt uintptr, idx1 int, value string) (uintptr, error)
// C documentation
//
-// int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));
-func (c *conn) bindBlob(pstmt uintptr, idx1 int, value []byte) (uintptr, error) {
- if value != nil && len(value) == 0 {
- if rc := sqlite3.Xsqlite3_bind_zeroblob(c.tls, pstmt, int32(idx1), 0); rc != sqlite3.SQLITE_OK {
- return 0, c.errstr(rc)
- }
- return 0, nil
- }
-
- p, err := c.malloc(len(value))
- if err != nil {
- return 0, err
- }
- if len(value) != 0 {
- copy((*libc.RawMem)(unsafe.Pointer(p))[:len(value):len(value)], value)
- }
- if rc := sqlite3.Xsqlite3_bind_blob(c.tls, pstmt, int32(idx1), p, int32(len(value)), 0); rc != sqlite3.SQLITE_OK {
- c.free(p)
- return 0, c.errstr(rc)
- }
-
- return p, nil
-}
-
-// C documentation
-//
// int sqlite3_bind_int(sqlite3_stmt*, int, int);
func (c *conn) bindInt(pstmt uintptr, idx1, value int) (err error) {
if rc := sqlite3.Xsqlite3_bind_int(c.tls, pstmt, int32(idx1), int32(value)); rc != sqlite3.SQLITE_OK {
@@ -1830,6 +1804,21 @@ type ExecQuerierContext interface {
driver.QueryerContext
}
+// Commit releases all resources associated with the Backup object but does not
+// close the destination database connection.
+//
+// The destination database connection is returned to the caller or an error if raised.
+// It is the responsibility of the caller to handle the connection closure.
+func (b *Backup) Commit() (driver.Conn, error) {
+ rc := sqlite3.Xsqlite3_backup_finish(b.srcConn.tls, b.pBackup)
+
+ if rc == sqlite3.SQLITE_OK {
+ return b.dstConn, nil
+ } else {
+ return nil, b.srcConn.errstr(rc)
+ }
+}
+
// ConnectionHookFn function type for a connection hook on the Driver. Connection
// hooks are called after the connection has been set up.
type ConnectionHookFn func(