Open guillempuche opened 3 weeks ago
That's a good suggestion, thanks! We can add the Kysely equivalent to the examples.
How would you transform this
https://github.com/guillempuche/localfirst_react_server/blob/d383ab33a01ffff866d5324dada0e6678c3bc0c6/apps/web/src/pages/page_home.effect.tsx#L9
to dbEffect.selectFrom...
,
Right now, I use dbEffect
for updating
https://github.com/guillempuche/localfirst_react_server/blob/d383ab33a01ffff866d5324dada0e6678c3bc0c6/apps/web/src/components/editor.effect.tsx#L43
Discord thread https://discord.com/channels/1138230179878154300/1266491006593798165/1276214618217386035
Just to close the loop here: Looks like you got this to work, if I follow the Discord thread?
const watchQuotes = useQuery<QuoteQuery>(
'SELECT * FROM quotes ORDER BY id DESC',
)
const watchQuotesEffect = useQuery(
dbEffect.selectFrom('quotes').orderBy('id', 'desc').selectAll(),
)
Yes, i did
https://docs.powersync.com/client-sdk-references/js-web#using-powersync-crud-functions
Apart from showing SQL syntax, show Kysely syntax, e.g.
useQuery(kysely.selectFrom...)