aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-09-29 17:11:43 -0300
committerEuAndreh <eu@euandre.org>2024-10-01 07:48:49 -0300
commitb4bf9ec6fcbd085d9978e05097d301fc7f8bc1dd (patch)
treecc933785c49635d7f7a6eddf5c1bf4c5ebcb00d7
parentsrc/golite.go: Remove ~silly~ secure_delete option (diff)
downloadgolite-b4bf9ec6fcbd085d9978e05097d301fc7f8bc1dd.tar.gz
golite-b4bf9ec6fcbd085d9978e05097d301fc7f8bc1dd.tar.xz
src/golite.go: Use hard-coded value for synchronous PRAGMA
-rw-r--r--src/golite.go27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/golite.go b/src/golite.go
index d7bd3ec..6f65565 100644
--- a/src/golite.go
+++ b/src/golite.go
@@ -2212,7 +2212,6 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
lockingMode := "NORMAL"
queryOnly := -1
recursiveTriggers := -1
- synchronousMode := "NORMAL"
writableSchema := -1
vfsName := ""
var cacheSize *int64
@@ -2422,26 +2421,6 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
}
}
- // Synchronous Mode (_synchronous | _sync)
- //
- // https://www.sqlite.org/pragma.html#pragma_synchronous
- //
- pkey = "" // Reset pkey
- if _, ok := params["_synchronous"]; ok {
- pkey = "_synchronous"
- }
- if _, ok := params["_sync"]; ok {
- pkey = "_sync"
- }
- if val := params.Get(pkey); val != "" {
- switch strings.ToUpper(val) {
- case "0", "OFF", "1", "NORMAL", "2", "FULL", "3", "EXTRA":
- synchronousMode = strings.ToUpper(val)
- default:
- return nil, fmt.Errorf("Invalid _synchronous: %v, expecting value of '0 OFF 1 NORMAL 2 FULL 3 EXTRA'", val)
- }
- }
-
// Writable Schema (_writeable_schema)
//
// https://www.sqlite.org/pragma.html#pragma_writeable_schema
@@ -2593,10 +2572,8 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
}
}
- // Synchronous Mode
- //
- // Because default is NORMAL this statement is always executed
- if err := exec(fmt.Sprintf("PRAGMA synchronous = %s;", synchronousMode)); err != nil {
+ // FIXME: see ~/dev/papo/STUFF/napiqlite/src/napiqlite.c
+ if err := exec("PRAGMA synchronous = EXTRA;"); err != nil {
conn.Close()
return nil, err
}