@electric-sql/pglite-vue 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var S=(t,n)=>{for(var i in n)f(t,i,{get:n[i],enumerable:!0})},W=(t,n,i,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of g(n))!w.call(t,r)&&r!==i&&f(t,r,{get:()=>n[r],enumerable:!(s=Q(n,r))||s.enumerable});return t};var L=t=>W(f({},"__esModule",{value:!0}),t);var x={};S(x,{makePGliteDependencyInjector:()=>a,useLiveIncrementalQuery:()=>k,useLiveQuery:()=>j});module.exports=L(x);var u=require("vue-demi"),R=Symbol("PGliteProvider");function a(){return{providePGlite:i=>(0,u.provide)(R,i),injectPGlite:()=>{let i=(0,u.inject)(R);return(0,u.unref)(i)}}}var{injectPGlite:b,providePGlite:U}=a();var e=require("vue-demi");function G(t,n,i){let s=b(),r=(0,e.shallowReactive)({rows:void 0,fields:void 0,blob:void 0}),y=(0,e.shallowRef)(),c=typeof t=="string"?(0,e.ref)(t):t,d=!(0,e.isRef)(n)&&typeof n!="function"?(0,e.ref)(n):n,l=typeof i=="string"?(0,e.ref)(i):i;return(0,e.watch)(i!==void 0?[c,d,l]:[c,d],()=>{let p=!1,m=o=>{p||(r.rows=o.rows,r.fields=o.fields,o.blob!==void 0&&(r.blob=o.blob))},v=(0,e.isRef)(c)?c.value:c(),T=(0,e.isRef)(d)?d.value:d(),P=(0,e.isRef)(l)?l.value:l?.(),h=P!==void 0?s.live.incrementalQuery(v,T,P,m):s.live.query(v,T,m);y.value=()=>(p=!0,h.then(({unsubscribe:o})=>o()))},{immediate:!0}),(0,e.onScopeDispose)(()=>y.value?.()),(0,e.toRefs)((0,e.readonly)(r))}function j(t,n){return G(t,n)}function k(t,n,i){return G(t,n,i)}0&&(module.exports={makePGliteDependencyInjector,useLiveIncrementalQuery,useLiveQuery});
1
+ "use strict";var l=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var k=(t,e)=>{for(var i in e)l(t,i,{get:e[i],enumerable:!0})},L=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of g(e))!W.call(t,r)&&r!==i&&l(t,r,{get:()=>e[r],enumerable:!(o=S(e,r))||o.enumerable});return t};var j=t=>L(l({},"__esModule",{value:!0}),t);var D={};k(D,{makePGliteDependencyInjector:()=>f,useLiveIncrementalQuery:()=>x,useLiveQuery:()=>Q});module.exports=j(D);var s=require("vue-demi"),b=Symbol("PGliteProvider");function f(){return{providePGlite:i=>(0,s.provide)(b,i),injectPGlite:()=>{let i=(0,s.inject)(b);return(0,s.unref)(i)}}}var{injectPGlite:h,providePGlite:q}=f();var n=require("vue-demi"),G=require("@electric-sql/pglite/template");function y(t,e,i){let o=h(),r=(0,n.shallowReactive)({rows:void 0,fields:void 0,blob:void 0}),a=(0,n.shallowRef)(),c=typeof t=="string"?(0,n.ref)(t):t,T=e?Array.isArray(e)?e.map(n.ref):[e]:[(0,n.ref)(e)],d=typeof i=="string"?(0,n.ref)(i):i;return(0,n.watch)(i!==void 0?[c,d,...T]:[c,...T],()=>{let p=!1,v=u=>{p||(r.rows=u.rows,r.fields=u.fields,u.blob!==void 0&&(r.blob=u.blob))},P=(0,n.isRef)(c)?(0,n.unref)(c):c(),m=(0,n.isRef)(e)?(0,n.unref)(e):typeof e=="function"?e():Array.isArray(e)?e.map(n.unref):[e],R=(0,n.isRef)(d)?d.value:d?.(),w=R!==void 0?o.live.incrementalQuery(P,m,R,v):o.live.query(P,m,v);a.value=()=>(p=!0,w.then(({unsubscribe:u})=>u()))},{immediate:!0}),(0,n.onScopeDispose)(()=>a.value?.()),(0,n.toRefs)((0,n.readonly)(r))}function Q(t,e){return y(t,e)}Q.sql=function(t,...e){let{query:i,params:o}=(0,G.query)(t,...e);return y(i,o)};function x(t,e,i){return y(t,e,i)}0&&(module.exports={makePGliteDependencyInjector,useLiveIncrementalQuery,useLiveQuery});
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/dependency-injection.ts","../src/hooks.ts"],"sourcesContent":["export { makePGliteDependencyInjector } from './dependency-injection'\nexport * from './hooks'\n","import { provide, inject, unref, Ref } from 'vue-demi'\nimport { PGliteWithLive } from '@electric-sql/pglite/live'\n\ninterface PGliteDependencyInjection<T extends PGliteWithLive> {\n providePGlite: (db: Ref<T | undefined> | (T | undefined)) => void\n injectPGlite: () => T | undefined\n}\n\nconst PGliteKey = Symbol('PGliteProvider')\n\n/**\n * Call this function to get a PGlite provider and injector for your Vue application.\n * We can't provide a predefined provider and injector because that would lose type information\n * as the PGlite interface depends on the extensions provided to PGlite.\n *\n * @example\n * This example loses type information about the PGlite extensions:\n * ```\n * provide<typeof db>(PGliteKey, db)\n *\n * // generic PGlite instance type, no extension types\n * const { db } = inject(PGliteKey)\n * ```\n *\n * @returns An object with two functions: `providePGlite` and `injectPGlite`.\n *\n */\nfunction makePGliteDependencyInjector<\n T extends PGliteWithLive,\n>(): PGliteDependencyInjection<T> {\n const providePGlite = (db: Ref<T | undefined> | (T | undefined)): void =>\n provide(PGliteKey, db)\n\n const injectPGlite = (): T | undefined => {\n const db = inject<Ref<T> | T>(PGliteKey)\n return unref(db)\n }\n\n return {\n providePGlite,\n injectPGlite,\n }\n}\n\nconst { injectPGlite, providePGlite } =\n makePGliteDependencyInjector<PGliteWithLive>()\n\nexport { makePGliteDependencyInjector, injectPGlite, providePGlite }\n","import {\n watch,\n WatchSource,\n readonly,\n DeepReadonly,\n shallowReactive,\n toRefs,\n ToRefs,\n shallowRef,\n onScopeDispose,\n ref,\n isRef,\n} from 'vue-demi'\nimport { Results } from '@electric-sql/pglite'\nimport { injectPGlite } from './dependency-injection'\n\ntype UnsubscribeFn = () => Promise<void>\ntype QueryParams = unknown[] | undefined | null\ntype QueryResult<T> =\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\ntype LiveQueryResults<T> = ToRefs<DeepReadonly<QueryResult<T>>>\n\nfunction useLiveQueryImpl<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams>,\n key?: string | WatchSource<string>,\n): LiveQueryResults<T> {\n const db = injectPGlite()!\n\n const liveUpdate = shallowReactive<\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\n >({\n rows: undefined,\n fields: undefined,\n blob: undefined,\n })\n\n // keep track of live query subscriptions to unsubscribe when scope is disposed\n const unsubscribeRef = shallowRef<UnsubscribeFn>()\n\n const querySource = typeof query === 'string' ? ref(query) : query\n const paramsSource =\n !isRef(params) && typeof params !== 'function' ? ref(params) : params\n const keySource = typeof key === 'string' ? ref(key) : key\n\n watch(\n key !== undefined\n ? [querySource, paramsSource, keySource]\n : [querySource, paramsSource],\n () => {\n let cancelled = false\n const cb = (results: Results<T>) => {\n if (cancelled) return\n liveUpdate.rows = results.rows\n liveUpdate.fields = results.fields\n if (results.blob !== undefined) {\n liveUpdate.blob = results.blob\n }\n }\n\n const query = isRef(querySource) ? querySource.value : querySource()\n const params = isRef(paramsSource) ? paramsSource.value : paramsSource()\n const key = isRef(keySource) ? keySource.value : keySource?.()\n\n const ret =\n key !== undefined\n ? db.live.incrementalQuery<T>(query, params, key, cb)\n : db.live.query<T>(query, params, cb)\n\n unsubscribeRef.value = () => {\n cancelled = true\n return ret.then(({ unsubscribe }) => unsubscribe())\n }\n },\n { immediate: true },\n )\n\n onScopeDispose(() => unsubscribeRef.value?.())\n\n // @ts-ignore vue v2 has issues with DeepReadonly mapping\n return toRefs(readonly(liveUpdate))\n}\n\nexport function useLiveQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams>,\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params)\n}\n\nexport function useLiveIncrementalQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params: QueryParams | WatchSource<QueryParams>,\n key: string | WatchSource<string>,\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params, key)\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,EAAA,4BAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAL,GCAA,IAAAM,EAA4C,oBAQtCC,EAAY,OAAO,gBAAgB,EAmBzC,SAASC,GAEyB,CAShC,MAAO,CACL,cATqBC,MACrB,WAAQF,EAAWE,CAAE,EASrB,aAPmB,IAAqB,CACxC,IAAMA,KAAK,UAAmBF,CAAS,EACvC,SAAO,SAAME,CAAE,CACjB,CAKA,CACF,CAEA,GAAM,CAAE,aAAAC,EAAc,cAAAC,CAAc,EAClCH,EAA6C,EC7C/C,IAAAI,EAYO,oBAWP,SAASC,EACPC,EACAC,EACAC,EACqB,CACrB,IAAMC,EAAKC,EAAa,EAElBC,KAAa,mBAGjB,CACA,KAAM,OACN,OAAQ,OACR,KAAM,MACR,CAAC,EAGKC,KAAiB,cAA0B,EAE3CC,EAAc,OAAOP,GAAU,YAAW,OAAIA,CAAK,EAAIA,EACvDQ,EACJ,IAAC,SAAMP,CAAM,GAAK,OAAOA,GAAW,cAAa,OAAIA,CAAM,EAAIA,EAC3DQ,EAAY,OAAOP,GAAQ,YAAW,OAAIA,CAAG,EAAIA,EAEvD,kBACEA,IAAQ,OACJ,CAACK,EAAaC,EAAcC,CAAS,EACrC,CAACF,EAAaC,CAAY,EAC9B,IAAM,CACJ,IAAIE,EAAY,GACVC,EAAMC,GAAwB,CAC9BF,IACJL,EAAW,KAAOO,EAAQ,KAC1BP,EAAW,OAASO,EAAQ,OACxBA,EAAQ,OAAS,SACnBP,EAAW,KAAOO,EAAQ,MAE9B,EAEMZ,KAAQ,SAAMO,CAAW,EAAIA,EAAY,MAAQA,EAAY,EAC7DN,KAAS,SAAMO,CAAY,EAAIA,EAAa,MAAQA,EAAa,EACjEN,KAAM,SAAMO,CAAS,EAAIA,EAAU,MAAQA,IAAY,EAEvDI,EACJX,IAAQ,OACJC,EAAG,KAAK,iBAAoBH,EAAOC,EAAQC,EAAKS,CAAE,EAClDR,EAAG,KAAK,MAASH,EAAOC,EAAQU,CAAE,EAExCL,EAAe,MAAQ,KACrBI,EAAY,GACLG,EAAI,KAAK,CAAC,CAAE,YAAAC,CAAY,IAAMA,EAAY,CAAC,EAEtD,EACA,CAAE,UAAW,EAAK,CACpB,KAEA,kBAAe,IAAMR,EAAe,QAAQ,CAAC,KAGtC,aAAO,YAASD,CAAU,CAAC,CACpC,CAEO,SAASU,EACdf,EACAC,EACqB,CACrB,OAAOF,EAAoBC,EAAOC,CAAM,CAC1C,CAEO,SAASe,EACdhB,EACAC,EACAC,EACqB,CACrB,OAAOH,EAAoBC,EAAOC,EAAQC,CAAG,CAC/C","names":["src_exports","__export","makePGliteDependencyInjector","useLiveIncrementalQuery","useLiveQuery","__toCommonJS","import_vue_demi","PGliteKey","makePGliteDependencyInjector","db","injectPGlite","providePGlite","import_vue_demi","useLiveQueryImpl","query","params","key","db","injectPGlite","liveUpdate","unsubscribeRef","querySource","paramsSource","keySource","cancelled","cb","results","ret","unsubscribe","useLiveQuery","useLiveIncrementalQuery"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/dependency-injection.ts","../src/hooks.ts"],"sourcesContent":["export { makePGliteDependencyInjector } from './dependency-injection'\nexport * from './hooks'\n","import { provide, inject, unref, Ref } from 'vue-demi'\nimport { PGliteWithLive } from '@electric-sql/pglite/live'\n\ninterface PGliteDependencyInjection<T extends PGliteWithLive> {\n providePGlite: (db: Ref<T | undefined> | (T | undefined)) => void\n injectPGlite: () => T | undefined\n}\n\nconst PGliteKey = Symbol('PGliteProvider')\n\n/**\n * Call this function to get a PGlite provider and injector for your Vue application.\n * We can't provide a predefined provider and injector because that would lose type information\n * as the PGlite interface depends on the extensions provided to PGlite.\n *\n * @example\n * This example loses type information about the PGlite extensions:\n * ```\n * provide<typeof db>(PGliteKey, db)\n *\n * // generic PGlite instance type, no extension types\n * const { db } = inject(PGliteKey)\n * ```\n *\n * @returns An object with two functions: `providePGlite` and `injectPGlite`.\n *\n */\nfunction makePGliteDependencyInjector<\n T extends PGliteWithLive,\n>(): PGliteDependencyInjection<T> {\n const providePGlite = (db: Ref<T | undefined> | (T | undefined)): void =>\n provide(PGliteKey, db)\n\n const injectPGlite = (): T | undefined => {\n const db = inject<Ref<T> | T>(PGliteKey)\n return unref(db)\n }\n\n return {\n providePGlite,\n injectPGlite,\n }\n}\n\nconst { injectPGlite, providePGlite } =\n makePGliteDependencyInjector<PGliteWithLive>()\n\nexport { makePGliteDependencyInjector, injectPGlite, providePGlite }\n","import {\n watch,\n WatchSource,\n readonly,\n DeepReadonly,\n shallowReactive,\n toRefs,\n ToRefs,\n shallowRef,\n onScopeDispose,\n ref,\n isRef,\n unref,\n} from 'vue-demi'\nimport { Results } from '@electric-sql/pglite'\nimport { query as buildQuery } from '@electric-sql/pglite/template'\nimport { injectPGlite } from './dependency-injection'\n\ntype UnsubscribeFn = () => Promise<void>\ntype QueryParams = unknown[] | undefined | null\ntype QueryResult<T> =\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\ntype LiveQueryResults<T> = ToRefs<DeepReadonly<QueryResult<T>>>\n\nfunction useLiveQueryImpl<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[],\n key?: string | WatchSource<string>,\n): LiveQueryResults<T> {\n const db = injectPGlite()!\n\n const liveUpdate = shallowReactive<\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\n >({\n rows: undefined,\n fields: undefined,\n blob: undefined,\n })\n\n // keep track of live query subscriptions to unsubscribe when scope is disposed\n const unsubscribeRef = shallowRef<UnsubscribeFn>()\n\n const querySource = typeof query === 'string' ? ref(query) : query\n const paramsSources = !params\n ? [ref(params)]\n : Array.isArray(params)\n ? params.map(ref)\n : [params]\n\n const keySource = typeof key === 'string' ? ref(key) : key\n\n watch(\n key !== undefined\n ? [querySource, keySource, ...paramsSources]\n : [querySource, ...paramsSources],\n () => {\n let cancelled = false\n const cb = (results: Results<T>) => {\n if (cancelled) return\n liveUpdate.rows = results.rows\n liveUpdate.fields = results.fields\n if (results.blob !== undefined) {\n liveUpdate.blob = results.blob\n }\n }\n\n const query = isRef(querySource) ? unref(querySource) : querySource()\n\n const paramVals = isRef(params)\n ? unref(params)\n : typeof params === 'function'\n ? params()\n : Array.isArray(params)\n ? params.map(unref)\n : [params]\n\n const key = isRef(keySource) ? keySource.value : keySource?.()\n\n const ret =\n key !== undefined\n ? db.live.incrementalQuery<T>(query, paramVals, key, cb)\n : db.live.query<T>(query, paramVals, cb)\n\n unsubscribeRef.value = () => {\n cancelled = true\n return ret.then(({ unsubscribe }) => unsubscribe())\n }\n },\n { immediate: true },\n )\n\n onScopeDispose(() => unsubscribeRef.value?.())\n\n // @ts-ignore vue v2 has issues with DeepReadonly mapping\n return toRefs(readonly(liveUpdate))\n}\n\nexport function useLiveQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[],\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params)\n}\n\nuseLiveQuery.sql = function <T = { [key: string]: unknown }>(\n strings: TemplateStringsArray,\n ...values: any[]\n): LiveQueryResults<T> {\n const { query, params } = buildQuery(strings, ...values)\n return useLiveQueryImpl<T>(query, params)\n}\n\nexport function useLiveIncrementalQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[],\n key: string | WatchSource<string>,\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params, key)\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,EAAA,4BAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAL,GCAA,IAAAM,EAA4C,oBAQtCC,EAAY,OAAO,gBAAgB,EAmBzC,SAASC,GAEyB,CAShC,MAAO,CACL,cATqBC,MACrB,WAAQF,EAAWE,CAAE,EASrB,aAPmB,IAAqB,CACxC,IAAMA,KAAK,UAAmBF,CAAS,EACvC,SAAO,SAAME,CAAE,CACjB,CAKA,CACF,CAEA,GAAM,CAAE,aAAAC,EAAc,cAAAC,CAAc,EAClCH,EAA6C,EC7C/C,IAAAI,EAaO,oBAEPC,EAAoC,yCAUpC,SAASC,EACPC,EACAC,EACAC,EACqB,CACrB,IAAMC,EAAKC,EAAa,EAElBC,KAAa,mBAGjB,CACA,KAAM,OACN,OAAQ,OACR,KAAM,MACR,CAAC,EAGKC,KAAiB,cAA0B,EAE3CC,EAAc,OAAOP,GAAU,YAAW,OAAIA,CAAK,EAAIA,EACvDQ,EAAiBP,EAEnB,MAAM,QAAQA,CAAM,EAClBA,EAAO,IAAI,KAAG,EACd,CAACA,CAAM,EAHT,IAAC,OAAIA,CAAM,CAAC,EAKVQ,EAAY,OAAOP,GAAQ,YAAW,OAAIA,CAAG,EAAIA,EAEvD,kBACEA,IAAQ,OACJ,CAACK,EAAaE,EAAW,GAAGD,CAAa,EACzC,CAACD,EAAa,GAAGC,CAAa,EAClC,IAAM,CACJ,IAAIE,EAAY,GACVC,EAAMC,GAAwB,CAC9BF,IACJL,EAAW,KAAOO,EAAQ,KAC1BP,EAAW,OAASO,EAAQ,OACxBA,EAAQ,OAAS,SACnBP,EAAW,KAAOO,EAAQ,MAE9B,EAEMZ,KAAQ,SAAMO,CAAW,KAAI,SAAMA,CAAW,EAAIA,EAAY,EAE9DM,KAAY,SAAMZ,CAAM,KAC1B,SAAMA,CAAM,EACZ,OAAOA,GAAW,WAChBA,EAAO,EACP,MAAM,QAAQA,CAAM,EAClBA,EAAO,IAAI,OAAK,EAChB,CAACA,CAAM,EAETC,KAAM,SAAMO,CAAS,EAAIA,EAAU,MAAQA,IAAY,EAEvDK,EACJZ,IAAQ,OACJC,EAAG,KAAK,iBAAoBH,EAAOa,EAAWX,EAAKS,CAAE,EACrDR,EAAG,KAAK,MAASH,EAAOa,EAAWF,CAAE,EAE3CL,EAAe,MAAQ,KACrBI,EAAY,GACLI,EAAI,KAAK,CAAC,CAAE,YAAAC,CAAY,IAAMA,EAAY,CAAC,EAEtD,EACA,CAAE,UAAW,EAAK,CACpB,KAEA,kBAAe,IAAMT,EAAe,QAAQ,CAAC,KAGtC,aAAO,YAASD,CAAU,CAAC,CACpC,CAEO,SAASW,EACdhB,EACAC,EACqB,CACrB,OAAOF,EAAoBC,EAAOC,CAAM,CAC1C,CAEAe,EAAa,IAAM,SACjBC,KACGC,EACkB,CACrB,GAAM,CAAE,MAAAlB,EAAO,OAAAC,CAAO,KAAI,EAAAkB,OAAWF,EAAS,GAAGC,CAAM,EACvD,OAAOnB,EAAoBC,EAAOC,CAAM,CAC1C,EAEO,SAASmB,EACdpB,EACAC,EACAC,EACqB,CACrB,OAAOH,EAAoBC,EAAOC,EAAQC,CAAG,CAC/C","names":["src_exports","__export","makePGliteDependencyInjector","useLiveIncrementalQuery","useLiveQuery","__toCommonJS","import_vue_demi","PGliteKey","makePGliteDependencyInjector","db","injectPGlite","providePGlite","import_vue_demi","import_template","useLiveQueryImpl","query","params","key","db","injectPGlite","liveUpdate","unsubscribeRef","querySource","paramsSources","keySource","cancelled","cb","results","paramVals","ret","unsubscribe","useLiveQuery","strings","values","buildQuery","useLiveIncrementalQuery"]}
package/dist/index.d.cts CHANGED
@@ -34,9 +34,14 @@ type QueryResult<T> = Omit<Results<T>, 'affectedRows'> | {
34
34
  type LiveQueryResults<T> = ToRefs<DeepReadonly<QueryResult<T>>>;
35
35
  declare function useLiveQuery<T = {
36
36
  [key: string]: unknown;
37
- }>(query: string | WatchSource<string>, params?: QueryParams | WatchSource<QueryParams>): LiveQueryResults<T>;
37
+ }>(query: string | WatchSource<string>, params?: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[]): LiveQueryResults<T>;
38
+ declare namespace useLiveQuery {
39
+ var sql: <T = {
40
+ [key: string]: unknown;
41
+ }>(strings: TemplateStringsArray, ...values: any[]) => LiveQueryResults<T>;
42
+ }
38
43
  declare function useLiveIncrementalQuery<T = {
39
44
  [key: string]: unknown;
40
- }>(query: string | WatchSource<string>, params: QueryParams | WatchSource<QueryParams>, key: string | WatchSource<string>): LiveQueryResults<T>;
45
+ }>(query: string | WatchSource<string>, params: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[], key: string | WatchSource<string>): LiveQueryResults<T>;
41
46
 
