Replies: 4 comments
-
hi bro, to fix your trouble try this fix, i see it in another issue, |
Beta Was this translation helpful? Give feedback.
-
Hey @sandros94 Thanks for the report. My understanding is that if you use Have you seen our Vue hooks (https://pglite.dev/docs/framework-hooks/vue)? Are these useful for your project? Let me know if you have any feedback on them. |
Beta Was this translation helpful? Give feedback.
-
Yes indeed, and I'm currently going with the
But as per my understanding of Vue's reactivity system is that with a Take the following example from Vue's official docs:
This means that in order to make Vue aware of each exec/query executions (since const pg = shallowRef(new PGlite(options))
async function query<T>(query: string, params?: any[], options?: QueryOptions) {
const res = await pg.value.query<T>(query, params, options)
triggerRef(pg) // Manually triggering Vue's reactivity
return res
}
Yes, I love digging docs before starting anything 😅. It was super easy to setup and execute inside a final project, but then (as I often do) I wanted to wrap PGlite into a Nuxt module, taking advantage of project's So I wanted to try and create a composable-first, rather a component-first, approach. Something that, if successful, could be integrated in the official |
Beta Was this translation helpful? Give feedback.
-
We could actually move this into a discussion, now that I think of it. My bad 🙄 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Long story short: the current main classes for PGlite use a number of private methods, but since Vue's reactivity is based on proxying this effectively breaks its usability (official comment).
This becomes quite important when working with composables instead of components.
An example of an ideal DX composable would be:
Same applies for workers and in a Nuxt context.
Beta Was this translation helpful? Give feedback.
All reactions