@@ -1876,6 +1876,9 @@ func (c *SQLiteConn) SetLimit(id int, newVal int) int {
18761876// This method is not thread-safe as the returned error code can be changed by
18771877// another call if invoked concurrently.
18781878//
1879+ // Use SetFileControlInt64 instead if the argument for the opcode is documented
1880+ // as a pointer to a sqlite3_int64.
1881+ //
18791882// See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html
18801883func (c * SQLiteConn ) SetFileControlInt (dbName string , op int , arg int ) error {
18811884 if dbName == "" {
@@ -1893,6 +1896,34 @@ func (c *SQLiteConn) SetFileControlInt(dbName string, op int, arg int) error {
18931896 return nil
18941897}
18951898
1899+ // SetFileControlInt64 invokes the xFileControl method on a given database. The
1900+ // dbName is the name of the database. It will default to "main" if left blank.
1901+ // The op is one of the opcodes prefixed by "SQLITE_FCNTL_". The arg argument
1902+ // and return code are both opcode-specific. Please see the SQLite documentation.
1903+ //
1904+ // This method is not thread-safe as the returned error code can be changed by
1905+ // another call if invoked concurrently.
1906+ //
1907+ // Only use this method if the argument for the opcode is documented as a pointer
1908+ // to a sqlite3_int64.
1909+ //
1910+ // See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html
1911+ func (c * SQLiteConn ) SetFileControlInt64 (dbName string , op int , arg int64 ) error {
1912+ if dbName == "" {
1913+ dbName = "main"
1914+ }
1915+
1916+ cDBName := C .CString (dbName )
1917+ defer C .free (unsafe .Pointer (cDBName ))
1918+
1919+ cArg := C .sqlite3_int64 (arg )
1920+ rv := C .sqlite3_file_control (c .db , cDBName , C .int (op ), unsafe .Pointer (& cArg ))
1921+ if rv != C .SQLITE_OK {
1922+ return c .lastError ()
1923+ }
1924+ return nil
1925+ }
1926+
18961927// Close the statement.
18971928func (s * SQLiteStmt ) Close () error {
18981929 s .mu .Lock ()
0 commit comments