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

Method SetFileControlInt

sqlite3.go:1872–1886  ·  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

1870//
1871// See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html
1872func (c *SQLiteConn) SetFileControlInt(dbName string, op int, arg int) error {
1873 if dbName == "" {
1874 dbName = "main"
1875 }
1876
1877 cDBName := C.CString(dbName)
1878 defer C.free(unsafe.Pointer(cDBName))
1879
1880 cArg := C.int(arg)
1881 rv := C.sqlite3_file_control(c.db, cDBName, C.int(op), unsafe.Pointer(&cArg))
1882 if rv != C.SQLITE_OK {
1883 return c.lastError()
1884 }
1885 return nil
1886}
1887
1888// Close the statement.
1889func (s *SQLiteStmt) Close() error {

Callers 1

TestSetFileControlIntFunction · 0.80

Calls 1

lastErrorMethod · 0.95

Tested by 1

TestSetFileControlIntFunction · 0.64