42
47
  export { makePGliteDependencyInjector, useLiveIncrementalQuery, useLiveQuery };
package/dist/index.d.ts CHANGED
@@ -34,9 +34,14 @@ type QueryResult<T> = Omit<Results<T>, 'affectedRows'> | {
34
34
  type LiveQueryResults<T> = ToRefs<DeepReadonly<QueryResult<T>>>;
35
35
  declare function useLiveQuery<T = {
36
36
  [key: string]: unknown;
37
- }>(query: string | WatchSource<string>, params?: QueryParams | WatchSource<QueryParams>): LiveQueryResults<T>;
37
+ }>(query: string | WatchSource<string>, params?: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[]): LiveQueryResults<T>;
38
+ declare namespace useLiveQuery {
39
+ var sql: <T = {
40
+ [key: string]: unknown;
41
+ }>(strings: TemplateStringsArray, ...values: any[]) => LiveQueryResults<T>;
42
+ }
38
43
  declare function useLiveIncrementalQuery<T = {
39
44
  [key: string]: unknown;
40
- }>(query: string | WatchSource<string>, params: QueryParams | WatchSource<QueryParams>, key: string | WatchSource<string>): LiveQueryResults<T>;
45
+ }>(query: string | WatchSource<string>, params: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[], key: string | WatchSource<string>): LiveQueryResults<T>;
41
46
 
