From 358d02d97f77a8223e7459f42d43c2605e5c0da0 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 16 Aug 2023 22:57:16 +0000 Subject: [PATCH] Another index I've wanted, and better error display for queries in the ssb app. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4403 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb/tf-tab-query.js | 5 ++++- src/ssb.db.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/ssb/tf-tab-query.js b/apps/ssb/tf-tab-query.js index bec5a7d8..566aadc1 100644 --- a/apps/ssb/tf-tab-query.js +++ b/apps/ssb/tf-tab-query.js @@ -86,7 +86,10 @@ class TfTabQueryElement extends LitElement { } render_error() { - return html`
${JSON.stringify(this.error, null, 2)}
`; + if (this.error) { + return html`

${this.error.message}

+
${this.error.stack}
`; + } } render() { diff --git a/src/ssb.db.c b/src/ssb.db.c index 9c06566a..89424ce4 100644 --- a/src/ssb.db.c +++ b/src/ssb.db.c @@ -112,6 +112,7 @@ void tf_ssb_db_init(tf_ssb_t* ssb) _tf_ssb_db_exec(db, "CREATE INDEX IF NOT EXISTS messages_author_id_index ON messages (author, id)"); _tf_ssb_db_exec(db, "CREATE INDEX IF NOT EXISTS messages_author_sequence_index ON messages (author, sequence)"); _tf_ssb_db_exec(db, "CREATE INDEX IF NOT EXISTS messages_author_timestamp_index ON messages (author, timestamp)"); + _tf_ssb_db_exec(db, "CREATE INDEX IF NOT EXISTS messages_timestamp_index ON messages (timestamp)"); _tf_ssb_db_exec(db, "CREATE TABLE IF NOT EXISTS blobs (" " id TEXT PRIMARY KEY,"