@ahmadmoussawi/webdb 0.1.4 β 0.2.0
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/README.md +50 -6
- package/dist/angular.cjs +2 -0
- package/dist/angular.cjs.map +1 -0
- package/dist/angular.d.ts +92 -0
- package/dist/angular.js +108 -0
- package/dist/angular.js.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/js/catalog.c.d.ts +88 -27
- package/dist/core/js/catalog.c.d.ts.map +1 -1
- package/dist/host/api/index.d.ts +1 -0
- package/dist/host/api/index.d.ts.map +1 -1
- package/dist/host/api/live_query.d.ts +71 -0
- package/dist/host/api/live_query.d.ts.map +1 -0
- package/dist/host/api/query_builder.d.ts +20 -0
- package/dist/host/api/query_builder.d.ts.map +1 -1
- package/dist/host/api/webdb.d.ts +8 -0
- package/dist/host/api/webdb.d.ts.map +1 -1
- package/dist/host/driver/buffer_pool_driver.d.ts.map +1 -1
- package/dist/react.cjs +2 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.ts +52 -0
- package/dist/react.js +66 -0
- package/dist/react.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/vue.cjs +2 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.ts +100 -0
- package/dist/vue.js +80 -0
- package/dist/vue.js.map +1 -0
- package/dist/webdb.js +5438 -4890
- package/dist/webdb.js.map +1 -1
- package/dist/webdb.umd.cjs +2 -2
- package/dist/webdb.umd.cjs.map +1 -1
- package/package.json +37 -2
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<h1 align="center">WebDB</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<strong>An ultra-lean (<
|
|
8
|
+
<strong>An ultra-lean (<100 KB bundle, ~13 KB Wasm core), powerful browser-native relational database engine built from scratch in C compiled to WASM.</strong>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://github.com/ahmad-moussawi/webdb/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT" /></a>
|
|
13
|
-
<img src="https://img.shields.io/badge/wasm%
|
|
13
|
+
<img src="https://img.shields.io/badge/wasm%20core-~13%20KB%20(%3C100%20KB%20bundle)-success.svg?logo=webassembly&logoColor=white" alt="Wasm Core: ~13KB (<100KB bundle)" />
|
|
14
14
|
<a href="https://ahmad-moussawi.github.io/webdb/playground/"><img src="https://img.shields.io/badge/Studio%20IDE-live%20playground-7c3aed?logo=visualstudiocode&logoColor=white" alt="Studio IDE" /></a>
|
|
15
15
|
<a href="https://ahmad-moussawi.github.io/webdb/benchmark/"><img src="https://img.shields.io/badge/benchmarks-live%20suite-059669?logo=speedtest&logoColor=white" alt="Live Benchmarks" /></a>
|
|
16
16
|
<a href="https://www.npmjs.com/package/@ahmadmoussawi/webdb"><img src="https://img.shields.io/npm/v/@ahmadmoussawi/webdb/alpha?label=npm%20alpha&color=orange&logo=npm" alt="npm alpha" /></a>
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
|
|
29
29
|
**WebDB** is an ultra-lightweight, relational database built from scratch specifically for the web. Think of it as **SQLite reimagined for modern browsers**βbringing true SQL capabilities, ACID transactions, and persistent storage to offline-first apps without multi-megabyte bundles or complex server headers.
|
|
30
30
|
|
|
31
|
-
- πͺΆ **Tiny Footprint (<
|
|
31
|
+
- πͺΆ **Tiny Footprint (<100 KB Gzipped, ~13 KB Wasm Core):** Up to 90%+ smaller than ported desktop SQLite or Postgres (PGlite) builds.
|
|
32
32
|
- β‘ **True Relational Power:** Fast filtering, indexing, aggregations, multi-column sorting, and joinsβreplacing cumbersome IndexedDB cursor queries.
|
|
33
|
+
- π‘ **Reactive Live Queries (React, Vue, Angular & Plain JS):** First-class UI bindings (`< 1 KB` subpath exports) with automatic table dependency tracking across `JOIN`s, subqueries, and open browser tabs.
|
|
33
34
|
- π **Async VFS by Heart:** Built from the ground up for asynchronous browser storageβclean non-blocking page faults with zero Emscripten `Asyncify` stack hacks or slow workarounds.
|
|
34
35
|
- π **Embraces the Web Platform:** Uses the browser instead of fighting itβdelegating to native `crypto.subtle`, `Intl`, `RegExp`, `Date`, and Web Locks rather than packing redundant C libraries into Wasm.
|
|
35
|
-
- πΎ **Reliable Offline Persistence:** First-class storage with high-speed **OPFS** (desktop & workers) and **IndexedDB** (Safari, mobile WebViews, private browsing).
|
|
36
|
+
- πΎ **Reliable Offline Persistence:** First-class storage with high-speed **OPFS** (desktop & workers) and **IndexedDB** (Safari, mobile WebViews, private browsing).
|
|
36
37
|
- π **Zero Configuration:** Works everywhere out of the box with zero `COOP`/`COEP` header headaches.
|
|
37
38
|
|
|
38
39
|
---
|
|
@@ -58,7 +59,7 @@ WebDB fills this gap by **reimagining a database engine from scratch for modern
|
|
|
58
59
|
βββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ
|
|
59
60
|
β Ported Desktop DBs (Wasm) β β WebDB β
|
|
60
61
|
βββββββββββββββββββββββββββββββββββ€ βββββββββββββββββββββββββββββββββββ€
|
|
61
|
-
β β’ 500 KB - 5 MB+ (SQLite/PGlite)β β β’
|
|
62
|
+
β β’ 500 KB - 5 MB+ (SQLite/PGlite)β β β’ ~13 KB Wasm Core (<100 KB) β
|
|
62
63
|
β β’ Bundles text SQL parser/lexer β βββΊ β β’ Fluent TS Builder β Bytecode β
|
|
63
64
|
β β’ Bundles POSIX pthread/mutexes β β β’ Single-threaded by design β
|
|
64
65
|
β β’ Bundles C date/regex/ICU shimsβ β β’ Embraces native Web APIs β
|
|
@@ -83,7 +84,7 @@ WebDB fills this gap by **reimagining a database engine from scratch for modern
|
|
|
83
84
|
WebDB is currently in an **early prototype ("walking skeleton") stage**:
|
|
84
85
|
|
|
85
86
|
- **V1 (C-Style JS Engine):** The initial release is built in **strict C-style TypeScript/JavaScript** (direct `ArrayBuffer` pointer arithmetic, flat structs, and zero heap allocations). Writing V1 in JS accelerates the development cycle, simplifies debugging, and creates an instant feedback loop with the web community.
|
|
86
|
-
- **V2 (Drop-In C / Wasm Port):** Once the binary formats, VDBE opcodes, and APIs are battle-tested, the core engine
|
|
87
|
+
- **V2 (Drop-In C / Wasm Port):** Once the binary formats, VDBE opcodes, and APIs are battle-tested, the core engine is compiled to an ultra-lean Wasm binary (~13 KB Wasm core, <100 KB total bundle)βwith zero changes required to the host JS orchestration layer.
|
|
87
88
|
- **Current Milestone:** Slotted-page layouts, basic VDBE opcode execution, in-memory/IndexedDB adapters, and query planning are implemented and verified with automated test suites. Full V1 engine development is actively underway.
|
|
88
89
|
- **Interactive Tools Live:** You can test queries in the [WebDB Studio Playground](https://ahmad-moussawi.github.io/webdb/playground/) or evaluate performance in the [In-Browser Benchmark Suite](https://ahmad-moussawi.github.io/webdb/benchmark/).
|
|
89
90
|
|
|
@@ -213,6 +214,49 @@ main();
|
|
|
213
214
|
|
|
214
215
|
---
|
|
215
216
|
|
|
217
|
+
## π‘ Reactive Live Queries (React, Vue, Angular & Plain JS)
|
|
218
|
+
|
|
219
|
+
WebDB provides zero-bundle-bloat subpath exports (`< 1 KB` gzipped each) that automatically track every table read by your queryβincluding `JOIN`s and nested subqueriesβand push live updates whenever those tables change locally or from another browser tab:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
// 1. Plain JavaScript / TypeScript (@ahmadmoussawi/webdb)
|
|
223
|
+
const live = db
|
|
224
|
+
.from("users")
|
|
225
|
+
.where("score", ">=", 90)
|
|
226
|
+
.orderBy("score", "desc")
|
|
227
|
+
.live((topUsers) => renderLeaderboard(topUsers));
|
|
228
|
+
|
|
229
|
+
// Or consume as an AsyncIterable:
|
|
230
|
+
for await (const topUsers of db.from("users").where("score", ">=", 90).live()) {
|
|
231
|
+
renderLeaderboard(topUsers);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// 2. React (@ahmadmoussawi/webdb/react)
|
|
235
|
+
import { useLiveQuery } from "@ahmadmoussawi/webdb/react";
|
|
236
|
+
const { data: users, isLoading } = useLiveQuery(
|
|
237
|
+
() => db.from("users").where("age", ">=", minAge).orderBy("score", "desc"),
|
|
238
|
+
[minAge],
|
|
239
|
+
{ initialData: [] }
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
// 3. Vue 3 (@ahmadmoussawi/webdb/vue)
|
|
243
|
+
import { useLiveQuery } from "@ahmadmoussawi/webdb/vue";
|
|
244
|
+
const { data: users, isLoading } = useLiveQuery(
|
|
245
|
+
() => db.from("users").where("age", ">=", minAgeRef.value).orderBy("score", "desc"),
|
|
246
|
+
[minAgeRef],
|
|
247
|
+
{ initialData: [] }
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
// 4. Angular Signals & RxJS (@ahmadmoussawi/webdb/angular)
|
|
251
|
+
import { liveQuerySignal, liveQuery$ } from "@ahmadmoussawi/webdb/angular";
|
|
252
|
+
users = liveQuerySignal(
|
|
253
|
+
() => db.from("users").where("age", ">=", this.minAge()).orderBy("score", "desc"),
|
|
254
|
+
{ initialData: [] }
|
|
255
|
+
);
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
216
260
|
## βοΈ Core Architecture: TypeScript β C Transpiler
|
|
217
261
|
|
|
218
262
|
WebDB uses an automated **TypeScript-to-C Transpiler** (`scripts/transpiler/`) to maintain a single canonical source of truth for its core storage and execution engine (`src/core/js/*.c.ts`).
|
package/dist/angular.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@angular/core"),d=require("rxjs"),a=require("@ahmadmoussawi/webdb"),c=new n.InjectionToken("WEBDB_INSTANCE");function y(t){return n.makeEnvironmentProviders([typeof t=="function"?{provide:c,useFactory:t}:{provide:c,useValue:t}])}function v(){const t=n.inject(c,{optional:!0});if(!t)throw new Error("No WebDB instance found in Angular injector. Register one using provideWebDB(db).");return t}function g(t,e={}){let i=e.destroyRef??null,u=null;if(!i)try{i=e.injector?e.injector.get(n.DestroyRef,void 0)??null:n.inject(n.DestroyRef,{optional:!0})}catch{}if(!e.db)try{u=e.injector?e.injector.get(c,void 0)??null:n.inject(c,{optional:!0})}catch{}const o=n.signal({data:e.initialData,isLoading:!0,error:null,lastUpdated:null,lastEvent:null}),r=a.createLiveQuery(t,{...e,db:e.db??u,autoStart:!1}),f=r.subscribe(b=>{o.set(b)});let l=null;try{l=n.effect(()=>{r.refresh()},{injector:e.injector,allowSignalWrites:!0})}catch{r.refresh()}const s=()=>{if(l){try{l.destroy()}catch{}l=null}f(),r.destroy()};return i&&i.onDestroy(s),{data:n.computed(()=>o().data),isLoading:n.computed(()=>o().isLoading),error:n.computed(()=>o().error),state:o.asReadonly(),refresh:()=>r.refresh(),destroy:s}}function j(t,e={}){return new d.Observable(i=>{const u=a.createLiveQuery(t,e),o=u.subscribe(r=>{if(r.error){i.error(r.error);return}(!r.isLoading||r.data!==void 0)&&i.next(r.data)});return()=>{o(),u.destroy()}})}function D(t,e={}){return new d.Observable(i=>{const u=a.createLiveQuery(t,e),o=u.subscribe(r=>{i.next(r)});return()=>{o(),u.destroy()}})}exports.WEBDB_TOKEN=c;exports.injectWebDB=v;exports.liveQuery$=j;exports.liveQuerySignal=g;exports.liveQueryState$=D;exports.provideWebDB=y;
|
|
2
|
+
//# sourceMappingURL=angular.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular.cjs","sources":["../src/angular/index.ts"],"sourcesContent":["/// <reference path=\"./peer-types.d.ts\" />\nimport {\n signal,\n computed,\n effect,\n inject,\n DestroyRef,\n InjectionToken,\n makeEnvironmentProviders,\n type Signal,\n type Injector,\n type EnvironmentProviders,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport {\n createLiveQuery,\n type WebDB,\n type DbRow,\n type LiveQueryFn,\n type LiveQueryOptions,\n type LiveQueryState,\n} from '@ahmadmoussawi/webdb';\n\n/**\n * Angular InjectionToken for providing a WebDB instance via Dependency Injection.\n */\nexport const WEBDB_TOKEN = new InjectionToken<WebDB>('WEBDB_INSTANCE');\n\n/**\n * Provides a WebDB instance (or factory) in an Angular application or route config.\n *\n * @example\n * ```ts\n * export const appConfig: ApplicationConfig = {\n * providers: [provideWebDB(db)],\n * };\n * ```\n */\nexport function provideWebDB(\n dbOrFactory: WebDB | (() => WebDB),\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n typeof dbOrFactory === 'function'\n ? { provide: WEBDB_TOKEN, useFactory: dbOrFactory }\n : { provide: WEBDB_TOKEN, useValue: dbOrFactory },\n ]);\n}\n\n/**\n * Injects the configured WebDB instance inside an Angular injection context.\n */\nexport function injectWebDB(): WebDB {\n const db = inject(WEBDB_TOKEN, { optional: true });\n if (!db) {\n throw new Error(\n 'No WebDB instance found in Angular injector. Register one using provideWebDB(db).',\n );\n }\n return db;\n}\n\nexport interface AngularLiveQueryOptions<T> extends LiveQueryOptions<T> {\n /** Optional Angular DestroyRef for automatic cleanup outside an injection context */\n destroyRef?: DestroyRef;\n /** Optional Angular Injector for running signal effects and resolving DestroyRef */\n injector?: Injector;\n}\n\nexport interface LiveQuerySignal<T> {\n /** Signal containing the latest query result (`initialData` or `undefined` while loading) */\n readonly data: Signal<T | undefined>;\n /** Signal indicating whether the initial query is currently loading */\n readonly isLoading: Signal<boolean>;\n /** Signal containing the latest query error, or `null` */\n readonly error: Signal<Error | null>;\n /** Signal containing the full `LiveQueryState<T>` snapshot */\n readonly state: Signal<LiveQueryState<T>>;\n /** Manually forces a re-execution of the query */\n refresh(): Promise<T | undefined>;\n /** Cleans up database subscriptions and stops the live query */\n destroy(): void;\n}\n\n/**\n * Creates an Angular Signal-based live query that automatically updates whenever:\n * 1. Any referenced WebDB tables (including JOINs & subqueries) are modified locally or across tabs, OR\n * 2. Any Angular Signals read synchronously inside `queryFn` change.\n *\n * Automatically cleans up subscriptions when the enclosing Angular component/service is destroyed.\n *\n * @example\n * ```ts\n * @Component({\n * template: `\n * @if (todos.isLoading()) { <p>Loading...</p> }\n * @for (todo of todos.data(); track todo.id) {\n * <li>{{ todo.title }}</li>\n * }\n * `\n * })\n * export class TodoListComponent {\n * status = signal('active');\n * todos = liveQuerySignal(\n * () => db.from('todos').where('status', '=', this.status()).orderBy('id', 'desc'),\n * { initialData: [] }\n * );\n * }\n * ```\n */\nexport function liveQuerySignal<T = DbRow[]>(\n queryFn: LiveQueryFn<T>,\n options: AngularLiveQueryOptions<T> = {},\n): LiveQuerySignal<T> {\n let destroyRef = options.destroyRef ?? null;\n let injectedDb: WebDB | null = null;\n\n if (!destroyRef) {\n try {\n destroyRef = options.injector\n ? options.injector.get(DestroyRef, undefined) ?? null\n : inject(DestroyRef, { optional: true });\n } catch {}\n }\n\n if (!options.db) {\n try {\n injectedDb = options.injector\n ? options.injector.get(WEBDB_TOKEN, undefined) ?? null\n : inject(WEBDB_TOKEN, { optional: true });\n } catch {}\n }\n\n const stateSignal = signal<LiveQueryState<T>>({\n data: options.initialData,\n isLoading: true,\n error: null,\n lastUpdated: null,\n lastEvent: null,\n });\n\n const controller = createLiveQuery<T>(queryFn, {\n ...options,\n db: options.db ?? injectedDb,\n autoStart: false,\n });\n\n const unsubscribe = controller.subscribe((nextState) => {\n stateSignal.set(nextState);\n });\n\n let effectRef: { destroy(): void } | null = null;\n try {\n effectRef = effect(\n () => {\n void controller.refresh();\n },\n {\n injector: options.injector,\n allowSignalWrites: true,\n },\n );\n } catch {\n // Outside an Angular injection context without an injector: start immediately\n void controller.refresh();\n }\n\n const destroy = () => {\n if (effectRef) {\n try {\n effectRef.destroy();\n } catch {}\n effectRef = null;\n }\n unsubscribe();\n controller.destroy();\n };\n\n if (destroyRef) {\n destroyRef.onDestroy(destroy);\n }\n\n return {\n data: computed(() => stateSignal().data),\n isLoading: computed(() => stateSignal().isLoading),\n error: computed(() => stateSignal().error),\n state: stateSignal.asReadonly(),\n refresh: () => controller.refresh(),\n destroy,\n };\n}\n\n/**\n * Returns a cold RxJS `Observable<T>` that executes `queryFn` upon subscription\n * and emits fresh results whenever any referenced WebDB tables change locally or across tabs.\n * Automatically unsubscribes from WebDB when the RxJS subscription is closed.\n *\n * Compatible with Angular's `| async` pipe, `toSignal()`, `switchMap()`, and `combineLatest()`.\n *\n * @example\n * ```ts\n * todos$ = this.filter$.pipe(\n * switchMap((status) =>\n * liveQuery$(() => db.from('todos').where('status', '=', status))\n * )\n * );\n * ```\n */\nexport function liveQuery$<T = DbRow[]>(\n queryFn: LiveQueryFn<T>,\n options: LiveQueryOptions<T> = {},\n): Observable<T> {\n return new Observable<T>((subscriber) => {\n const controller = createLiveQuery<T>(queryFn, options);\n const unsubscribe = controller.subscribe((state) => {\n if (state.error) {\n subscriber.error(state.error);\n return;\n }\n if (!state.isLoading || state.data !== undefined) {\n subscriber.next(state.data as T);\n }\n });\n\n return () => {\n unsubscribe();\n controller.destroy();\n };\n });\n}\n\n/**\n * Returns a cold RxJS `Observable<LiveQueryState<T>>` that emits the full state object\n * (`{ data, isLoading, error, lastUpdated, lastEvent }`) on every transition.\n */\nexport function liveQueryState$<T = DbRow[]>(\n queryFn: LiveQueryFn<T>,\n options: LiveQueryOptions<T> = {},\n): Observable<LiveQueryState<T>> {\n return new Observable<LiveQueryState<T>>((subscriber) => {\n const controller = createLiveQuery<T>(queryFn, options);\n const unsubscribe = controller.subscribe((state) => {\n subscriber.next(state);\n });\n\n return () => {\n unsubscribe();\n controller.destroy();\n };\n });\n}\n\n"],"names":["WEBDB_TOKEN","InjectionToken","provideWebDB","dbOrFactory","makeEnvironmentProviders","injectWebDB","db","inject","liveQuerySignal","queryFn","options","destroyRef","injectedDb","DestroyRef","stateSignal","signal","controller","createLiveQuery","unsubscribe","nextState","effectRef","effect","destroy","computed","liveQuery$","Observable","subscriber","state","liveQueryState$"],"mappings":"qKA0BaA,EAAc,IAAIC,EAAAA,eAAsB,gBAAgB,EAY9D,SAASC,EACdC,EACsB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CACFA,EAAU,QAAA,CACZ,MAAQ,CAAC,CACTA,EAAY,IACd,CACAF,EAAA,EACAF,EAAW,QAAA,CACb,EAEA,OAAIL,GACFA,EAAW,UAAUW,CAAO,EAGvB,CACL,KAAMC,EAAAA,SAAS,IAAMT,EAAA,EAAc,IAAI,EACvC,UAAWS,EAAAA,SAAS,IAAMT,EAAA,EAAc,SAAS,EACjD,MAAOS,EAAAA,SAAS,IAAMT,EAAA,EAAc,KAAK,EACzC,MAAOA,EAAY,WAAA,EACnB,QAAS,IAAME,EAAW,QAAA,EAC1B,QAAAM,CAAA,CAEJ,CAkBO,SAASE,EACdf,EACAC,EAA+B,GAChB,CACf,OAAO,IAAIe,EAAAA,WAAeC,GAAe,CACvC,MAAMV,EAAaC,EAAAA,gBAAmBR,EAASC,CAAO,EAChDQ,EAAcF,EAAW,UAAWW,GAAU,CAClD,GAAIA,EAAM,MAAO,CACfD,EAAW,MAAMC,EAAM,KAAK,EAC5B,MACF,EACI,CAACA,EAAM,WAAaA,EAAM,OAAS,SACrCD,EAAW,KAAKC,EAAM,IAAS,CAEnC,CAAC,EAED,MAAO,IAAM,CACXT,EAAA,EACAF,EAAW,QAAA,CACb,CACF,CAAC,CACH,CAMO,SAASY,EACdnB,EACAC,EAA+B,GACA,CAC/B,OAAO,IAAIe,EAAAA,WAA+BC,GAAe,CACvD,MAAMV,EAAaC,EAAAA,gBAAmBR,EAASC,CAAO,EAChDQ,EAAcF,EAAW,UAAWW,GAAU,CAClDD,EAAW,KAAKC,CAAK,CACvB,CAAC,EAED,MAAO,IAAM,CACXT,EAAA,EACAF,EAAW,QAAA,CACb,CACF,CAAC,CACH"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DestroyRef, InjectionToken, Signal, Injector, EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { WebDB, DbRow, LiveQueryFn, LiveQueryOptions, LiveQueryState } from '@ahmadmoussawi/webdb';
|
|
4
|
+
/**
|
|
5
|
+
* Angular InjectionToken for providing a WebDB instance via Dependency Injection.
|
|
6
|
+
*/
|
|
7
|
+
export declare const WEBDB_TOKEN: InjectionToken<WebDB>;
|
|
8
|
+
/**
|
|
9
|
+
* Provides a WebDB instance (or factory) in an Angular application or route config.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* export const appConfig: ApplicationConfig = {
|
|
14
|
+
* providers: [provideWebDB(db)],
|
|
15
|
+
* };
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function provideWebDB(dbOrFactory: WebDB | (() => WebDB)): EnvironmentProviders;
|
|
19
|
+
/**
|
|
20
|
+
* Injects the configured WebDB instance inside an Angular injection context.
|
|
21
|
+
*/
|
|
22
|
+
export declare function injectWebDB(): WebDB;
|
|
23
|
+
export interface AngularLiveQueryOptions<T> extends LiveQueryOptions<T> {
|
|
24
|
+
/** Optional Angular DestroyRef for automatic cleanup outside an injection context */
|
|
25
|
+
destroyRef?: DestroyRef;
|
|
26
|
+
/** Optional Angular Injector for running signal effects and resolving DestroyRef */
|
|
27
|
+
injector?: Injector;
|
|
28
|
+
}
|
|
29
|
+
export interface LiveQuerySignal<T> {
|
|
30
|
+
/** Signal containing the latest query result (`initialData` or `undefined` while loading) */
|
|
31
|
+
readonly data: Signal<T | undefined>;
|
|
32
|
+
/** Signal indicating whether the initial query is currently loading */
|
|
33
|
+
readonly isLoading: Signal<boolean>;
|
|
34
|
+
/** Signal containing the latest query error, or `null` */
|
|
35
|
+
readonly error: Signal<Error | null>;
|
|
36
|
+
/** Signal containing the full `LiveQueryState<T>` snapshot */
|
|
37
|
+
readonly state: Signal<LiveQueryState<T>>;
|
|
38
|
+
/** Manually forces a re-execution of the query */
|
|
39
|
+
refresh(): Promise<T | undefined>;
|
|
40
|
+
/** Cleans up database subscriptions and stops the live query */
|
|
41
|
+
destroy(): void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates an Angular Signal-based live query that automatically updates whenever:
|
|
45
|
+
* 1. Any referenced WebDB tables (including JOINs & subqueries) are modified locally or across tabs, OR
|
|
46
|
+
* 2. Any Angular Signals read synchronously inside `queryFn` change.
|
|
47
|
+
*
|
|
48
|
+
* Automatically cleans up subscriptions when the enclosing Angular component/service is destroyed.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* @Component({
|
|
53
|
+
* template: `
|
|
54
|
+
* @if (todos.isLoading()) { <p>Loading...</p> }
|
|
55
|
+
* @for (todo of todos.data(); track todo.id) {
|
|
56
|
+
* <li>{{ todo.title }}</li>
|
|
57
|
+
* }
|
|
58
|
+
* `
|
|
59
|
+
* })
|
|
60
|
+
* export class TodoListComponent {
|
|
61
|
+
* status = signal('active');
|
|
62
|
+
* todos = liveQuerySignal(
|
|
63
|
+
* () => db.from('todos').where('status', '=', this.status()).orderBy('id', 'desc'),
|
|
64
|
+
* { initialData: [] }
|
|
65
|
+
* );
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function liveQuerySignal<T = DbRow[]>(queryFn: LiveQueryFn<T>, options?: AngularLiveQueryOptions<T>): LiveQuerySignal<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Returns a cold RxJS `Observable<T>` that executes `queryFn` upon subscription
|
|
72
|
+
* and emits fresh results whenever any referenced WebDB tables change locally or across tabs.
|
|
73
|
+
* Automatically unsubscribes from WebDB when the RxJS subscription is closed.
|
|
74
|
+
*
|
|
75
|
+
* Compatible with Angular's `| async` pipe, `toSignal()`, `switchMap()`, and `combineLatest()`.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* todos$ = this.filter$.pipe(
|
|
80
|
+
* switchMap((status) =>
|
|
81
|
+
* liveQuery$(() => db.from('todos').where('status', '=', status))
|
|
82
|
+
* )
|
|
83
|
+
* );
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare function liveQuery$<T = DbRow[]>(queryFn: LiveQueryFn<T>, options?: LiveQueryOptions<T>): Observable<T>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns a cold RxJS `Observable<LiveQueryState<T>>` that emits the full state object
|
|
89
|
+
* (`{ data, isLoading, error, lastUpdated, lastEvent }`) on every transition.
|
|
90
|
+
*/
|
|
91
|
+
export declare function liveQueryState$<T = DbRow[]>(queryFn: LiveQueryFn<T>, options?: LiveQueryOptions<T>): Observable<LiveQueryState<T>>;
|
|
92
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/angular.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { InjectionToken as g, makeEnvironmentProviders as j, inject as a, DestroyRef as f, signal as D, effect as h, computed as l } from "@angular/core";
|
|
2
|
+
import { Observable as b } from "rxjs";
|
|
3
|
+
import { createLiveQuery as s } from "@ahmadmoussawi/webdb";
|
|
4
|
+
const u = new g("WEBDB_INSTANCE");
|
|
5
|
+
function W(t) {
|
|
6
|
+
return j([
|
|
7
|
+
typeof t == "function" ? { provide: u, useFactory: t } : { provide: u, useValue: t }
|
|
8
|
+
]);
|
|
9
|
+
}
|
|
10
|
+
function w() {
|
|
11
|
+
const t = a(u, { optional: !0 });
|
|
12
|
+
if (!t)
|
|
13
|
+
throw new Error(
|
|
14
|
+
"No WebDB instance found in Angular injector. Register one using provideWebDB(db)."
|
|
15
|
+
);
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
function R(t, e = {}) {
|
|
19
|
+
let n = e.destroyRef ?? null, i = null;
|
|
20
|
+
if (!n)
|
|
21
|
+
try {
|
|
22
|
+
n = e.injector ? e.injector.get(f, void 0) ?? null : a(f, { optional: !0 });
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
if (!e.db)
|
|
26
|
+
try {
|
|
27
|
+
i = e.injector ? e.injector.get(u, void 0) ?? null : a(u, { optional: !0 });
|
|
28
|
+
} catch {
|
|
29
|
+
}
|
|
30
|
+
const o = D({
|
|
31
|
+
data: e.initialData,
|
|
32
|
+
isLoading: !0,
|
|
33
|
+
error: null,
|
|
34
|
+
lastUpdated: null,
|
|
35
|
+
lastEvent: null
|
|
36
|
+
}), r = s(t, {
|
|
37
|
+
...e,
|
|
38
|
+
db: e.db ?? i,
|
|
39
|
+
autoStart: !1
|
|
40
|
+
}), y = r.subscribe((v) => {
|
|
41
|
+
o.set(v);
|
|
42
|
+
});
|
|
43
|
+
let c = null;
|
|
44
|
+
try {
|
|
45
|
+
c = h(
|
|
46
|
+
() => {
|
|
47
|
+
r.refresh();
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
injector: e.injector,
|
|
51
|
+
allowSignalWrites: !0
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
} catch {
|
|
55
|
+
r.refresh();
|
|
56
|
+
}
|
|
57
|
+
const d = () => {
|
|
58
|
+
if (c) {
|
|
59
|
+
try {
|
|
60
|
+
c.destroy();
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
c = null;
|
|
64
|
+
}
|
|
65
|
+
y(), r.destroy();
|
|
66
|
+
};
|
|
67
|
+
return n && n.onDestroy(d), {
|
|
68
|
+
data: l(() => o().data),
|
|
69
|
+
isLoading: l(() => o().isLoading),
|
|
70
|
+
error: l(() => o().error),
|
|
71
|
+
state: o.asReadonly(),
|
|
72
|
+
refresh: () => r.refresh(),
|
|
73
|
+
destroy: d
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function S(t, e = {}) {
|
|
77
|
+
return new b((n) => {
|
|
78
|
+
const i = s(t, e), o = i.subscribe((r) => {
|
|
79
|
+
if (r.error) {
|
|
80
|
+
n.error(r.error);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
(!r.isLoading || r.data !== void 0) && n.next(r.data);
|
|
84
|
+
});
|
|
85
|
+
return () => {
|
|
86
|
+
o(), i.destroy();
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function p(t, e = {}) {
|
|
91
|
+
return new b((n) => {
|
|
92
|
+
const i = s(t, e), o = i.subscribe((r) => {
|
|
93
|
+
n.next(r);
|
|
94
|
+
});
|
|
95
|
+
return () => {
|
|
96
|
+
o(), i.destroy();
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
u as WEBDB_TOKEN,
|
|
102
|
+
w as injectWebDB,
|
|
103
|
+
S as liveQuery$,
|
|
104
|
+
R as liveQuerySignal,
|
|
105
|
+
p as liveQueryState$,
|
|
106
|
+
W as provideWebDB
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=angular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular.js","sources":["../src/angular/index.ts"],"sourcesContent":["/// <reference path=\"./peer-types.d.ts\" />\nimport {\n signal,\n computed,\n effect,\n inject,\n DestroyRef,\n InjectionToken,\n makeEnvironmentProviders,\n type Signal,\n type Injector,\n type EnvironmentProviders,\n} from '@angular/core';\nimport { Observable } from 'rxjs';\nimport {\n createLiveQuery,\n type WebDB,\n type DbRow,\n type LiveQueryFn,\n type LiveQueryOptions,\n type LiveQueryState,\n} from '@ahmadmoussawi/webdb';\n\n/**\n * Angular InjectionToken for providing a WebDB instance via Dependency Injection.\n */\nexport const WEBDB_TOKEN = new InjectionToken<WebDB>('WEBDB_INSTANCE');\n\n/**\n * Provides a WebDB instance (or factory) in an Angular application or route config.\n *\n * @example\n * ```ts\n * export const appConfig: ApplicationConfig = {\n * providers: [provideWebDB(db)],\n * };\n * ```\n */\nexport function provideWebDB(\n dbOrFactory: WebDB | (() => WebDB),\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n typeof dbOrFactory === 'function'\n ? { provide: WEBDB_TOKEN, useFactory: dbOrFactory }\n : { provide: WEBDB_TOKEN, useValue: dbOrFactory },\n ]);\n}\n\n/**\n * Injects the configured WebDB instance inside an Angular injection context.\n */\nexport function injectWebDB(): WebDB {\n const db = inject(WEBDB_TOKEN, { optional: true });\n if (!db) {\n throw new Error(\n 'No WebDB instance found in Angular injector. Register one using provideWebDB(db).',\n );\n }\n return db;\n}\n\nexport interface AngularLiveQueryOptions<T> extends LiveQueryOptions<T> {\n /** Optional Angular DestroyRef for automatic cleanup outside an injection context */\n destroyRef?: DestroyRef;\n /** Optional Angular Injector for running signal effects and resolving DestroyRef */\n injector?: Injector;\n}\n\nexport interface LiveQuerySignal<T> {\n /** Signal containing the latest query result (`initialData` or `undefined` while loading) */\n readonly data: Signal<T | undefined>;\n /** Signal indicating whether the initial query is currently loading */\n readonly isLoading: Signal<boolean>;\n /** Signal containing the latest query error, or `null` */\n readonly error: Signal<Error | null>;\n /** Signal containing the full `LiveQueryState<T>` snapshot */\n readonly state: Signal<LiveQueryState<T>>;\n /** Manually forces a re-execution of the query */\n refresh(): Promise<T | undefined>;\n /** Cleans up database subscriptions and stops the live query */\n destroy(): void;\n}\n\n/**\n * Creates an Angular Signal-based live query that automatically updates whenever:\n * 1. Any referenced WebDB tables (including JOINs & subqueries) are modified locally or across tabs, OR\n * 2. Any Angular Signals read synchronously inside `queryFn` change.\n *\n * Automatically cleans up subscriptions when the enclosing Angular component/service is destroyed.\n *\n * @example\n * ```ts\n * @Component({\n * template: `\n * @if (todos.isLoading()) { <p>Loading...</p> }\n * @for (todo of todos.data(); track todo.id) {\n * <li>{{ todo.title }}</li>\n * }\n * `\n * })\n * export class TodoListComponent {\n * status = signal('active');\n * todos = liveQuerySignal(\n * () => db.from('todos').where('status', '=', this.status()).orderBy('id', 'desc'),\n * { initialData: [] }\n * );\n * }\n * ```\n */\nexport function liveQuerySignal<T = DbRow[]>(\n queryFn: LiveQueryFn<T>,\n options: AngularLiveQueryOptions<T> = {},\n): LiveQuerySignal<T> {\n let destroyRef = options.destroyRef ?? null;\n let injectedDb: WebDB | null = null;\n\n if (!destroyRef) {\n try {\n destroyRef = options.injector\n ? options.injector.get(DestroyRef, undefined) ?? null\n : inject(DestroyRef, { optional: true });\n } catch {}\n }\n\n if (!options.db) {\n try {\n injectedDb = options.injector\n ? options.injector.get(WEBDB_TOKEN, undefined) ?? null\n : inject(WEBDB_TOKEN, { optional: true });\n } catch {}\n }\n\n const stateSignal = signal<LiveQueryState<T>>({\n data: options.initialData,\n isLoading: true,\n error: null,\n lastUpdated: null,\n lastEvent: null,\n });\n\n const controller = createLiveQuery<T>(queryFn, {\n ...options,\n db: options.db ?? injectedDb,\n autoStart: false,\n });\n\n const unsubscribe = controller.subscribe((nextState) => {\n stateSignal.set(nextState);\n });\n\n let effectRef: { destroy(): void } | null = null;\n try {\n effectRef = effect(\n () => {\n void controller.refresh();\n },\n {\n injector: options.injector,\n allowSignalWrites: true,\n },\n );\n } catch {\n // Outside an Angular injection context without an injector: start immediately\n void controller.refresh();\n }\n\n const destroy = () => {\n if (effectRef) {\n try {\n effectRef.destroy();\n } catch {}\n effectRef = null;\n }\n unsubscribe();\n controller.destroy();\n };\n\n if (destroyRef) {\n destroyRef.onDestroy(destroy);\n }\n\n return {\n data: computed(() => stateSignal().data),\n isLoading: computed(() => stateSignal().isLoading),\n error: computed(() => stateSignal().error),\n state: stateSignal.asReadonly(),\n refresh: () => controller.refresh(),\n destroy,\n };\n}\n\n/**\n * Returns a cold RxJS `Observable<T>` that executes `queryFn` upon subscription\n * and emits fresh results whenever any referenced WebDB tables change locally or across tabs.\n * Automatically unsubscribes from WebDB when the RxJS subscription is closed.\n *\n * Compatible with Angular's `| async` pipe, `toSignal()`, `switchMap()`, and `combineLatest()`.\n *\n * @example\n * ```ts\n * todos$ = this.filter$.pipe(\n * switchMap((status) =>\n * liveQuery$(() => db.from('todos').where('status', '=', status))\n * )\n * );\n * ```\n */\nexport function liveQuery$<T = DbRow[]>(\n queryFn: LiveQueryFn<T>,\n options: LiveQueryOptions<T> = {},\n): Observable<T> {\n return new Observable<T>((subscriber) => {\n const controller = createLiveQuery<T>(queryFn, options);\n const unsubscribe = controller.subscribe((state) => {\n if (state.error) {\n subscriber.error(state.error);\n return;\n }\n if (!state.isLoading || state.data !== undefined) {\n subscriber.next(state.data as T);\n }\n });\n\n return () => {\n unsubscribe();\n controller.destroy();\n };\n });\n}\n\n/**\n * Returns a cold RxJS `Observable<LiveQueryState<T>>` that emits the full state object\n * (`{ data, isLoading, error, lastUpdated, lastEvent }`) on every transition.\n */\nexport function liveQueryState$<T = DbRow[]>(\n queryFn: LiveQueryFn<T>,\n options: LiveQueryOptions<T> = {},\n): Observable<LiveQueryState<T>> {\n return new Observable<LiveQueryState<T>>((subscriber) => {\n const controller = createLiveQuery<T>(queryFn, options);\n const unsubscribe = controller.subscribe((state) => {\n subscriber.next(state);\n });\n\n return () => {\n unsubscribe();\n controller.destroy();\n };\n });\n}\n\n"],"names":["WEBDB_TOKEN","InjectionToken","provideWebDB","dbOrFactory","makeEnvironmentProviders","injectWebDB","db","inject","liveQuerySignal","queryFn","options","destroyRef","injectedDb","DestroyRef","stateSignal","signal","controller","createLiveQuery","unsubscribe","nextState","effectRef","effect","destroy","computed","liveQuery$","Observable","subscriber","state","liveQueryState$"],"mappings":";;;AA0BO,MAAMA,IAAc,IAAIC,EAAsB,gBAAgB;AAY9D,SAASC,EACdC,GACsB;AACtB,SAAOC,EAAyB;AAAA,IAC9B,OAAOD,KAAgB,aACnB,EAAE,SAASH,GAAa,YAAYG,EAAA,IACpC,EAAE,SAASH,GAAa,UAAUG,EAAA;AAAA,EAAY,CACnD;AACH;AAKO,SAASE,IAAqB;AACnC,QAAMC,IAAKC,EAAOP,GAAa,EAAE,UAAU,IAAM;AACjD,MAAI,CAACM;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGJ,SAAOA;AACT;AAkDO,SAASE,EACdC,GACAC,IAAsC,IAClB;AACpB,MAAIC,IAAaD,EAAQ,cAAc,MACnCE,IAA2B;AAE/B,MAAI,CAACD;AACH,QAAI;AACF,MAAAA,IAAaD,EAAQ,WACjBA,EAAQ,SAAS,IAAIG,GAA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,KAAK;AAAA,IACzC,OAAOA,EAAY,WAAA;AAAA,IACnB,SAAS,MAAME,EAAW,QAAA;AAAA,IAC1B,SAAAM;AAAA,EAAA;AAEJ;AAkBO,SAASE,EACdf,GACAC,IAA+B,IAChB;AACf,SAAO,IAAIe,EAAc,CAACC,MAAe;AACvC,UAAMV,IAAaC,EAAmBR,GAASC,CAAO,GAChDQ,IAAcF,EAAW,UAAU,CAACW,MAAU;AAClD,UAAIA,EAAM,OAAO;AACf,QAAAD,EAAW,MAAMC,EAAM,KAAK;AAC5B;AAAA,MACF;AACA,OAAI,CAACA,EAAM,aAAaA,EAAM,SAAS,WACrCD,EAAW,KAAKC,EAAM,IAAS;AAAA,IAEnC,CAAC;AAED,WAAO,MAAM;AACX,MAAAT,EAAA,GACAF,EAAW,QAAA;AAAA,IACb;AAAA,EACF,CAAC;AACH;AAMO,SAASY,EACdnB,GACAC,IAA+B,IACA;AAC/B,SAAO,IAAIe,EAA8B,CAACC,MAAe;AACvD,UAAMV,IAAaC,EAAmBR,GAASC,CAAO,GAChDQ,IAAcF,EAAW,UAAU,CAACW,MAAU;AAClD,MAAAD,EAAW,KAAKC,CAAK;AAAA,IACvB,CAAC;AAED,WAAO,MAAM;AACX,MAAAT,EAAA,GACAF,EAAW,QAAA;AAAA,IACb;AAAA,EACF,CAAC;AACH;"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { page_init, page_init_free, page_get_type, page_set_type, page_get_cell_
|
|
|
9
9
|
export { page_table_hash, page_table_get, page_table_set, page_table_delete, } from './js/page_table.c.js';
|
|
10
10
|
export { buf_pool_get_slot_offset, buf_pool_read_slot_to_page, buf_pool_write_slot_to_page, buf_pool_get_resident_slot, buf_pool_assign_slot, buf_pool_unassign_slot, buf_pool_mark_dirty, buf_pool_clear_dirty, buf_pool_is_dirty, buf_pool_pin_slot, buf_pool_unpin_slot, buf_pool_is_pinned, buf_pool_find_victim, buf_pool_select_eviction_victim, } from './js/buffer_pool.c.js';
|
|
11
11
|
export { vm_step, sql_like_match, compare_sorter_keys, fnv1a_32, } from './js/vm.c.js';
|
|
12
|
-
export { catalog_init_page1, catalog_read_page1_header, catalog_get_total_pages, catalog_set_total_pages, catalog_get_free_page_head, catalog_set_free_page_head, catalog_get_schema_version, catalog_increment_schema_version, catalog_get_change_counter, catalog_increment_change_counter, catalog_update_page1_checksum, catalog_write_fixed_string, catalog_read_fixed_string, catalog_parse_data_type, catalog_read_table_descriptor, catalog_write_table_descriptor, catalog_find_table_by_name, catalog_find_table_slot, catalog_find_free_table_slot, catalog_list_table_descriptors, catalog_read_index_descriptor, catalog_write_index_descriptor, catalog_find_free_index_slot, catalog_find_index_by_name, catalog_list_table_indexes, catalog_delete_index_descriptor, catalog_delete_table_descriptor, catalog_init_page, catalog_read_page_header, catalog_write_page_header, catalog_write_column_meta, catalog_read_column_meta, catalog_map_column_location, catalog_create_table, catalog_load_table_meta, catalog_load_all_tables, } from './js/catalog.c.js';
|
|
12
|
+
export { catalog_init_page1, catalog_read_page1_header, catalog_get_total_pages, catalog_set_total_pages, catalog_get_free_page_head, catalog_set_free_page_head, catalog_get_schema_version, catalog_increment_schema_version, catalog_get_change_counter, catalog_increment_change_counter, catalog_update_page1_checksum, catalog_write_fixed_string, catalog_read_fixed_string, catalog_parse_data_type, catalog_read_table_descriptor, catalog_write_table_descriptor, catalog_find_table_by_name, catalog_find_table_slot, catalog_find_free_table_slot, catalog_list_table_descriptors, catalog_get_table_slot_capacity, catalog_append_table_overflow_page, catalog_get_table_pk_index, catalog_read_index_descriptor, catalog_write_index_descriptor, catalog_find_free_index_slot, catalog_find_index_by_name, catalog_list_table_indexes, catalog_list_all_indexes, catalog_get_index_slot_capacity, catalog_append_index_overflow_page, catalog_delete_index_descriptor, catalog_delete_table_descriptor, MAX_DESCRIPTORS_PER_OVERFLOW_PAGE, catalog_init_page, catalog_read_page_header, catalog_write_page_header, catalog_write_column_meta, catalog_read_column_meta, catalog_map_column_location, catalog_create_table, catalog_load_table_meta, catalog_load_all_tables, } from './js/catalog.c.js';
|
|
13
13
|
export { createWasmCore, type WasmCoreExports, } from './wasm/wasm_core.js';
|
|
14
14
|
export { getWebDbCoreWasmBytes, WEBDB_CORE_WASM_BASE64, } from './wasm/embedded_wasm.js';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EACL,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,EAC9B,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EACL,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,QAAQ,GACT,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,gCAAgC,EAChC,0BAA0B,EAC1B,gCAAgC,EAChC,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,EAC9B,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,EAC/B,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,cAAc,EACd,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EACL,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,EAC9B,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,eAAe,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ACjB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EACL,cAAc,EACd,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC"}
|
|
@@ -80,62 +80,123 @@ export declare function catalog_read_fixed_string(view: DataView, offset: number
|
|
|
80
80
|
* Parses SQL type string to DataType enum.
|
|
81
81
|
*/
|
|
82
82
|
export declare function catalog_parse_data_type(type_str: string): DataType;
|
|
83
|
+
export declare const MAX_DESCRIPTORS_PER_OVERFLOW_PAGE = 31;
|
|
84
|
+
export declare const CATALOG_PAGE_FLAG_TABLE_OVERFLOW = 1;
|
|
85
|
+
export declare const CATALOG_PAGE_FLAG_INDEX_OVERFLOW = 2;
|
|
86
|
+
export declare function catalog_resolve_page_view(page1_view: DataView, page_id: number, pager?: {
|
|
87
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
88
|
+
}): DataView | null;
|
|
89
|
+
export declare function catalog_mark_overflow_page_dirty(page1_view: DataView, page_id: number, page_view: DataView, pager?: {
|
|
90
|
+
markPageDirty?(pageId: number): void;
|
|
91
|
+
}): void;
|
|
92
|
+
export declare function catalog_get_table_slot_capacity(page1_view: DataView, pager?: {
|
|
93
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
94
|
+
}): number;
|
|
95
|
+
export declare function catalog_locate_table_slot(page1_view: DataView, slot_idx: number, pager?: {
|
|
96
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
97
|
+
}): {
|
|
98
|
+
view: DataView;
|
|
99
|
+
offset: number;
|
|
100
|
+
pageId: number;
|
|
101
|
+
} | null;
|
|
102
|
+
export declare function catalog_append_table_overflow_page(page1_view: DataView, new_page_id: number, pager?: {
|
|
103
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
104
|
+
markPageDirty?(pageId: number): void;
|
|
105
|
+
}): number;
|
|
83
106
|
/**
|
|
84
|
-
* Reads a TableDescriptor from Page 1 by slot index
|
|
107
|
+
* Reads a TableDescriptor from Page 1 (or chained overflow catalog page) by slot index.
|
|
85
108
|
*/
|
|
86
|
-
export declare function catalog_read_table_descriptor(view: DataView, slot_idx: number
|
|
109
|
+
export declare function catalog_read_table_descriptor(view: DataView, slot_idx: number, pager?: {
|
|
110
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
111
|
+
}): TableDescriptor | null;
|
|
87
112
|
/**
|
|
88
|
-
* Writes a TableDescriptor into Page 1 at the specified slot index
|
|
113
|
+
* Writes a TableDescriptor into Page 1 (or chained overflow catalog page) at the specified slot index.
|
|
89
114
|
*/
|
|
90
|
-
export declare function catalog_write_table_descriptor(view: DataView, slot_idx: number, desc: TableDescriptor
|
|
115
|
+
export declare function catalog_write_table_descriptor(view: DataView, slot_idx: number, desc: TableDescriptor, pager?: {
|
|
116
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
117
|
+
markPageDirty?(pageId: number): void;
|
|
118
|
+
}): void;
|
|
119
|
+
export declare function catalog_get_table_pk_index(desc: TableDescriptor): IndexDescriptor | null;
|
|
91
120
|
/**
|
|
92
|
-
* Finds a TableDescriptor by name in Page 1, or null if not found.
|
|
121
|
+
* Finds a TableDescriptor by name in Page 1 (or overflow pages), or null if not found.
|
|
93
122
|
*/
|
|
94
|
-
export declare function catalog_find_table_by_name(view: DataView, table_name: string
|
|
123
|
+
export declare function catalog_find_table_by_name(view: DataView, table_name: string, pager?: {
|
|
124
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
125
|
+
}): TableDescriptor | null;
|
|
95
126
|
/**
|
|
96
127
|
* Finds the slot index of an existing table by name, or -1 if not found.
|
|
97
128
|
*/
|
|
98
|
-
export declare function catalog_find_table_slot(view: DataView, table_name: string
|
|
129
|
+
export declare function catalog_find_table_slot(view: DataView, table_name: string, pager?: {
|
|
130
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
131
|
+
}): number;
|
|
99
132
|
/**
|
|
100
|
-
*
|
|
101
|
-
* Finds the first free slot index in Page 1's TableDescriptor array.
|
|
133
|
+
* Finds the first free slot index in Page 1's TableDescriptor array (or existing overflow pages).
|
|
102
134
|
*/
|
|
103
|
-
export declare function catalog_find_free_table_slot(view: DataView, page1_offset?: u32
|
|
135
|
+
export declare function catalog_find_free_table_slot(view: DataView, page1_offset?: u32, pager?: {
|
|
136
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
137
|
+
}): i32;
|
|
104
138
|
/**
|
|
105
|
-
* Lists all active tables defined on Page 1.
|
|
139
|
+
* Lists all active tables defined on Page 1 and chained overflow pages.
|
|
106
140
|
*/
|
|
107
|
-
export declare function catalog_list_table_descriptors(view: DataView
|
|
141
|
+
export declare function catalog_list_table_descriptors(view: DataView, pager?: {
|
|
142
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
143
|
+
}): TableDescriptor[];
|
|
144
|
+
export declare function catalog_get_index_slot_capacity(page1_view: DataView, pager?: {
|
|
145
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
146
|
+
}): number;
|
|
147
|
+
export declare function catalog_locate_index_slot(page1_view: DataView, slot_idx: number, pager?: {
|
|
148
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
149
|
+
}): {
|
|
150
|
+
view: DataView;
|
|
151
|
+
offset: number;
|
|
152
|
+
pageId: number;
|
|
153
|
+
} | null;
|
|
154
|
+
export declare function catalog_append_index_overflow_page(page1_view: DataView, new_page_id: number, pager?: {
|
|
155
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
156
|
+
markPageDirty?(pageId: number): void;
|
|
157
|
+
}): number;
|
|
108
158
|
/**
|
|
109
|
-
* Reads an IndexDescriptor from Page 1 by slot index.
|
|
159
|
+
* Reads an IndexDescriptor from Page 1 (or chained overflow page) by slot index.
|
|
110
160
|
*/
|
|
111
|
-
export declare function catalog_read_index_descriptor(view: DataView, slot_idx: number
|
|
161
|
+
export declare function catalog_read_index_descriptor(view: DataView, slot_idx: number, pager?: {
|
|
162
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
163
|
+
}): IndexDescriptor | null;
|
|
112
164
|
/**
|
|
113
|
-
* Writes an IndexDescriptor into Page 1 at the specified slot index.
|
|
165
|
+
* Writes an IndexDescriptor into Page 1 (or chained overflow page) at the specified slot index.
|
|
114
166
|
*/
|
|
115
|
-
export declare function catalog_write_index_descriptor(view: DataView, slot_idx: number, desc: IndexDescriptor
|
|
167
|
+
export declare function catalog_write_index_descriptor(view: DataView, slot_idx: number, desc: IndexDescriptor, pager?: {
|
|
168
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
169
|
+
markPageDirty?(pageId: number): void;
|
|
170
|
+
}): void;
|
|
116
171
|
export declare const MAX_INDEXES_PAGE1 = 8;
|
|
117
172
|
/**
|
|
118
|
-
*
|
|
173
|
+
* Finds the first free slot index in Page 1's IndexDescriptor array (or existing overflow pages).
|
|
119
174
|
*/
|
|
120
|
-
export declare function catalog_find_free_index_slot(view: DataView, page1_offset?: u32
|
|
175
|
+
export declare function catalog_find_free_index_slot(view: DataView, page1_offset?: u32, pager?: {
|
|
176
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
177
|
+
}): i32;
|
|
121
178
|
/**
|
|
122
|
-
* Finds an IndexDescriptor by name in Page 1.
|
|
179
|
+
* Finds an IndexDescriptor by name in Page 1, overflow pages, or embedded table PK indexes.
|
|
123
180
|
*/
|
|
124
|
-
export declare function catalog_find_index_by_name(view: DataView, name: string
|
|
181
|
+
export declare function catalog_find_index_by_name(view: DataView, name: string, pager?: {
|
|
182
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
183
|
+
}): {
|
|
125
184
|
slotIdx: number;
|
|
126
185
|
desc: IndexDescriptor;
|
|
127
186
|
} | null;
|
|
128
187
|
/**
|
|
129
|
-
* Lists all index descriptors for a table.
|
|
188
|
+
* Lists all index descriptors for a table (including embedded primary key index and secondary indexes).
|
|
130
189
|
*/
|
|
131
|
-
export declare function catalog_list_table_indexes(view: DataView, table_id: number
|
|
190
|
+
export declare function catalog_list_table_indexes(view: DataView, table_id: number, pager?: {
|
|
191
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
192
|
+
}): IndexDescriptor[];
|
|
132
193
|
/**
|
|
133
|
-
*
|
|
194
|
+
* Lists all active index descriptors across all tables in the database.
|
|
134
195
|
*/
|
|
196
|
+
export declare function catalog_list_all_indexes(view: DataView, pager?: {
|
|
197
|
+
getPageBytes(pageId: number): Uint8Array;
|
|
198
|
+
}): IndexDescriptor[];
|
|
135
199
|
export declare function catalog_delete_index_descriptor(view: DataView, page1_offset: u32, slot_idx?: u32): i32;
|
|
136
|
-
/**
|
|
137
|
-
* @export_c
|
|
138
|
-
*/
|
|
139
200
|
export declare function catalog_delete_table_descriptor(view: DataView, page1_offset: u32, slot_idx?: u32): i32;
|
|
140
201
|
/**
|
|
141
202
|
* @export_c
|
|
@@ -178,7 +239,7 @@ export declare function catalog_load_table_meta(page1_view: DataView, pager: {
|
|
|
178
239
|
getPageBytes(pageId: number): Uint8Array;
|
|
179
240
|
}, table_name: string): TableMeta;
|
|
180
241
|
/**
|
|
181
|
-
* Loads all active tables and their full schemas from Page 1.
|
|
242
|
+
* Loads all active tables and their full schemas from Page 1 and chained overflow pages.
|
|
182
243
|
*/
|
|
183
244
|
export declare function catalog_load_all_tables(page1_view: DataView, pager: {
|
|
184
245
|
getPageBytes(pageId: number): Uint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.c.d.ts","sourceRoot":"","sources":["../../../src/core/js/catalog.c.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,QAAQ,EAIR,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,SAAS,EAQV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,O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BAAgB,oBAAoB,CAClC,UAAU,EAAE,QAAQ,EACpB,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,gBAAgB,EAAE,GAC7B,SAAS,CAmNX;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,QAAQ,EAEpB,KAAK,EAAE;IAAE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,EACnD,UAAU,EAAE,MAAM,GACjB,SAAS,CAyCX;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,QAAQ,EAEpB,KAAK,EAAE;IAAE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,GAClD,SAAS,EAAE,CASb"}
|
package/dist/host/api/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|