42
47
  export { makePGliteDependencyInjector, useLiveIncrementalQuery, useLiveQuery };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{provide as h,inject as Q,unref as g}from"vue-demi";var T=Symbol("PGliteProvider");function P(){return{providePGlite:e=>h(T,e),injectPGlite:()=>{let e=Q(T);return g(e)}}}var{injectPGlite:R,providePGlite:I}=P();import{watch as w,readonly as S,shallowReactive as W,toRefs as L,shallowRef as j,onScopeDispose as k,ref as d,isRef as c}from"vue-demi";function b(t,n,e){let l=R(),u=W({rows:void 0,fields:void 0,blob:void 0}),f=j(),r=typeof t=="string"?d(t):t,o=!c(n)&&typeof n!="function"?d(n):n,s=typeof e=="string"?d(e):e;return w(e!==void 0?[r,o,s]:[r,o],()=>{let a=!1,y=i=>{a||(u.rows=i.rows,u.fields=i.fields,i.blob!==void 0&&(u.blob=i.blob))},p=c(r)?r.value:r(),m=c(o)?o.value:o(),v=c(s)?s.value:s?.(),G=v!==void 0?l.live.incrementalQuery(p,m,v,y):l.live.query(p,m,y);f.value=()=>(a=!0,G.then(({unsubscribe:i})=>i()))},{immediate:!0}),k(()=>f.value?.()),L(S(u))}function A(t,n){return b(t,n)}function B(t,n,e){return b(t,n,e)}export{P as makePGliteDependencyInjector,B as useLiveIncrementalQuery,A as useLiveQuery};
