@nshiab/simple-data-analysis-core 2.0.0 → 2.0.2
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 +0 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,48 +60,6 @@ npx @nshiab/setup-data-project
|
|
|
60
60
|
bunx @nshiab/setup-data-project
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
## Database files in version 2
|
|
64
|
-
|
|
65
|
-
`new SimpleDB()` works in memory. To work directly in a DuckDB file, pass
|
|
66
|
-
`{ file: "./analysis.duckdb" }`: SDA opens an existing file or creates a new one
|
|
67
|
-
on first use. Await `getTable()` to access a saved table, or `start()` to
|
|
68
|
-
restore all saved table handles before using the synchronous `getTables()`
|
|
69
|
-
method. `{ readOnly: true }` opens an existing file without allowing changes.
|
|
70
|
-
|
|
71
|
-
```ts
|
|
72
|
-
const sdb = new SimpleDB({ file: "./analysis.duckdb" });
|
|
73
|
-
const observations = await sdb.getTable("observations");
|
|
74
|
-
await observations.filter("value IS NOT NULL").log();
|
|
75
|
-
await sdb.close();
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
`loadDB(file)` imports a copy into the current database, including into a
|
|
79
|
-
persistent database. It opens the source read-only, rejects existing table-name
|
|
80
|
-
conflicts, and rolls back failed copies. `writeDB(file)` exports a snapshot
|
|
81
|
-
after executing pending work; subsequent changes still affect the working
|
|
82
|
-
database.
|
|
83
|
-
|
|
84
|
-
When migrating from the previous interface:
|
|
85
|
-
|
|
86
|
-
- Replace `loadDB(file, { detach: false })` with `new SimpleDB({ file })` for
|
|
87
|
-
DuckDB files. The `detach` and `name` import options have been removed. SQLite
|
|
88
|
-
files are supported for import/export, not as the persistent working database.
|
|
89
|
-
- The constructor now opens existing files by default. Explicit
|
|
90
|
-
`overwrite: true` still replaces a file on first use.
|
|
91
|
-
- Existing export destinations require `writeDB(file, { overwrite: true })`.
|
|
92
|
-
Exports finish in a temporary file before publishing the output. Open database
|
|
93
|
-
files attached to that instance, symbolic links, and directories cannot be
|
|
94
|
-
replaced.
|
|
95
|
-
- DuckDB files support both `.db` and `.duckdb` extensions. SDA index
|
|
96
|
-
definitions are stored inside the reserved `__sda` schema. Writable persistent
|
|
97
|
-
databases save metadata on `close()`.
|
|
98
|
-
- SQLite exports contain main-schema tables and views materialized as tables.
|
|
99
|
-
They do not preserve DuckDB schemas, indexes, constraints, or SDA metadata.
|
|
100
|
-
SQLite conversion may lose type information; unsupported conversions fail
|
|
101
|
-
without replacing the destination.
|
|
102
|
-
- `close()` executes pending work, saves metadata, and releases resources. It no
|
|
103
|
-
longer compacts or replaces persistent database files.
|
|
104
|
-
|
|
105
63
|
## Performance benchmarks
|
|
106
64
|
|
|
107
65
|
These benchmarks compare SDA-core with raw DuckDB and popular Python and R
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nshiab/simple-data-analysis-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Lightweight DuckDB-powered TypeScript library for tabular, SQL, CSV, Parquet, and geospatial data analysis on Deno, Node.js, and Bun.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-analysis",
|