From 58003407627b5d68d06d9989d1fd23d398955797 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 28 Feb 2024 20:41:27 -0500 Subject: [PATCH] Fix up some more jsonb references. --- apps/ssb.json | 2 +- apps/ssb/tf-app.js | 2 +- apps/ssb/tf-compose.js | 2 +- apps/ssb/tf-tab-mentions.js | 2 +- apps/ssb/tf-tab-search.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index e63230b7..2932e427 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&fro6dEqPfrkbxnrFGIO0KsRPFzi9jhWMXBgmYKTHNW0=.sha256" + "previous": "&oPRvet0lD7W47N5YKm0IKpIX8q5zC12mIsHSVLCxex4=.sha256" } diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index 9becccc3..c191e879 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -158,7 +158,7 @@ class TfElement extends LitElement { async fetch_new_message(id) { let messages = await tfrpc.rpc.query( ` - SELECT messages.id, previous, author, sequence, timestamp, hash, json(content), signature + SELECT messages.id, previous, author, sequence, timestamp, hash, json(content) AS content, signature FROM messages JOIN json_each(?) AS following ON messages.author = following.value WHERE messages.id = ? diff --git a/apps/ssb/tf-compose.js b/apps/ssb/tf-compose.js index 96a7ae63..7ecf0155 100644 --- a/apps/ssb/tf-compose.js +++ b/apps/ssb/tf-compose.js @@ -262,7 +262,7 @@ class TfComposeElement extends LitElement { try { let rows = await tfrpc.rpc.query( ` - SELECT messages.content FROM messages_fts(?) + SELECT json(messages.content) FROM messages_fts(?) JOIN messages ON messages.rowid = messages_fts.rowid WHERE messages.content LIKE ? ORDER BY timestamp DESC LIMIT 10 diff --git a/apps/ssb/tf-tab-mentions.js b/apps/ssb/tf-tab-mentions.js index 944f61cf..014fc3ce 100644 --- a/apps/ssb/tf-tab-mentions.js +++ b/apps/ssb/tf-tab-mentions.js @@ -29,7 +29,7 @@ class TfTabMentionsElement extends LitElement { console.log('Loading...', this.whoami); let results = await tfrpc.rpc.query( ` - SELECT messages.* + SELECT messages.id, messages.previous, messages.author, messages.sequence, messages.timestamp, messages.hash, json(messages.content) AS content, messages.signature FROM messages_fts(?) JOIN messages ON messages.rowid = messages_fts.rowid JOIN json_each(?) AS following ON messages.author = following.value diff --git a/apps/ssb/tf-tab-search.js b/apps/ssb/tf-tab-search.js index f5764cc3..b36bc823 100644 --- a/apps/ssb/tf-tab-search.js +++ b/apps/ssb/tf-tab-search.js @@ -35,7 +35,7 @@ class TfTabSearchElement extends LitElement { await tfrpc.rpc.setHash('#q=' + encodeURIComponent(query)); let results = await tfrpc.rpc.query( ` - SELECT messages.* + SELECT messages.id, messages.previous, messages.author, messages.sequence, messages.timestamp, messages.hash, json(messages.content) AS content, messages.signature FROM messages_fts(?) JOIN messages ON messages.rowid = messages_fts.rowid JOIN json_each(?) AS following ON messages.author = following.value