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

Method SetFileControlInt

sqlite3.go:2103–2117  ·  view source on GitHub ↗

SetFileControlInt 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 documenta

(dbName string, op int, arg int)

Source from the content-addressed store, hash-verified

2101//
2102// See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html
2103func (c *SQLiteConn) SetFileControlInt(dbName string, op int, arg int) error {
2104 if dbName == "" {
2105 dbName = "main"
2106 }
2107
2108 cDBName := C.CString(dbName)
2109 defer C.free(unsafe.Pointer(cDBName))
2110
2111 cArg := C.int(arg)
2112 rv := C.sqlite3_file_control(c.db, cDBName, C.int(op), unsafe.Pointer(&cArg))
2113 if rv != C.SQLITE_OK {
2114 return c.lastError()
2115 }
2116 return nil
2117}
2118
2119// SetFileControlInt64 invokes the xFileControl method on a given database. The
2120// dbName is the name of the database. It will default to "main" if left blank.

Callers 1

TestSetFileControlIntFunction · 0.80

Calls 1

lastErrorMethod · 0.95

Tested by 1

TestSetFileControlIntFunction · 0.64