Move the database file into a "store" directory inside the wiki folder

This commit is contained in:
Jeremy Ruston 2024-01-29 18:11:50 +00:00
parent 4b6872aa42
commit 262a730534
2 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,7 @@ exports.startup = function() {
return;
}
// Compute the database path
var databasePath = path.resolve($tw.boot.wikiPath,"database.sqlite");
var databasePath = path.resolve($tw.boot.wikiPath,"store/database.sqlite");
// Create and initialise the tiddler store
var SqlTiddlerStore = require("$:/plugins/tiddlywiki/multiwikiserver/sql-tiddler-store.js").SqlTiddlerStore;
$tw.sqlTiddlerStore = new SqlTiddlerStore({

View File

@ -20,6 +20,9 @@ databasePath - path to the database file (can be ":memory:" to get a temporary d
function SqlTiddlerDatabase(options) {
options = options || {};
// Create the database
if(options.databasePath) {
$tw.utils.createFileDirectories(options.databasePath);
}
var databasePath = options.databasePath || ":memory:";
this.db = new $tw.sqlite3.Database(databasePath,{verbose: undefined && console.log});
}