mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-21 06:26:52 +00:00
Move the database file into a "store" directory inside the wiki folder
This commit is contained in:
parent
4b6872aa42
commit
262a730534
@ -35,7 +35,7 @@ exports.startup = function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Compute the database path
|
// 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
|
// Create and initialise the tiddler store
|
||||||
var SqlTiddlerStore = require("$:/plugins/tiddlywiki/multiwikiserver/sql-tiddler-store.js").SqlTiddlerStore;
|
var SqlTiddlerStore = require("$:/plugins/tiddlywiki/multiwikiserver/sql-tiddler-store.js").SqlTiddlerStore;
|
||||||
$tw.sqlTiddlerStore = new SqlTiddlerStore({
|
$tw.sqlTiddlerStore = new SqlTiddlerStore({
|
||||||
|
@ -20,6 +20,9 @@ databasePath - path to the database file (can be ":memory:" to get a temporary d
|
|||||||
function SqlTiddlerDatabase(options) {
|
function SqlTiddlerDatabase(options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
// Create the database
|
// Create the database
|
||||||
|
if(options.databasePath) {
|
||||||
|
$tw.utils.createFileDirectories(options.databasePath);
|
||||||
|
}
|
||||||
var databasePath = options.databasePath || ":memory:";
|
var databasePath = options.databasePath || ":memory:";
|
||||||
this.db = new $tw.sqlite3.Database(databasePath,{verbose: undefined && console.log});
|
this.db = new $tw.sqlite3.Database(databasePath,{verbose: undefined && console.log});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user