feat: 增加构建 sqlite3 二进制文件的脚本

This commit is contained in:
qier222 2022-04-03 13:41:08 +08:00
parent e748155032
commit 9971418b8c
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
6 changed files with 73 additions and 20 deletions

View file

@ -27,7 +27,9 @@ const dbFilePath = path.resolve(
)
createFileIfNotExist(dbFilePath)
const sqlite = new SQLite3(dbFilePath)
const sqlite = new SQLite3(dbFilePath, {
nativeBinding: path.join(__dirname, `./better_sqlite3_${process.arch}.node`),
})
sqlite.pragma('auto_vacuum = FULL')
// Init tables if not exist