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)
| 1870 | // |
| 1871 | // See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html |
| 1872 | func (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. |
| 1889 | func (s *SQLiteStmt) Close() error { |