arrowbase 0.1.1
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/CHANGELOG.md +27 -0
- package/COMPATIBILITY.md +398 -0
- package/LICENSE +21 -0
- package/MIGRATING.md +238 -0
- package/README.md +897 -0
- package/RELEASE_NOTES.md +68 -0
- package/dist/arrow.d.ts +93 -0
- package/dist/arrow.js +5366 -0
- package/dist/arrow.js.map +1 -0
- package/dist/broadcast.d.ts +173 -0
- package/dist/broadcast.js +319 -0
- package/dist/broadcast.js.map +1 -0
- package/dist/collection-DGlKgOGi.d.ts +1932 -0
- package/dist/idb.d.ts +146 -0
- package/dist/idb.js +6193 -0
- package/dist/idb.js.map +1 -0
- package/dist/index.d.ts +1802 -0
- package/dist/index.js +13924 -0
- package/dist/index.js.map +1 -0
- package/dist/query-CzV9E57Y.d.ts +279 -0
- package/dist/react.d.ts +51 -0
- package/dist/react.js +1633 -0
- package/dist/react.js.map +1 -0
- package/dist/tanstack.d.ts +51 -0
- package/dist/tanstack.js +191 -0
- package/dist/tanstack.js.map +1 -0
- package/dist/types-CSoU6uED.d.ts +50 -0
- package/package.json +139 -0
package/RELEASE_NOTES.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Release notes — @tanstack/db parity
|
|
2
|
+
|
|
3
|
+
Version: **v0.1.1**
|
|
4
|
+
|
|
5
|
+
Compatibility: 294/294 exports ✅
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
This release positions ArrowBase as a columnar Arrow store with an
|
|
10
|
+
`@tanstack/db`-compatible API. The public surface has been reviewed against
|
|
11
|
+
`@tanstack/db@0.6.16`, the compatibility catalog is all green, and migration docs
|
|
12
|
+
now show side-by-side replacements for common TanStack DB usage.
|
|
13
|
+
|
|
14
|
+
## Highlights
|
|
15
|
+
|
|
16
|
+
- Publishes six verified ESM entry points with TypeScript declarations and npm
|
|
17
|
+
provenance: `arrowbase`, `tanstack`, `react`, `arrow`, `idb`, and `broadcast`.
|
|
18
|
+
- Ships the 294/294 compatibility catalog against `@tanstack/db@0.6.16`, plus
|
|
19
|
+
exact public-export, operator-manifest, differential, and golden tests.
|
|
20
|
+
- Adds columnar incremental live-query backends, spatial indexes, GeoArrow IPC,
|
|
21
|
+
optimistic transactions, persistence, and cross-tab synchronization.
|
|
22
|
+
- Hosts the correctness-gated City Ops playground on GitHub Pages, with desktop
|
|
23
|
+
and mobile end-to-end coverage.
|
|
24
|
+
- Keeps the published tarball focused on runtime output and consumer docs.
|
|
25
|
+
|
|
26
|
+
## Migration
|
|
27
|
+
|
|
28
|
+
Most callers can start by changing imports from `@tanstack/db` to `arrowbase`.
|
|
29
|
+
Collection construction also needs an ArrowBase schema and explicit `capacity` so
|
|
30
|
+
rows can be stored in fixed column buffers. See [MIGRATING.md](./MIGRATING.md)
|
|
31
|
+
for side-by-side snippets and pitfalls.
|
|
32
|
+
|
|
33
|
+
Documented tolerances:
|
|
34
|
+
|
|
35
|
+
- BigInt/Number join keys normalize only in the safe integer range.
|
|
36
|
+
- Floating-point aggregate comparisons should use numeric tolerance.
|
|
37
|
+
- ArrowBase is fixed-capacity; choose capacity headroom per collection.
|
|
38
|
+
|
|
39
|
+
## Benchmarks
|
|
40
|
+
|
|
41
|
+
Run:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
pnpm bench
|
|
45
|
+
pnpm bench:vs-tanstack
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`pnpm bench` remains the regression guard for ArrowBase hot paths.
|
|
49
|
+
`pnpm bench:vs-tanstack` compares aggregate scan throughput and best-effort
|
|
50
|
+
memory footprint against the installed `@tanstack/db` reference. Latest local
|
|
51
|
+
validation measured aggregate scan at 39.084ms for `@tanstack/db` vs 15.343ms
|
|
52
|
+
for ArrowBase, with ArrowBase at 0.15× the measured memory footprint.
|
|
53
|
+
|
|
54
|
+
## Validation checklist
|
|
55
|
+
|
|
56
|
+
Before tagging:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
pnpm release:verify
|
|
60
|
+
pnpm check
|
|
61
|
+
pnpm playground:check
|
|
62
|
+
pnpm playground:e2e
|
|
63
|
+
pnpm build
|
|
64
|
+
pnpm verify:package-exports
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If any gate fails, do not tag. Fix the gap, regenerate `COMPATIBILITY.md` if the
|
|
68
|
+
surface changed, then rerun the full ritual.
|
package/dist/arrow.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as Arrow from 'apache-arrow';
|
|
2
|
+
import { C as Collection } from './collection-DGlKgOGi.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Apache Arrow IPC export/import adapter.
|
|
6
|
+
*
|
|
7
|
+
* Optional subpath (`arrowbase/arrow`). `apache-arrow` is an optional
|
|
8
|
+
* peerDep — install it separately if you need IPC interop:
|
|
9
|
+
*
|
|
10
|
+
* pnpm add apache-arrow
|
|
11
|
+
*
|
|
12
|
+
* This module converts between an ArrowBase {@link Collection} and an
|
|
13
|
+
* Arrow IPC byte stream (or file). ArrowBase owns its own in-memory
|
|
14
|
+
* layout (ranged offsets, SAB-backed), which is deliberately not
|
|
15
|
+
* byte-compatible with Arrow's dense offsets format. Export here
|
|
16
|
+
* therefore materializes rows and rebuilds an Arrow Table via
|
|
17
|
+
* `apache-arrow`'s builders — correct and simple, not zero-copy.
|
|
18
|
+
*
|
|
19
|
+
* ### Type mapping
|
|
20
|
+
*
|
|
21
|
+
* | ArrowBase | arrow-js |
|
|
22
|
+
* |----------------------|------------------------------|
|
|
23
|
+
* | bool | Bool |
|
|
24
|
+
* | int8/16/32 | Int8/16/32 |
|
|
25
|
+
* | int64 | Int64 (BigInt64) |
|
|
26
|
+
* | uint8/16/32 | Uint8/16/32 |
|
|
27
|
+
* | uint64 | Uint64 (BigUint64) |
|
|
28
|
+
* | float32/64 | Float32/Float64 |
|
|
29
|
+
* | utf8 | Utf8 |
|
|
30
|
+
* | dict_utf8 | Dictionary<Int32, Utf8> |
|
|
31
|
+
* | binary | Binary |
|
|
32
|
+
* | list<T> | List<map(T)> |
|
|
33
|
+
* | struct<fields> | Struct<map(fields)> |
|
|
34
|
+
*
|
|
35
|
+
* ### Internal columns
|
|
36
|
+
*
|
|
37
|
+
* By default `__deleted` is stripped on export (soft-deleted rows are
|
|
38
|
+
* also removed from the output) and `__id` is preserved as a plain
|
|
39
|
+
* uint32. Pass `{ includeInternalColumns: true }` to keep `__deleted`.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
interface ExportArrowOptions {
|
|
43
|
+
/**
|
|
44
|
+
* 'stream' (default) produces the Arrow IPC stream format
|
|
45
|
+
* (schema + record batches). 'file' wraps it in the random-access
|
|
46
|
+
* file format with a footer.
|
|
47
|
+
*/
|
|
48
|
+
format?: 'stream' | 'file';
|
|
49
|
+
/**
|
|
50
|
+
* If false (default), soft-deleted rows are skipped and `__deleted`
|
|
51
|
+
* is omitted from the Arrow schema. If true, all rows are exported
|
|
52
|
+
* and `__deleted` is included as a bool column.
|
|
53
|
+
*/
|
|
54
|
+
includeInternalColumns?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Dynamically resolved apache-arrow module (for callers that must
|
|
57
|
+
* control module loading, e.g., ESM + bundler edge cases). Most
|
|
58
|
+
* callers should leave this undefined — we will import lazily.
|
|
59
|
+
*/
|
|
60
|
+
arrow?: typeof Arrow;
|
|
61
|
+
}
|
|
62
|
+
interface ImportArrowOptions {
|
|
63
|
+
/**
|
|
64
|
+
* Row capacity to allocate for the rehydrated collection.
|
|
65
|
+
* Defaults to the Arrow Table's `numRows`.
|
|
66
|
+
*/
|
|
67
|
+
capacity?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Override the schema name. Defaults to `'arrow'`.
|
|
70
|
+
*/
|
|
71
|
+
name?: string;
|
|
72
|
+
/** See {@link ExportArrowOptions.arrow}. */
|
|
73
|
+
arrow?: typeof Arrow;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Export a collection as Arrow IPC bytes. Returns a `Uint8Array`; copy
|
|
77
|
+
* `.buffer` if you need an `ArrayBuffer`.
|
|
78
|
+
*/
|
|
79
|
+
declare function exportArrowIPC(collection: Collection, options?: ExportArrowOptions): Promise<Uint8Array>;
|
|
80
|
+
/**
|
|
81
|
+
* Rebuild a collection from Arrow IPC bytes. The Arrow schema is
|
|
82
|
+
* translated into an ArrowBase schema; types that have no ArrowBase
|
|
83
|
+
* equivalent (e.g., Timestamp, Decimal) will throw.
|
|
84
|
+
*/
|
|
85
|
+
declare function importArrowIPC(buf: Uint8Array | ArrayBuffer, options?: ImportArrowOptions): Promise<Collection>;
|
|
86
|
+
/**
|
|
87
|
+
* Build an Arrow `Table` from a collection without serializing it.
|
|
88
|
+
* Exposed for users who want to stream multiple collections into the
|
|
89
|
+
* same IPC writer, or who want to cross-check column-level data.
|
|
90
|
+
*/
|
|
91
|
+
declare function exportArrowTable(collection: Collection, options?: ExportArrowOptions): Promise<Arrow.Table>;
|
|
92
|
+
|
|
93
|
+
export { type ExportArrowOptions, type ImportArrowOptions, exportArrowIPC, exportArrowTable, importArrowIPC };
|