You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure dialects, timestamps, pagination, relation limits, transaction retries, SQL features, and soft deletes in `config/query-builder.ts`. SQLite is the default dialect. The database proxy initializes the query builder lazily on first use.
50
+
51
+
## SQLite write throughput
52
+
53
+
Stacks defaults to a WAL checkpoint threshold of one page. Applications with frequent writes can choose a larger threshold through `sqlite.pragmas` in `config/query-builder.ts`:
54
+
55
+
```ts
56
+
// Add this block to the existing query-builder configuration.
57
+
sqlite: {
58
+
pragmas: [
59
+
'PRAGMA wal_autocheckpoint = 1000',
60
+
'PRAGMA synchronous = FULL',
61
+
],
62
+
},
63
+
```
64
+
65
+
Application pragmas run after the framework defaults on both the query-builder connection and the model writer. This example keeps foreign-key enforcement and the busy timeout, reduces checkpoint frequency, and requests full commit synchronization. The one-page default remains in effect when no checkpoint override is configured. See SQLite's [checkpoint threshold](https://www.sqlite.org/pragma.html#pragma_wal_autocheckpoint) and [synchronization modes](https://www.sqlite.org/pragma.html#pragma_synchronous) for the performance and durability tradeoffs.
66
+
67
+
Committed rows may remain in the WAL sidecar longer with a larger threshold. Use `buddy db:backup`, which creates a consistent SQLite snapshot, instead of copying only the main database file. Measure the chosen settings on the deployment's storage, and label tuned benchmark results separately from stock defaults.
0 commit comments