MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / SetFileControlInt64

Method SetFileControlInt64

sqlite3.go:2131–2145  ·  view source on GitHub ↗

SetFileControlInt64 invokes the xFileControl method on a given database. The dbName is the name of the database. It will default to "main" if left blank. The op is one of the opcodes prefixed by "SQLITE_FCNTL_". The arg argument and return code are both opcode-specific. Please see the SQLite documen

(dbName string, op int, arg int64)

Source from the content-addressed store, hash-verified

2129//
2130// See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html
2131func (c *SQLiteConn) SetFileControlInt64(dbName string, op int, arg int64) error {
2132 if dbName == "" {
2133 dbName = "main"
2134 }
2135
2136 cDBName := C.CString(dbName)
2137 defer C.free(unsafe.Pointer(cDBName))
2138
2139 cArg := C.sqlite3_int64(arg)
2140 rv := C.sqlite3_file_control(c.db, cDBName, C.int(op), unsafe.Pointer(&cArg))
2141 if rv != C.SQLITE_OK {
2142 return c.lastError()
2143 }
2144 return nil
2145}
2146
2147// Close the statement.
2148func (s *SQLiteStmt) Close() error {

Callers 1

TestSetFileControlInt64Function · 0.80

Calls 1

lastErrorMethod · 0.95

Tested by 1

TestSetFileControlInt64Function · 0.64