@@ -971,103 +971,104 @@ func (c *SQLiteConn) begin(ctx context.Context) (driver.Tx, error) {
971
971
// The argument is may be either in parentheses or it may be separated from
972
972
// the pragma name by an equal sign. The two syntaxes yield identical results.
973
973
// In many pragmas, the argument is a boolean. The boolean can be one of:
974
- // 1 yes true on
975
- // 0 no false off
974
+ //
975
+ // 1 yes true on
976
+ // 0 no false off
976
977
//
977
978
// You can specify a DSN string using a URI as the filename.
978
- // test.db
979
- // file:test.db?cache=shared&mode=memory
980
- // :memory:
981
- // file::memory:
982
979
//
983
- // mode
984
- // Access mode of the database.
985
- // https://www.sqlite.org/c3ref/open.html
986
- // Values:
987
- // - ro
988
- // - rw
989
- // - rwc
990
- // - memory
980
+ // test.db
981
+ // file:test.db?cache=shared&mode=memory
982
+ // :memory:
983
+ // file::memory:
991
984
//
992
- // cache
993
- // SQLite Shared-Cache Mode
994
- // https://www.sqlite.org/sharedcache.html
995
- // Values:
996
- // - shared
997
- // - private
985
+ // mode
986
+ // Access mode of the database.
987
+ // https://www.sqlite.org/c3ref/open.html
988
+ // Values:
989
+ // - ro
990
+ // - rw
991
+ // - rwc
992
+ // - memory
998
993
//
999
- // immutable=Boolean
1000
- // The immutable parameter is a boolean query parameter that indicates
1001
- // that the database file is stored on read-only media. When immutable is set,
1002
- // SQLite assumes that the database file cannot be changed,
1003
- // even by a process with higher privilege,
1004
- // and so the database is opened read-only and all locking and change detection is disabled.
1005
- // Caution: Setting the immutable property on a database file that
1006
- // does in fact change can result in incorrect query results and/or SQLITE_CORRUPT errors.
994
+ // cache
995
+ // SQLite Shared-Cache Mode
996
+ // https://www.sqlite.org/sharedcache.html
997
+ // Values:
998
+ // - shared
999
+ // - private
1007
1000
//
1008
- // go-sqlite3 adds the following query parameters to those used by SQLite:
1009
- // _loc=XXX
1010
- // Specify location of time format. It's possible to specify "auto".
1001
+ // immutable=Boolean
1002
+ // The immutable parameter is a boolean query parameter that indicates
1003
+ // that the database file is stored on read-only media. When immutable is set,
1004
+ // SQLite assumes that the database file cannot be changed,
1005
+ // even by a process with higher privilege,
1006
+ // and so the database is opened read-only and all locking and change detection is disabled.
1007
+ // Caution: Setting the immutable property on a database file that
1008
+ // does in fact change can result in incorrect query results and/or SQLITE_CORRUPT errors.
1011
1009
//
1012
- // _mutex=XXX
1013
- // Specify mutex mode. XXX can be "no", "full".
1010
+ // go-sqlite3 adds the following query parameters to those used by SQLite:
1014
1011
//
1015
- // _txlock=XXX
1016
- // Specify locking behavior for transactions. XXX can be "immediate",
1017
- // "deferred", "exclusive".
1012
+ // _loc=XXX
1013
+ // Specify location of time format. It's possible to specify "auto".
1018
1014
//
1019
- // _auto_vacuum=X | _vacuum=X
1020
- // 0 | none - Auto Vacuum disabled
1021
- // 1 | full - Auto Vacuum FULL
1022
- // 2 | incremental - Auto Vacuum Incremental
1015
+ // _mutex=XXX
1016
+ // Specify mutex mode. XXX can be "no", "full".
1023
1017
//
1024
- // _busy_timeout=XXX"| _timeout=XXX
1025
- // Specify value for sqlite3_busy_timeout.
1018
+ // _txlock=XXX
1019
+ // Specify locking behavior for transactions. XXX can be "immediate",
1020
+ // "deferred", "exclusive".
1026
1021
//
1027
- // _case_sensitive_like=Boolean | _cslike=Boolean
1028
- // https://www.sqlite.org/pragma.html#pragma_case_sensitive_like
1029
- // Default or disabled the LIKE operation is case-insensitive.
1030
- // When enabling this options behaviour of LIKE will become case-sensitive.
1022
+ // _auto_vacuum=X | _vacuum=X
1023
+ // 0 | none - Auto Vacuum disabled
1024
+ // 1 | full - Auto Vacuum FULL
1025
+ // 2 | incremental - Auto Vacuum Incremental
1031
1026
//
1032
- // _defer_foreign_keys=Boolean | _defer_fk=Boolean
1033
- // Defer Foreign Keys until outermost transaction is committed .
1027
+ // _busy_timeout=XXX"| _timeout=XXX
1028
+ // Specify value for sqlite3_busy_timeout .
1034
1029
//
1035
- // _foreign_keys=Boolean | _fk=Boolean
1036
- // Enable or disable enforcement of foreign keys.
1030
+ // _case_sensitive_like=Boolean | _cslike=Boolean
1031
+ // https://www.sqlite.org/pragma.html#pragma_case_sensitive_like
1032
+ // Default or disabled the LIKE operation is case-insensitive.
1033
+ // When enabling this options behaviour of LIKE will become case-sensitive.
1037
1034
//
1038
- // _ignore_check_constraints=Boolean
1039
- // This pragma enables or disables the enforcement of CHECK constraints.
1040
- // The default setting is off, meaning that CHECK constraints are enforced by default.
1035
+ // _defer_foreign_keys=Boolean | _defer_fk=Boolean
1036
+ // Defer Foreign Keys until outermost transaction is committed.
1041
1037
//
1042
- // _journal_mode=MODE | _journal=MODE
1043
- // Set journal mode for the databases associated with the current connection.
1044
- // https://www.sqlite.org/pragma.html#pragma_journal_mode
1038
+ // _foreign_keys=Boolean | _fk=Boolean
1039
+ // Enable or disable enforcement of foreign keys.
1045
1040
//
1046
- // _locking_mode=X | _locking=X
1047
- // Sets the database connection locking-mode.
1048
- // The locking-mode is either NORMAL or EXCLUSIVE.
1049
- // https://www.sqlite.org/pragma.html#pragma_locking_mode
1041
+ // _ignore_check_constraints=Boolean
1042
+ // This pragma enables or disables the enforcement of CHECK constraints.
1043
+ // The default setting is off, meaning that CHECK constraints are enforced by default.
1050
1044
//
1051
- // _query_only=Boolean
1052
- // The query_only pragma prevents all changes to database files when enabled.
1045
+ // _journal_mode=MODE | _journal=MODE
1046
+ // Set journal mode for the databases associated with the current connection.
1047
+ // https://www.sqlite.org/pragma.html#pragma_journal_mode
1053
1048
//
1054
- // _recursive_triggers=Boolean | _rt=Boolean
1055
- // Enable or disable recursive triggers.
1049
+ // _locking_mode=X | _locking=X
1050
+ // Sets the database connection locking-mode.
1051
+ // The locking-mode is either NORMAL or EXCLUSIVE.
1052
+ // https://www.sqlite.org/pragma.html#pragma_locking_mode
1056
1053
//
1057
- // _secure_delete=Boolean|FAST
1058
- // When secure_delete is on, SQLite overwrites deleted content with zeros.
1059
- // https://www.sqlite.org/pragma.html#pragma_secure_delete
1054
+ // _query_only=Boolean
1055
+ // The query_only pragma prevents all changes to database files when enabled.
1060
1056
//
1061
- // _synchronous=X | _sync=X
1062
- // Change the setting of the "synchronous" flag.
1063
- // https://www.sqlite.org/pragma.html#pragma_synchronous
1057
+ // _recursive_triggers=Boolean | _rt=Boolean
1058
+ // Enable or disable recursive triggers.
1064
1059
//
1065
- // _writable_schema=Boolean
1066
- // When this pragma is on, the SQLITE_MASTER tables in which database
1067
- // can be changed using ordinary UPDATE, INSERT, and DELETE statements.
1068
- // Warning: misuse of this pragma can easily result in a corrupt database file.
1060
+ // _secure_delete=Boolean|FAST
1061
+ // When secure_delete is on, SQLite overwrites deleted content with zeros.
1062
+ // https://www.sqlite.org/pragma.html#pragma_secure_delete
1069
1063
//
1064
+ // _synchronous=X | _sync=X
1065
+ // Change the setting of the "synchronous" flag.
1066
+ // https://www.sqlite.org/pragma.html#pragma_synchronous
1070
1067
//
1068
+ // _writable_schema=Boolean
1069
+ // When this pragma is on, the SQLITE_MASTER tables in which database
1070
+ // can be changed using ordinary UPDATE, INSERT, and DELETE statements.
1071
+ // Warning: misuse of this pragma can easily result in a corrupt database file.
1071
1072
func (d * SQLiteDriver ) Open (dsn string ) (driver.Conn , error ) {
1072
1073
if C .sqlite3_threadsafe () == 0 {
1073
1074
return nil , errors .New ("sqlite library was not compiled for thread-safe operation" )
0 commit comments