Improve JS docs with one example with Kysely syntax
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...)
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
I haven't run it, but it compiles: https://github.com/guillempuche/localfirst_react_server/blob/a1295f7e773cdc99c091881292c67fa7980d15a3/apps/web/src/pages/page_home.tsx#L8-L12
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