1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00

Additional method to retrieve all titles

This commit is contained in:
jeremy@jermolene.com 2023-06-23 17:33:35 +01:00
parent 8690936805
commit 9427cf7ac6

View File

@ -61,10 +61,21 @@ $tw.Wiki = function(options) {
return undefined;
}
}
function sqlAllTitles() {
let resultRows = [];
db.exec({
sql: "select title from tiddlers order by title",
rowMode: "object",
resultRows: resultRows
});
return resultRows;
}
sqlSaveTiddler({title: "HelloThere", text: "One"});
console.log(sqlGetTiddler("HelloThere"));
sqlSaveTiddler({title: "HelloThere", text: "Two", custom: "A custom field"});
console.log(sqlGetTiddler("HelloThere"));
sqlSaveTiddler({title: "AnotherTiddler", text: "Three"});
console.log(sqlAllTitles());
// Plain JS wiki store implementation follows
options = options || {};
var self = this,