qwik-account-manager/libs/database.js

21 lines
426 B
JavaScript
Raw Normal View History

2022-01-15 19:27:18 +01:00
import SQLDatabase from 'better-sqlite3'
2022-01-22 21:32:14 +01:00
/**
* @typedef {object} User
* @param {string} name
* @param {string} passbcrypt
* @param {number} uidnumber
* @param {number} id
* @param {number} disabled
*/
/**
* @type {SQLDatabase.Database}
*/
2022-01-15 19:27:18 +01:00
export let glauth = undefined
export function dbInit() {
2022-01-15 20:40:41 +01:00
glauth = new SQLDatabase(process.env.GLAUTH_DB ?? 'auth.db', {})
2022-01-15 19:27:18 +01:00
console.log(`Loaded in GLAuth - users.db`)
}