Files
socket-service/src/sqlite/index.ts
Vadim 05e9fb3cda
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 56s
wip
2026-04-12 22:22:44 +03:00

11 lines
361 B
TypeScript

import { Database, constants } from 'bun:sqlite'
const db = new Database('db.sqlite', {create: true, strict: true})
db.run('PRAGMA journal_mode = WAL;')
db.fileControl(constants.SQLITE_FCNTL_PERSIST_WAL, 0)
// Checkpoint and truncate the WAL file
db.run('PRAGMA wal_checkpoint(TRUNCATE);')
db.close()
const query = db.query(`select "Hello world" as message`)