From 6ca2cc22977f729fb6e40bdd0f00da4edf3cb777 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sun, 18 Jun 2023 03:31:22 +0100 Subject: add script to init db --- server/init_db.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 server/init_db.lua (limited to 'server') diff --git a/server/init_db.lua b/server/init_db.lua new file mode 100644 index 0000000..c4165f5 --- /dev/null +++ b/server/init_db.lua @@ -0,0 +1,14 @@ +local lmdb = require'lmdb' +local env = assert(lmdb.open('data',{maxdbs=16})) +local txn = assert(env:txn_begin(true)) + +local dbs = { + 'chunks', +} + +for _,dbname in ipairs(dbs) do + assert(txn:open(dbname, true)) +end + +txn:commit() + -- cgit v1.2.3