
To disable extension loading add the build tag sqlite_omit_load_extension. Loading of external extensions is enabled by default.
#Golang sqlite code#
When defined, this C-preprocessor macro activates extra code that attempts to detect misuse of the SQLite API, such as passing in NULL pointers to required parameters or using objects after they have been destroyed.Īpp Armor is not available under Windows. However, if SQLite is compiled with the SQLITE_ALLOW_URI_AUTHORITY compile-time option, then the URI is converted into a Uniform Naming Convention (UNC) filename and passed down to the underlying operating system that way URI filenames normally throws an error if the authority section is not either empty or "localhost". The SQLITE_ENABLE_STAT3 compile-time option is a no-op and is ignored if the SQLITE_ENABLE_STAT4 compile-time option is used STAT3 only recorded histogram data for the left-most column of each index whereas the STAT4 enhancement records histogram data from all columns of each index. SQLITE_ENABLE_STAT4 is an enhancement of SQLITE_ENABLE_STAT3. The downside of this compile-time option is that it violates the query planner stability guarantee making it more difficult to ensure consistent performance in mass-produced applications. The query planner will then use the histogram data to help it make better index choices. The ANALYZE command is enhanced to collect histogram data from all columns of every index and store that data in the sqlite_stat4 table. This option adds additional logic to the ANALYZE command and to the query planner that can help SQLite to chose a better query plan under certain situations. Go build -tags "icu json1 fts5 secure_delete " Feature / Extension List Extension Maximum cache size default is 2000K (2M).

Warning: misuse of this pragma can easily result in a corrupt database file. When this pragma is on, the SQLITE_MASTER tables in which database can be changed using ordinary UPDATE, INSERT, and DELETE statements. Specify locking behavior for transactions. Set cache mode for more information see įor more information see PRAGMA synchronous For more information see SQLite Openįor more information see PRAGMA query_onlyįor more information see PRAGMA recursive_triggersįor more information see PRAGMA secure_delete For more information see PRAGMA busy_timeoutįor more information see PRAGMA case_sensitive_likeįor more information see PRAGMA defer_foreign_keysįor more information see PRAGMA foreign_keysįor more information see PRAGMA ignore_check_constraintsįor more information see PRAGMA journal_modeįor more information see PRAGMA locking_modeĪccess Mode of the database.

#Golang sqlite password#
Salt to use if the configure password encoder requires a salt, for User Authentication, for more information see User Authenticationįor more information see PRAGMA auto_vacuum Password encoder to use for User Authentication, for more information see User Authentication Password for User Authentication, for more information see User Authentication Username for User Authentication, for more information see User Authentication This library supports DSN options of SQLite itself and provides additional options.Ĭreate User Authentication, for more information see User Authentication Options can be given using the following format: KEYWORD=VALUE and multiple options can be combined with the & ampersand. This also applies when using an in-memory database instead of a file. Options should be URL-encoded (see url.QueryEscape). The database filename and options are separated by an ? (Question Mark). Options are append after the filename of the SQLite database.

This is also known as a DSN (Data Source Name) string. When creating a new SQLite database or connection to an existing one, with the file name additional options can be given. API ReferenceĮxamples can be found under the examples directory. Important: because this is a CGO enabled package, you are required to set the environment variable CGO_ENABLED=1 and have a gcc compile present within your path.

#Golang sqlite install#
However, after you have built and installed go-sqlite3 with go install /mattn/go-sqlite3 (which requires gcc), you can build your app without relying on gcc in future. If you want to build your app using go-sqlite3, you need gcc.
