Fix up some more jsonb references.

This commit is contained in:
Cory McWilliams 2024-02-28 20:41:27 -05:00
parent c5f5adcac6
commit 5800340762
5 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🐌", "emoji": "🐌",
"previous": "&fro6dEqPfrkbxnrFGIO0KsRPFzi9jhWMXBgmYKTHNW0=.sha256" "previous": "&oPRvet0lD7W47N5YKm0IKpIX8q5zC12mIsHSVLCxex4=.sha256"
} }

View File

@ -158,7 +158,7 @@ class TfElement extends LitElement {
async fetch_new_message(id) { async fetch_new_message(id) {
let messages = await tfrpc.rpc.query( 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 FROM messages
JOIN json_each(?) AS following ON messages.author = following.value JOIN json_each(?) AS following ON messages.author = following.value
WHERE messages.id = ? WHERE messages.id = ?

View File

@ -262,7 +262,7 @@ class TfComposeElement extends LitElement {
try { try {
let rows = await tfrpc.rpc.query( 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 JOIN messages ON messages.rowid = messages_fts.rowid
WHERE messages.content LIKE ? WHERE messages.content LIKE ?
ORDER BY timestamp DESC LIMIT 10 ORDER BY timestamp DESC LIMIT 10

View File

@ -29,7 +29,7 @@ class TfTabMentionsElement extends LitElement {
console.log('Loading...', this.whoami); console.log('Loading...', this.whoami);
let results = await tfrpc.rpc.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(?) FROM messages_fts(?)
JOIN messages ON messages.rowid = messages_fts.rowid JOIN messages ON messages.rowid = messages_fts.rowid
JOIN json_each(?) AS following ON messages.author = following.value JOIN json_each(?) AS following ON messages.author = following.value

View File

@ -35,7 +35,7 @@ class TfTabSearchElement extends LitElement {
await tfrpc.rpc.setHash('#q=' + encodeURIComponent(query)); await tfrpc.rpc.setHash('#q=' + encodeURIComponent(query));
let results = await tfrpc.rpc.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(?) FROM messages_fts(?)
JOIN messages ON messages.rowid = messages_fts.rowid JOIN messages ON messages.rowid = messages_fts.rowid
JOIN json_each(?) AS following ON messages.author = following.value JOIN json_each(?) AS following ON messages.author = following.value