powersync-ja / powersync-js

SDK that enables local-first and real-time reactive apps with embedded SQLite for JavaScript clients, including React Native and Web
https://www.powersync.com
Apache License 2.0
300 stars 21 forks source link

Support for Kysely plugins #292

Closed bviebahn closed 1 month ago

bviebahn commented 1 month ago

Using Kysely plugins doesn't seem to be properly supported by the react package. I am using the ParseJSONResultsPlugin, and it works when I call execute on the query, but not when I pass the query to the useQuery hook.

I guess this is a bug rather than a feature request, because:

stevensJourney commented 1 month ago

This is probably due to us calling .compile on the supplied Kysely query to get the SQL and query parameters. We don't explicitly call .execute on the Kysely query. I'm assuming the .execute call should allow the plugins to map column data. We can investigating supporting .execute

guillempuche commented 1 month ago

This means I can't use https://kysely-org.github.io/kysely-apidoc/classes/CamelCasePlugin.html for now, right?

stevensJourney commented 1 month ago

This means I can't use https://kysely-org.github.io/kysely-apidoc/classes/CamelCasePlugin.html for now, right?

Most likely. This will be fixed soon.

guillempuche commented 1 month ago

I love the team's speed for improvements!

guillempuche commented 1 month ago

Reminder: this will help with converting Temporal datetimes via a plugin. More here https://discord.com/channels/1138230179878154300/1282584951656550473/1282671991005909072

stevensJourney commented 1 month ago

Closing this issue as plugins should be supported from @powersync/kysely-driver@0.4.0