{"modulePath":"github.com/mutecomm/go-sqlcipher","version":"v0.0.0-20190227152316-55dbde17881f","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package sqlite3\n\n## Constants\n\n```go\nconst ErrNoMask C.int = 0xff\n```\nErrNoMask is mask code.\n\n## Variables\n\n```go\nvar (\n\tErrError      = ErrNo(1)  /* SQL error or missing database */\n\tErrInternal   = ErrNo(2)  /* Internal logic error in SQLite */\n\tErrPerm       = ErrNo(3)  /* Access permission denied */\n\tErrAbort      = ErrNo(4)  /* Callback routine requested an abort */\n\tErrBusy       = ErrNo(5)  /* The database file is locked */\n\tErrLocked     = ErrNo(6)  /* A table in the database is locked */\n\tErrNomem      = ErrNo(7)  /* A malloc() failed */\n\tErrReadonly   = ErrNo(8)  /* Attempt to write a readonly database */\n\tErrInterrupt  = ErrNo(9)  /* Operation terminated by sqlite3_interrupt() */\n\tErrIoErr      = ErrNo(10) /* Some kind of disk I/O error occurred */\n\tErrCorrupt    = ErrNo(11) /* The database disk image is malformed */\n\tErrNotFound   = ErrNo(12) /* Unknown opcode in sqlite3_file_control() */\n\tErrFull       = ErrNo(13) /* Insertion failed because database is full */\n\tErrCantOpen   = ErrNo(14) /* Unable to open the database file */\n\tErrProtocol   = ErrNo(15) /* Database lock protocol error */\n\tErrEmpty      = ErrNo(16) /* Database is empty */\n\tErrSchema     = ErrNo(17) /* The database schema changed */\n\tErrTooBig     = ErrNo(18) /* String or BLOB exceeds size limit */\n\tErrConstraint = ErrNo(19) /* Abort due to constraint violation */\n\tErrMismatch   = ErrNo(20) /* Data type mismatch */\n\tErrMisuse     = ErrNo(21) /* Library used incorrectly */\n\tErrNoLFS      = ErrNo(22) /* Uses OS features not supported on host */\n\tErrAuth       = ErrNo(23) /* Authorization denied */\n\tErrFormat     = ErrNo(24) /* Auxiliary database format error */\n\tErrRange      = ErrNo(25) /* 2nd parameter to sqlite3_bind out of range */\n\tErrNotADB     = ErrNo(26) /* File opened that is not a database file */\n\tErrNotice     = ErrNo(27) /* Notifications from sqlite3_log() */\n\tErrWarning    = ErrNo(28) /* Warnings from sqlite3_log() */\n)\n```\nresult codes from [http://www.sqlite.org/c3ref/c\\_abort.html](http://www.sqlite.org/c3ref/c_abort.html)\n\n```go\nvar (\n\tErrIoErrRead              = ErrIoErr.Extend(1)\n\tErrIoErrShortRead         = ErrIoErr.Extend(2)\n\tErrIoErrWrite             = ErrIoErr.Extend(3)\n\tErrIoErrFsync             = ErrIoErr.Extend(4)\n\tErrIoErrDirFsync          = ErrIoErr.Extend(5)\n\tErrIoErrTruncate          = ErrIoErr.Extend(6)\n\tErrIoErrFstat             = ErrIoErr.Extend(7)\n\tErrIoErrUnlock            = ErrIoErr.Extend(8)\n\tErrIoErrRDlock            = ErrIoErr.Extend(9)\n\tErrIoErrDelete            = ErrIoErr.Extend(10)\n\tErrIoErrBlocked           = ErrIoErr.Extend(11)\n\tErrIoErrNoMem             = ErrIoErr.Extend(12)\n\tErrIoErrAccess            = ErrIoErr.Extend(13)\n\tErrIoErrCheckReservedLock = ErrIoErr.Extend(14)\n\tErrIoErrLock              = ErrIoErr.Extend(15)\n\tErrIoErrClose             = ErrIoErr.Extend(16)\n\tErrIoErrDirClose          = ErrIoErr.Extend(17)\n\tErrIoErrSHMOpen           = ErrIoErr.Extend(18)\n\tErrIoErrSHMSize           = ErrIoErr.Extend(19)\n\tErrIoErrSHMLock           = ErrIoErr.Extend(20)\n\tErrIoErrSHMMap            = ErrIoErr.Extend(21)\n\tErrIoErrSeek              = ErrIoErr.Extend(22)\n\tErrIoErrDeleteNoent       = ErrIoErr.Extend(23)\n\tErrIoErrMMap              = ErrIoErr.Extend(24)\n\tErrIoErrGetTempPath       = ErrIoErr.Extend(25)\n\tErrIoErrConvPath          = ErrIoErr.Extend(26)\n\tErrLockedSharedCache      = ErrLocked.Extend(1)\n\tErrBusyRecovery           = ErrBusy.Extend(1)\n\tErrBusySnapshot           = ErrBusy.Extend(2)\n\tErrCantOpenNoTempDir      = ErrCantOpen.Extend(1)\n\tErrCantOpenIsDir          = ErrCantOpen.Extend(2)\n\tErrCantOpenFullPath       = ErrCantOpen.Extend(3)\n\tErrCantOpenConvPath       = ErrCantOpen.Extend(4)\n\tErrCorruptVTab            = ErrCorrupt.Extend(1)\n\tErrReadonlyRecovery       = ErrReadonly.Extend(1)\n\tErrReadonlyCantLock       = ErrReadonly.Extend(2)\n\tErrReadonlyRollback       = ErrReadonly.Extend(3)\n\tErrReadonlyDbMoved        = ErrReadonly.Extend(4)\n\tErrAbortRollback          = ErrAbort.Extend(2)\n\tErrConstraintCheck        = ErrConstraint.Extend(1)\n\tErrConstraintCommitHook   = ErrConstraint.Extend(2)\n\tErrConstraintForeignKey   = ErrConstraint.Extend(3)\n\tErrConstraintFunction     = ErrConstraint.Extend(4)\n\tErrConstraintNotNull      = ErrConstraint.Extend(5)\n\tErrConstraintPrimaryKey   = ErrConstraint.Extend(6)\n\tErrConstraintTrigger      = ErrConstraint.Extend(7)\n\tErrConstraintUnique       = ErrConstraint.Extend(8)\n\tErrConstraintVTab         = ErrConstraint.Extend(9)\n\tErrConstraintRowID        = ErrConstraint.Extend(10)\n\tErrNoticeRecoverWAL       = ErrNotice.Extend(1)\n\tErrNoticeRecoverRollback  = ErrNotice.Extend(2)\n\tErrWarningAutoIndex       = ErrWarning.Extend(1)\n)\n```\nresult codes from [http://www.sqlite.org/c3ref/c\\_abort\\_rollback.html](http://www.sqlite.org/c3ref/c_abort_rollback.html)\n\n```go\nvar SQLiteTimestampFormats = []string{\n\n\t\"2006-01-02 15:04:05.999999999-07:00\",\n\t\"2006-01-02T15:04:05.999999999-07:00\",\n\t\"2006-01-02 15:04:05.999999999\",\n\t\"2006-01-02T15:04:05.999999999\",\n\t\"2006-01-02 15:04:05\",\n\t\"2006-01-02T15:04:05\",\n\t\"2006-01-02 15:04\",\n\t\"2006-01-02T15:04\",\n\t\"2006-01-02\",\n}\n```\nSQLiteTimestampFormats is timestamp formats understood by both this module and SQLite.  The first format in the slice will be used when saving time values into the database. When parsing a string from a timestamp or datetime column, the formats are tried in order.\n\n## Functions\n\n```go\nfunc IsEncrypted(filename string) (bool, error)\n```\nIsEncrypted returns true, if the database with the given filename is encrypted, and false otherwise. If the database header cannot be read properly an error is returned.\n\n```go\nfunc Version() (libVersion string, libVersionNumber int, sourceID string)\n```\nVersion returns SQLite library version information.\n\n## Types\n\n```go\ntype ErrNo int\n```\nErrNo inherit errno.\n\n```go\nfunc (err ErrNo) Error() string\n```\nError return error message from errno.\n\n```go\nfunc (err ErrNo) Extend(by int) ErrNoExtended\n```\nExtend return extended errno.\n\n```go\ntype ErrNoExtended int\n```\nErrNoExtended is extended errno.\n\n```go\nfunc (err ErrNoExtended) Error() string\n```\nError return error message that is extended code.\n\n```go\ntype Error struct {\n\tCode         ErrNo         /* The error code returned by SQLite */\n\tExtendedCode ErrNoExtended /* The extended error code returned by SQLite */\n\t// contains filtered or unexported fields\n}\n```\nError implement sqlite error code.\n\n```go\nfunc (err Error) Error() string\n```\n\n```go\ntype SQLiteConn struct {\n\t// contains filtered or unexported fields\n}\n```\nSQLiteConn implement sql.Conn.\n\n```go\nfunc (c *SQLiteConn) AutoCommit() bool\n```\nAutoCommit return which currently auto commit or not.\n\n```go\nfunc (c *SQLiteConn) Begin() (driver.Tx, error)\n```\nBegin transaction.\n\n```go\nfunc (c *SQLiteConn) Close() error\n```\nClose the connection.\n\n```go\nfunc (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error)\n```\nExec implements Execer.\n\n```go\nfunc (c *SQLiteConn) Prepare(query string) (driver.Stmt, error)\n```\nPrepare the query string. Return a new statement.\n\n```go\nfunc (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error)\n```\nQuery implements Queryer.\n\n```go\ntype SQLiteDriver struct {\n\tConnectHook func(*SQLiteConn) error\n}\n```\nSQLiteDriver implement sql.Driver.\n\n```go\nfunc (d *SQLiteDriver) Open(dsn string) (driver.Conn, error)\n```\nOpen database and return a new connection. You can specify a DSN string using a URI as the filename.\n\n\ttest.db\n\tfile:test.db?cache=shared\u0026mode=memory\n\t:memory:\n\tfile::memory:\n\ngo-sqlite3 adds the following query parameters to those used by SQLite:\n\n\t_loc=XXX\n\t  Specify location of time format. It's possible to specify \"auto\".\n\t_busy_timeout=XXX\n\t  Specify value for sqlite3_busy_timeout.\n\t_txlock=XXX\n\t  Specify locking behavior for transactions.  XXX can be \"immediate\",\n\t  \"deferred\", \"exclusive\".\n\t_foreign_keys=X\n\t  Enable or disable enforcement of foreign keys.  X can be 1 or 0.\n\ngo-sqlcipher adds the following query parameters to those used by SQLite:\n\n\t_pragma_key=XXX\n\t  Specify PRAGMA key.\n\t_pragma_cipher_page_size=XXX\n\t  Set the PRAGMA cipher_page_size to adjust the page size.\n\n```go\ntype SQLiteResult struct {\n\t// contains filtered or unexported fields\n}\n```\nSQLiteResult implement sql.Result.\n\n```go\nfunc (r *SQLiteResult) LastInsertId() (int64, error)\n```\nLastInsertId teturn last inserted ID.\n\n```go\nfunc (r *SQLiteResult) RowsAffected() (int64, error)\n```\nRowsAffected return how many rows affected.\n\n```go\ntype SQLiteRows struct {\n\t// contains filtered or unexported fields\n}\n```\nSQLiteRows implement sql.Rows.\n\n```go\nfunc (rc *SQLiteRows) Close() error\n```\nClose the rows.\n\n```go\nfunc (rc *SQLiteRows) Columns() []string\n```\nColumns return column names.\n\n```go\nfunc (rc *SQLiteRows) DeclTypes() []string\n```\nDeclTypes return column types.\n\n```go\nfunc (rc *SQLiteRows) Next(dest []driver.Value) error\n```\nNext move cursor to next.\n\n```go\ntype SQLiteStmt struct {\n\t// contains filtered or unexported fields\n}\n```\nSQLiteStmt implement sql.Stmt.\n\n```go\nfunc (s *SQLiteStmt) Close() error\n```\nClose the statement.\n\n```go\nfunc (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error)\n```\nExec execute the statement with arguments. Return result object.\n\n```go\nfunc (s *SQLiteStmt) NumInput() int\n```\nNumInput return a number of parameters.\n\n```go\nfunc (s *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error)\n```\nQuery the statement with arguments. Return records.\n\n```go\ntype SQLiteTx struct {\n\t// contains filtered or unexported fields\n}\n```\nSQLiteTx implemen sql.Tx.\n\n```go\nfunc (tx *SQLiteTx) Commit() error\n```\nCommit transaction.\n\n```go\nfunc (tx *SQLiteTx) Rollback() error\n```\nRollback transaction.\n\n","path":"github.com/mutecomm/go-sqlcipher","name":"sqlite3","synopsis":"","isRedistributable":true}
