From 2d229e215977f2f78b0300877be9a1b223e117a4 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Thu, 6 Jul 2023 11:53:41 +0100 Subject: [PATCH] Add logging utility --- plugins/tiddlywiki/sqlite3store/sql-functions.js | 10 ++++++++++ plugins/tiddlywiki/sqlite3store/sql-wiki-store.js | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/plugins/tiddlywiki/sqlite3store/sql-functions.js b/plugins/tiddlywiki/sqlite3store/sql-functions.js index 32e662b09..775ec30b0 100644 --- a/plugins/tiddlywiki/sqlite3store/sql-functions.js +++ b/plugins/tiddlywiki/sqlite3store/sql-functions.js @@ -232,6 +232,16 @@ $tw.SqlFunctions = function(options) { } statementEachShadowPlusTiddlers.reset(); }; + var statementLogTables = self.db.prepare("select title, shadow, meta, text from tiddlers order by title,shadow"); + this.sqlLogTables = function() { + let resultRows = []; + while(statementLogTables.step()) { + var row = statementLogTables.get({}); + resultRows.push(row); + } + statementLogTables.reset(); + console.log(resultRows); + }; }; })(); diff --git a/plugins/tiddlywiki/sqlite3store/sql-wiki-store.js b/plugins/tiddlywiki/sqlite3store/sql-wiki-store.js index f4711f587..00120458c 100644 --- a/plugins/tiddlywiki/sqlite3store/sql-wiki-store.js +++ b/plugins/tiddlywiki/sqlite3store/sql-wiki-store.js @@ -77,6 +77,10 @@ $tw.Wiki = function(options) { } }; + this.logTables = function() { + self.sqlFunctions.sqlLogTables(); + } + this.addIndexer = function(indexer,name) { return; };