1
+ import{provide as Q,inject as w,unref as S}from"vue-demi";var R=Symbol("PGliteProvider");function b(){return{providePGlite:n=>Q(R,n),injectPGlite:()=>{let n=w(R);return S(n)}}}var{injectPGlite:h,providePGlite:U}=b();import{watch as g,readonly as W,shallowReactive as k,toRefs as L,shallowRef as j,onScopeDispose as x,ref as c,isRef as d,unref as l}from"vue-demi";import{query as D}from"@electric-sql/pglite/template";function f(t,e,n){let o=h(),u=k({rows:void 0,fields:void 0,blob:void 0}),y=j(),r=typeof t=="string"?c(t):t,a=e?Array.isArray(e)?e.map(c):[e]:[c(e)],s=typeof n=="string"?c(n):n;return g(n!==void 0?[r,s,...a]:[r,...a],()=>{let T=!1,p=i=>{T||(u.rows=i.rows,u.fields=i.fields,i.blob!==void 0&&(u.blob=i.blob))},v=d(r)?l(r):r(),P=d(e)?l(e):typeof e=="function"?e():Array.isArray(e)?e.map(l):[e],m=d(s)?s.value:s?.(),G=m!==void 0?o.live.incrementalQuery(v,P,m,p):o.live.query(v,P,p);y.value=()=>(T=!0,G.then(({unsubscribe:i})=>i()))},{immediate:!0}),x(()=>y.value?.()),L(W(u))}function I(t,e){return f(t,e)}I.sql=function(t,...e){let{query:n,params:o}=D(t,...e);return f(n,o)};function E(t,e,n){return f(t,e,n)}export{b as makePGliteDependencyInjector,E as useLiveIncrementalQuery,I as useLiveQuery};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dependency-injection.ts","../src/hooks.ts"],"sourcesContent":["import { provide, inject, unref, Ref } from 'vue-demi'\nimport { PGliteWithLive } from '@electric-sql/pglite/live'\n\ninterface PGliteDependencyInjection<T extends PGliteWithLive> {\n providePGlite: (db: Ref<T | undefined> | (T | undefined)) => void\n injectPGlite: () => T | undefined\n}\n\nconst PGliteKey = Symbol('PGliteProvider')\n\n/**\n * Call this function to get a PGlite provider and injector for your Vue application.\n * We can't provide a predefined provider and injector because that would lose type information\n * as the PGlite interface depends on the extensions provided to PGlite.\n *\n * @example\n * This example loses type information about the PGlite extensions:\n * ```\n * provide<typeof db>(PGliteKey, db)\n *\n * // generic PGlite instance type, no extension types\n * const { db } = inject(PGliteKey)\n * ```\n *\n * @returns An object with two functions: `providePGlite` and `injectPGlite`.\n *\n */\nfunction makePGliteDependencyInjector<\n T extends PGliteWithLive,\n>(): PGliteDependencyInjection<T> {\n const providePGlite = (db: Ref<T | undefined> | (T | undefined)): void =>\n provide(PGliteKey, db)\n\n const injectPGlite = (): T | undefined => {\n const db = inject<Ref<T> | T>(PGliteKey)\n return unref(db)\n }\n\n return {\n providePGlite,\n injectPGlite,\n }\n}\n\nconst { injectPGlite, providePGlite } =\n makePGliteDependencyInjector<PGliteWithLive>()\n\nexport { makePGliteDependencyInjector, injectPGlite, providePGlite }\n","import {\n watch,\n WatchSource,\n readonly,\n DeepReadonly,\n shallowReactive,\n toRefs,\n ToRefs,\n shallowRef,\n onScopeDispose,\n ref,\n isRef,\n} from 'vue-demi'\nimport { Results } from '@electric-sql/pglite'\nimport { injectPGlite } from './dependency-injection'\n\ntype UnsubscribeFn = () => Promise<void>\ntype QueryParams = unknown[] | undefined | null\ntype QueryResult<T> =\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\ntype LiveQueryResults<T> = ToRefs<DeepReadonly<QueryResult<T>>>\n\nfunction useLiveQueryImpl<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams>,\n key?: string | WatchSource<string>,\n): LiveQueryResults<T> {\n const db = injectPGlite()!\n\n const liveUpdate = shallowReactive<\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\n >({\n rows: undefined,\n fields: undefined,\n blob: undefined,\n })\n\n // keep track of live query subscriptions to unsubscribe when scope is disposed\n const unsubscribeRef = shallowRef<UnsubscribeFn>()\n\n const querySource = typeof query === 'string' ? ref(query) : query\n const paramsSource =\n !isRef(params) && typeof params !== 'function' ? ref(params) : params\n const keySource = typeof key === 'string' ? ref(key) : key\n\n watch(\n key !== undefined\n ? [querySource, paramsSource, keySource]\n : [querySource, paramsSource],\n () => {\n let cancelled = false\n const cb = (results: Results<T>) => {\n if (cancelled) return\n liveUpdate.rows = results.rows\n liveUpdate.fields = results.fields\n if (results.blob !== undefined) {\n liveUpdate.blob = results.blob\n }\n }\n\n const query = isRef(querySource) ? querySource.value : querySource()\n const params = isRef(paramsSource) ? paramsSource.value : paramsSource()\n const key = isRef(keySource) ? keySource.value : keySource?.()\n\n const ret =\n key !== undefined\n ? db.live.incrementalQuery<T>(query, params, key, cb)\n : db.live.query<T>(query, params, cb)\n\n unsubscribeRef.value = () => {\n cancelled = true\n return ret.then(({ unsubscribe }) => unsubscribe())\n }\n },\n { immediate: true },\n )\n\n onScopeDispose(() => unsubscribeRef.value?.())\n\n // @ts-ignore vue v2 has issues with DeepReadonly mapping\n return toRefs(readonly(liveUpdate))\n}\n\nexport function useLiveQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams>,\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params)\n}\n\nexport function useLiveIncrementalQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params: QueryParams | WatchSource<QueryParams>,\n key: string | WatchSource<string>,\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params, key)\n}\n"],"mappings":"AAAA,OAAS,WAAAA,EAAS,UAAAC,EAAQ,SAAAC,MAAkB,WAQ5C,IAAMC,EAAY,OAAO,gBAAgB,EAmBzC,SAASC,GAEyB,CAShC,MAAO,CACL,cATqBC,GACrBL,EAAQG,EAAWE,CAAE,EASrB,aAPmB,IAAqB,CACxC,IAAMA,EAAKJ,EAAmBE,CAAS,EACvC,OAAOD,EAAMG,CAAE,CACjB,CAKA,CACF,CAEA,GAAM,CAAE,aAAAC,EAAc,cAAAC,CAAc,EAClCH,EAA6C,EC7C/C,OACE,SAAAI,EAEA,YAAAC,EAEA,mBAAAC,EACA,UAAAC,EAEA,cAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,SAAAC,MACK,WAWP,SAASC,EACPC,EACAC,EACAC,EACqB,CACrB,IAAMC,EAAKC,EAAa,EAElBC,EAAaC,EAGjB,CACA,KAAM,OACN,OAAQ,OACR,KAAM,MACR,CAAC,EAGKC,EAAiBC,EAA0B,EAE3CC,EAAc,OAAOT,GAAU,SAAWU,EAAIV,CAAK,EAAIA,EACvDW,EACJ,CAACC,EAAMX,CAAM,GAAK,OAAOA,GAAW,WAAaS,EAAIT,CAAM,EAAIA,EAC3DY,EAAY,OAAOX,GAAQ,SAAWQ,EAAIR,CAAG,EAAIA,EAEvD,OAAAY,EACEZ,IAAQ,OACJ,CAACO,EAAaE,EAAcE,CAAS,EACrC,CAACJ,EAAaE,CAAY,EAC9B,IAAM,CACJ,IAAII,EAAY,GACVC,EAAMC,GAAwB,CAC9BF,IACJV,EAAW,KAAOY,EAAQ,KAC1BZ,EAAW,OAASY,EAAQ,OACxBA,EAAQ,OAAS,SACnBZ,EAAW,KAAOY,EAAQ,MAE9B,EAEMjB,EAAQY,EAAMH,CAAW,EAAIA,EAAY,MAAQA,EAAY,EAC7DR,EAASW,EAAMD,CAAY,EAAIA,EAAa,MAAQA,EAAa,EACjET,EAAMU,EAAMC,CAAS,EAAIA,EAAU,MAAQA,IAAY,EAEvDK,EACJhB,IAAQ,OACJC,EAAG,KAAK,iBAAoBH,EAAOC,EAAQC,EAAKc,CAAE,EAClDb,EAAG,KAAK,MAASH,EAAOC,EAAQe,CAAE,EAExCT,EAAe,MAAQ,KACrBQ,EAAY,GACLG,EAAI,KAAK,CAAC,CAAE,YAAAC,CAAY,IAAMA,EAAY,CAAC,EAEtD,EACA,CAAE,UAAW,EAAK,CACpB,EAEAC,EAAe,IAAMb,EAAe,QAAQ,CAAC,EAGtCc,EAAOC,EAASjB,CAAU,CAAC,CACpC,CAEO,SAASkB,EACdvB,EACAC,EACqB,CACrB,OAAOF,EAAoBC,EAAOC,CAAM,CAC1C,CAEO,SAASuB,EACdxB,EACAC,EACAC,EACqB,CACrB,OAAOH,EAAoBC,EAAOC,EAAQC,CAAG,CAC/C","names":["provide","inject","unref","PGliteKey","makePGliteDependencyInjector","db","injectPGlite","providePGlite","watch","readonly","shallowReactive","toRefs","shallowRef","onScopeDispose","ref","isRef","useLiveQueryImpl","query","params","key","db","injectPGlite","liveUpdate","shallowReactive","unsubscribeRef","shallowRef","querySource","ref","paramsSource","isRef","keySource","watch","cancelled","cb","results","ret","unsubscribe","onScopeDispose","toRefs","readonly","useLiveQuery","useLiveIncrementalQuery"]}
1
+ {"version":3,"sources":["../src/dependency-injection.ts","../src/hooks.ts"],"sourcesContent":["import { provide, inject, unref, Ref } from 'vue-demi'\nimport { PGliteWithLive } from '@electric-sql/pglite/live'\n\ninterface PGliteDependencyInjection<T extends PGliteWithLive> {\n providePGlite: (db: Ref<T | undefined> | (T | undefined)) => void\n injectPGlite: () => T | undefined\n}\n\nconst PGliteKey = Symbol('PGliteProvider')\n\n/**\n * Call this function to get a PGlite provider and injector for your Vue application.\n * We can't provide a predefined provider and injector because that would lose type information\n * as the PGlite interface depends on the extensions provided to PGlite.\n *\n * @example\n * This example loses type information about the PGlite extensions:\n * ```\n * provide<typeof db>(PGliteKey, db)\n *\n * // generic PGlite instance type, no extension types\n * const { db } = inject(PGliteKey)\n * ```\n *\n * @returns An object with two functions: `providePGlite` and `injectPGlite`.\n *\n */\nfunction makePGliteDependencyInjector<\n T extends PGliteWithLive,\n>(): PGliteDependencyInjection<T> {\n const providePGlite = (db: Ref<T | undefined> | (T | undefined)): void =>\n provide(PGliteKey, db)\n\n const injectPGlite = (): T | undefined => {\n const db = inject<Ref<T> | T>(PGliteKey)\n return unref(db)\n }\n\n return {\n providePGlite,\n injectPGlite,\n }\n}\n\nconst { injectPGlite, providePGlite } =\n makePGliteDependencyInjector<PGliteWithLive>()\n\nexport { makePGliteDependencyInjector, injectPGlite, providePGlite }\n","import {\n watch,\n WatchSource,\n readonly,\n DeepReadonly,\n shallowReactive,\n toRefs,\n ToRefs,\n shallowRef,\n onScopeDispose,\n ref,\n isRef,\n unref,\n} from 'vue-demi'\nimport { Results } from '@electric-sql/pglite'\nimport { query as buildQuery } from '@electric-sql/pglite/template'\nimport { injectPGlite } from './dependency-injection'\n\ntype UnsubscribeFn = () => Promise<void>\ntype QueryParams = unknown[] | undefined | null\ntype QueryResult<T> =\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\ntype LiveQueryResults<T> = ToRefs<DeepReadonly<QueryResult<T>>>\n\nfunction useLiveQueryImpl<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[],\n key?: string | WatchSource<string>,\n): LiveQueryResults<T> {\n const db = injectPGlite()!\n\n const liveUpdate = shallowReactive<\n | Omit<Results<T>, 'affectedRows'>\n | { rows: undefined; fields: undefined; blob: undefined }\n >({\n rows: undefined,\n fields: undefined,\n blob: undefined,\n })\n\n // keep track of live query subscriptions to unsubscribe when scope is disposed\n const unsubscribeRef = shallowRef<UnsubscribeFn>()\n\n const querySource = typeof query === 'string' ? ref(query) : query\n const paramsSources = !params\n ? [ref(params)]\n : Array.isArray(params)\n ? params.map(ref)\n : [params]\n\n const keySource = typeof key === 'string' ? ref(key) : key\n\n watch(\n key !== undefined\n ? [querySource, keySource, ...paramsSources]\n : [querySource, ...paramsSources],\n () => {\n let cancelled = false\n const cb = (results: Results<T>) => {\n if (cancelled) return\n liveUpdate.rows = results.rows\n liveUpdate.fields = results.fields\n if (results.blob !== undefined) {\n liveUpdate.blob = results.blob\n }\n }\n\n const query = isRef(querySource) ? unref(querySource) : querySource()\n\n const paramVals = isRef(params)\n ? unref(params)\n : typeof params === 'function'\n ? params()\n : Array.isArray(params)\n ? params.map(unref)\n : [params]\n\n const key = isRef(keySource) ? keySource.value : keySource?.()\n\n const ret =\n key !== undefined\n ? db.live.incrementalQuery<T>(query, paramVals, key, cb)\n : db.live.query<T>(query, paramVals, cb)\n\n unsubscribeRef.value = () => {\n cancelled = true\n return ret.then(({ unsubscribe }) => unsubscribe())\n }\n },\n { immediate: true },\n )\n\n onScopeDispose(() => unsubscribeRef.value?.())\n\n // @ts-ignore vue v2 has issues with DeepReadonly mapping\n return toRefs(readonly(liveUpdate))\n}\n\nexport function useLiveQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params?: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[],\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params)\n}\n\nuseLiveQuery.sql = function <T = { [key: string]: unknown }>(\n strings: TemplateStringsArray,\n ...values: any[]\n): LiveQueryResults<T> {\n const { query, params } = buildQuery(strings, ...values)\n return useLiveQueryImpl<T>(query, params)\n}\n\nexport function useLiveIncrementalQuery<T = { [key: string]: unknown }>(\n query: string | WatchSource<string>,\n params: QueryParams | WatchSource<QueryParams> | WatchSource<unknown>[],\n key: string | WatchSource<string>,\n): LiveQueryResults<T> {\n return useLiveQueryImpl<T>(query, params, key)\n}\n"],"mappings":"AAAA,OAAS,WAAAA,EAAS,UAAAC,EAAQ,SAAAC,MAAkB,WAQ5C,IAAMC,EAAY,OAAO,gBAAgB,EAmBzC,SAASC,GAEyB,CAShC,MAAO,CACL,cATqBC,GACrBL,EAAQG,EAAWE,CAAE,EASrB,aAPmB,IAAqB,CACxC,IAAMA,EAAKJ,EAAmBE,CAAS,EACvC,OAAOD,EAAMG,CAAE,CACjB,CAKA,CACF,CAEA,GAAM,CAAE,aAAAC,EAAc,cAAAC,CAAc,EAClCH,EAA6C,EC7C/C,OACE,SAAAI,EAEA,YAAAC,EAEA,mBAAAC,EACA,UAAAC,EAEA,cAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,SAAAC,EACA,SAAAC,MACK,WAEP,OAAS,SAASC,MAAkB,gCAUpC,SAASC,EACPC,EACAC,EACAC,EACqB,CACrB,IAAMC,EAAKC,EAAa,EAElBC,EAAaC,EAGjB,CACA,KAAM,OACN,OAAQ,OACR,KAAM,MACR,CAAC,EAGKC,EAAiBC,EAA0B,EAE3CC,EAAc,OAAOT,GAAU,SAAWU,EAAIV,CAAK,EAAIA,EACvDW,EAAiBV,EAEnB,MAAM,QAAQA,CAAM,EAClBA,EAAO,IAAIS,CAAG,EACd,CAACT,CAAM,EAHT,CAACS,EAAIT,CAAM,CAAC,EAKVW,EAAY,OAAOV,GAAQ,SAAWQ,EAAIR,CAAG,EAAIA,EAEvD,OAAAW,EACEX,IAAQ,OACJ,CAACO,EAAaG,EAAW,GAAGD,CAAa,EACzC,CAACF,EAAa,GAAGE,CAAa,EAClC,IAAM,CACJ,IAAIG,EAAY,GACVC,EAAMC,GAAwB,CAC9BF,IACJT,EAAW,KAAOW,EAAQ,KAC1BX,EAAW,OAASW,EAAQ,OACxBA,EAAQ,OAAS,SACnBX,EAAW,KAAOW,EAAQ,MAE9B,EAEMhB,EAAQiB,EAAMR,CAAW,EAAIS,EAAMT,CAAW,EAAIA,EAAY,EAE9DU,EAAYF,EAAMhB,CAAM,EAC1BiB,EAAMjB,CAAM,EACZ,OAAOA,GAAW,WAChBA,EAAO,EACP,MAAM,QAAQA,CAAM,EAClBA,EAAO,IAAIiB,CAAK,EAChB,CAACjB,CAAM,EAETC,EAAMe,EAAML,CAAS,EAAIA,EAAU,MAAQA,IAAY,EAEvDQ,EACJlB,IAAQ,OACJC,EAAG,KAAK,iBAAoBH,EAAOmB,EAAWjB,EAAKa,CAAE,EACrDZ,EAAG,KAAK,MAASH,EAAOmB,EAAWJ,CAAE,EAE3CR,EAAe,MAAQ,KACrBO,EAAY,GACLM,EAAI,KAAK,CAAC,CAAE,YAAAC,CAAY,IAAMA,EAAY,CAAC,EAEtD,EACA,CAAE,UAAW,EAAK,CACpB,EAEAC,EAAe,IAAMf,EAAe,QAAQ,CAAC,EAGtCgB,EAAOC,EAASnB,CAAU,CAAC,CACpC,CAEO,SAASoB,EACdzB,EACAC,EACqB,CACrB,OAAOF,EAAoBC,EAAOC,CAAM,CAC1C,CAEAwB,EAAa,IAAM,SACjBC,KACGC,EACkB,CACrB,GAAM,CAAE,MAAA3B,EAAO,OAAAC,CAAO,EAAI2B,EAAWF,EAAS,GAAGC,CAAM,EACvD,OAAO5B,EAAoBC,EAAOC,CAAM,CAC1C,EAEO,SAAS4B,EACd7B,EACAC,EACAC,EACqB,CACrB,OAAOH,EAAoBC,EAAOC,EAAQC,CAAG,CAC/C","names":["provide","inject","unref","PGliteKey","makePGliteDependencyInjector","db","injectPGlite","providePGlite","watch","readonly","shallowReactive","toRefs","shallowRef","onScopeDispose","ref","isRef","unref","buildQuery","useLiveQueryImpl","query","params","key","db","injectPGlite","liveUpdate","shallowReactive","unsubscribeRef","shallowRef","querySource","ref","paramsSources","keySource","watch","cancelled","cb","results","isRef","unref","paramVals","ret","unsubscribe","onScopeDispose","toRefs","readonly","useLiveQuery","strings","values","buildQuery","useLiveIncrementalQuery"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electric-sql/pglite-vue",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Vue hooks for using PGlite",
5
5
  "type": "module",
6
6
  "private": false,
@@ -17,6 +17,7 @@
17
17
  "vue"
18
18
  ],
19
19
  "author": "Electric DB Limited",
20
+ "homepage": "https://pglite.dev",
20
21
  "license": "Apache-2.0",
21
22
  "repository": {
22
23
  "type": "git",
@@ -49,12 +50,12 @@
49
50
  "vue": "^3.4.27",
50
51
  "vue2": "npm:vue@2.6",
51
52
  "vue2.7": "npm:vue@2.7",
52
- "@electric-sql/pglite": "0.2.3"
53
+ "@electric-sql/pglite": "0.2.5"
53
54
  },
54
55
  "peerDependencies": {
55
56
  "@vue/composition-api": "^1.1.2",
56
57
  "vue": "^2.6.0 || ^3.3.0",
57
- "@electric-sql/pglite": "^0.2.3"
58
+ "@electric-sql/pglite": "^0.2.5"
58
59
  },
59
60
  "peerDependenciesMeta": {
60
61
  "@vue/composition-api": {