mirror of
https://github.com/frappe/books.git
synced 2024-11-10 15:50:56 +00:00
17 lines
410 B
JavaScript
17 lines
410 B
JavaScript
const frappe = require('frappejs');
|
|
const server = require('frappejs/server');
|
|
const SQLite = require('frappejs/backends/sqlite');
|
|
|
|
module.exports = {
|
|
async initSqlite({ dbPath = '_test.db', models } = {}) {
|
|
server.init();
|
|
if (models) {
|
|
frappe.registerModels(models, 'server');
|
|
}
|
|
|
|
frappe.db = new SQLite({ dbPath });
|
|
await frappe.db.connect();
|
|
await frappe.db.migrate();
|
|
}
|
|
};
|