implement sqlite write queue

This commit is contained in:
2024-10-10 15:01:45 -05:00
parent 3574d07997
commit 1e33a81a2c
11 changed files with 225 additions and 192 deletions

View File

@@ -24,7 +24,7 @@ type Root struct {
}
func main() {
dbPaths := []string{"test.db", "nkode.db"}
dbPaths := []string{"/Users/donov/databases/test.db", "/Users/donov/databases/nkode.db"}
outputStr := MakeSvgFiles()
for _, path := range dbPaths {
MakeTables(path)
@@ -57,7 +57,7 @@ VALUES (?)
}
func MakeSvgFiles() string {
jsonFiles, err := GetAllFiles("./core//sqlite-init/json")
jsonFiles, err := GetAllFiles("./core/sqlite-init/json")
if err != nil {
log.Fatalf("Error getting JSON files: %v", err)
}
@@ -146,7 +146,7 @@ func MakeTables(dbPath string) {
PRAGMA journal_mode=WAL;
--PRAGMA busy_timeout = 5000; -- Wait up to 5 seconds
--PRAGMA synchronous = NORMAL; -- Reduce sync frequency for less locking
--PRAGMA cache_size = -16000; -- Increase cache size (16MB)PRAGMA foreign_keys = ON;
--PRAGMA cache_size = -16000; -- Increase cache size (16MB)PRAGMA
CREATE TABLE IF NOT EXISTS customer (
id TEXT NOT NULL PRIMARY KEY,