Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve JS docs with one example with Kysely syntax #275

Open
guillempuche opened this issue Aug 20, 2024 · 5 comments
Open

Improve JS docs with one example with Kysely syntax #275

guillempuche opened this issue Aug 20, 2024 · 5 comments

Comments

@guillempuche
Copy link
Contributor

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...)

@guillempuche guillempuche changed the title Update JS docs with one example with Kysely syntax Improve JS docs with one example with Kysely syntax Aug 20, 2024
@benitav
Copy link
Contributor

benitav commented Aug 22, 2024

That's a good suggestion, thanks! We can add the Kysely equivalent to the examples.

@guillempuche
Copy link
Contributor Author

@benitav
Copy link
Contributor

benitav commented Aug 27, 2024

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(),
    )

@guillempuche
Copy link
Contributor Author

Yes, i did

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants