Skip to content

feat(vue): update vue composables and compilable queries #153

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

Merged
merged 10 commits into from
May 6, 2024

Conversation

Chriztiaan
Copy link
Contributor

@Chriztiaan Chriztiaan commented May 3, 2024

Updated composable package to use same signatures as the new hooks from @powersync/react #142. Added the same compilable query support added to React hooks in #150.

Introduces useQuery and useStatus composables that replace the existing usePowerSyncWatchedQuery, usePowersyncQuery, and usePowerSyncStatus.

Verified that the Kysely driver works in the Vue package with useQuery, and that watches trigger when dependent tables change.

The following snippet was used to confirm:

import { usePowerSync, useQuery } from '@powersync/vue';
import { wrapPowerSyncWithKysely } from '@powersync/kysely-driver';
import { Database } from '@/library/powersync/AppSchema';

const powerSync = usePowerSync();
const db = wrapPowerSyncWithKysely<Database>(powerSync.value);

const {
  data: querySQLResult,
  isLoading,
  isFetching,
  error
} = useQuery(db.selectFrom('lists').selectAll().where('name', 'like', '%Shopping%'));

@Chriztiaan Chriztiaan changed the title chore: update vue composables and compilable queries feat(vue): update vue composables and compilable queries May 3, 2024
@Chriztiaan Chriztiaan marked this pull request as ready for review May 6, 2024 13:26
@Chriztiaan Chriztiaan merged commit a5550b2 into main May 6, 2024
@Chriztiaan Chriztiaan deleted the chore/update-vue-composables branch May 6, 2024 13:27
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

Successfully merging this pull request may close these issues.

3 participants