picovolt 1.7.0 → 1.7.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/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # PicoVolt (PVDB)
2
2
 
3
3
  [![CI](https://github.com/MiniJe/picovolt/actions/workflows/ci.yml/badge.svg)](https://github.com/MiniJe/picovolt/actions/workflows/ci.yml)
4
- [![Version](https://img.shields.io/badge/version-1.7.0-blue.svg)](CHANGELOG.md)
4
+ [![crates.io](https://img.shields.io/crates/v/picovolt.svg)](https://crates.io/crates/picovolt)
5
5
  [![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
6
- ![Status: 1.0 stable](https://img.shields.io/badge/status-1.0%20stable-brightgreen.svg)
6
+ ![Status: stable 1.x](https://img.shields.io/badge/status-stable%201.x-brightgreen.svg)
7
7
  [![GitHub stars](https://img.shields.io/github/stars/MiniJe/picovolt?style=social)](https://github.com/MiniJe/picovolt)
8
8
 
9
- PicoVolt is an embedded database engine written from scratch in Rust. As of 1.0
10
- its public API and on-disk format are stable under Semantic Versioning. It is
11
- young software and has not had an external security audit, so review it and keep
12
- backups before trusting it with data you cannot regenerate.
9
+ PicoVolt is an embedded database engine written in Rust. Its 1.x public API and
10
+ on-disk format are stable under Semantic Versioning. It is young software and
11
+ has not had an external security audit, so review it and keep backups before
12
+ trusting it with data you cannot regenerate.
13
13
 
14
14
  If PicoVolt is useful to you, consider starring the repository on GitHub. It is
15
15
  the simplest way to help others discover the project.
@@ -18,26 +18,20 @@ The engine decouples query logic from storage representation through a
18
18
  Virtualization Layer Engine (VLE) that shifts between two on-disk shapes:
19
19
 
20
20
  - **Development mode:** a `.pv/` workspace of mutable, append-only chunk files
21
- plus a content-addressed blob store, friendly to git and code review.
21
+ plus a content-addressed blob store and inspectable manifest.
22
22
  - **Production mode:** a single contiguous, memory-mappable `.pvdb` file produced
23
23
  by `pv_bake()`.
24
24
 
25
- Pages are chameleon. Hot data lands in a slotted row layout for O(1) appends, and
26
- idle pages can be transposed into a packed columnar layout for compression and
27
- cache efficiency.
25
+ New records use a slotted row layout for O(1) appends. Idle pages can be
26
+ transposed into a packed columnar layout for compression and cache efficiency.
28
27
 
29
28
  ## Status
30
29
 
31
- The engine is built out across four phases, all implemented, with over 180 unit and
32
- integration tests plus doctests passing and a clean `cargo clippy -D warnings` on
33
- Linux and Windows. Changes are tracked in [CHANGELOG.md](CHANGELOG.md).
34
-
35
- | Phase | Scope | Status |
36
- |-------|-------|--------|
37
- | 1 | Core memory layouts and error taxonomy | Done |
38
- | 2 | Page engine, CAS dedup, compression, VLE router | Done |
39
- | 3 | MVCC and snapshot isolation, WASM runtime | Done |
40
- | 4 | Public surface (`pv_open_dev` / `pv_open_prod` / `query` / `pv_bake`) | Done |
30
+ The current stable release is exercised by a 240+ test Rust suite plus doctests
31
+ and maintained-binding integration tests. CI also enforces formatting and
32
+ warning-free Clippy builds on Linux and Windows. Shipped changes are tracked in
33
+ [CHANGELOG.md](CHANGELOG.md), and the remaining work toward 2.0 is tracked in
34
+ [ROADMAP.md](ROADMAP.md).
41
35
 
42
36
  ### Module map
43
37
 
@@ -50,7 +44,7 @@ Linux and Windows. Changes are tracked in [CHANGELOG.md](CHANGELOG.md).
50
44
  | [`storage/cache.rs`](src/storage/cache.rs) | bounded LRU buffer pool (enables larger-than-RAM reads) |
51
45
  | [`storage/cas.rs`](src/storage/cas.rs) | BLAKE3 content-addressable dedup (memory, dev-files, mmap) |
52
46
  | [`storage/compress.rs`](src/storage/compress.rs) | Delta-Z, LEB128 varints, dictionary bit-packing |
53
- | [`storage/index.rs`](src/storage/index.rs) | in-memory ordered secondary index (value to record addresses; point and range) |
47
+ | [`storage/index.rs`](src/storage/index.rs) | ordered secondary-index query structure and its persisted value/address encoding (point and range) |
54
48
  | [`storage/record.rs`](src/storage/record.rs) | row and record-body serialization with CAS interception |
55
49
  | [`storage/vle.rs`](src/storage/vle.rs) | dev directory store, owned prod snapshot, streamed reads, `bake` |
56
50
  | [`engine/mvcc.rs`](src/engine/mvcc.rs) | transaction clock and snapshot visibility |
@@ -123,12 +117,13 @@ Rust, Python, Go, Node, and browser projects are in [`starters/`](starters/READM
123
117
  are catalogued in [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md).
124
118
 
125
119
  SQL supports the normal PicoVolt CRUD and schema statements plus projection,
126
- filters, aggregates, grouping, time travel, ordering, and pagination. The 1.7
127
- query surface adds `AS`/bare table aliases, N-table equality `INNER`/`LEFT`
128
- joins, searched `CASE WHEN`, and the focused `LOWER`, `UPPER`, `TRIM`, `LENGTH`,
129
- `ABS`, `COALESCE`, and `NULLIF` scalar functions. Schema-light types, literal
130
- defaults, named inserts, and persisted `CHECK` constraints cover common adapter
131
- DDL. See the precise syntax, examples, type behavior, and deliberate limits in
120
+ filters, aggregates, grouping, time travel, ordering, and pagination. The
121
+ current query surface includes `AS`/bare table aliases, N-table equality
122
+ `INNER`/`LEFT` joins, searched `CASE WHEN`, and the focused `LOWER`, `UPPER`,
123
+ `TRIM`, `LENGTH`, `ABS`, `COALESCE`, and `NULLIF` scalar functions. Schema-light
124
+ types, literal defaults, named inserts, and persisted `CHECK` constraints cover
125
+ common adapter DDL. See the precise syntax, examples, type behavior, and
126
+ deliberate limits in
132
127
  [`docs/SQL.md`](docs/SQL.md). Rust callers can cache `Database::prepare(...)`
133
128
  templates; C, WebAssembly, JavaScript, Python, and Go expose the same reusable
134
129
  prepared-statement lifecycle. Callers can use explicit transactions or atomic
@@ -138,10 +133,10 @@ Durability is selectable via `Database::set_durability` (`Fast` OS-cache default
138
133
  or crash-safe `Sync` with fsync and an atomic manifest).
139
134
 
140
135
  Measured results and the methodology are in [BENCHMARKS.md](BENCHMARKS.md). In
141
- short, PicoVolt is a page-backed engine with O(1) durable appends (autocommit
136
+ short, PicoVolt is a page-backed engine with O(1) filesystem appends (autocommit
142
137
  around 33k rows/s, linear), larger-than-RAM reads through a bounded buffer pool (a
143
138
  667-page dataset serves from a 16-page pool), ordered secondary indexes (point
144
- lookups roughly 11,000 times faster than a scan, plus range predicates), MVCC
139
+ lookups roughly 6,100 times faster than a scan, plus range predicates), MVCC
145
140
  time-travel, opt-in crash-safe durability (`Durability::Sync`), and a fast
146
141
  compile-and-publish path (CAS dedup, columnar compression, memory-mappable
147
142
  single-file artifacts). Current limits include full-workspace transaction
@@ -155,7 +150,8 @@ general SQL planner, and no concurrent writers.
155
150
  | **Rust** (crates.io) | `cargo add picovolt` |
156
151
  | **JavaScript / npm** (WebAssembly, browser and Node) | `npm install picovolt` |
157
152
  | **Python** (native wheels) | `python -m pip install picovolt` |
158
- | **C / Go** (native, via the C ABI) | `cargo build --release --features capi`, then see [`bindings/`](bindings) |
153
+ | **Go** (`database/sql` and direct API) | `go get github.com/MiniJe/picovolt/bindings/go@latest`, then provide the matching native C ABI library described in [`bindings/go/`](bindings/go) |
154
+ | **C** | Download the matching `picovolt-capi-*` bundle from the [latest release](https://github.com/MiniJe/picovolt/releases/latest), or run `cargo build --release --features capi` |
159
155
  | **In-memory** (native, no filesystem) | `Database::open_memory()`, export with `bake_to_bytes()` |
160
156
 
161
157
  PicoVolt runs in the browser through its in-memory backend plus an OPFS persistence
@@ -172,13 +168,14 @@ binding. The bindings suit embedded use, not a concurrent server's primary store
172
168
 
173
169
  All bindings accept positional `?` parameters
174
170
  (`db.query("... WHERE id = ?", [1])`), bound as safely-escaped SQL literals. For
175
- a familiar surface, drop-in adapters are provided: a `better-sqlite3`-style
176
- JavaScript API (`import Database from "picovolt/sqlite"`), a Python DB-API 2.0
177
- module (`import picovolt.dbapi2 as sqlite`), and the Go `database/sql` driver
178
- ([`bindings/go/pvsql`](bindings/go/pvsql)). Shared limits include positional `?`
179
- only and the intentionally compact SQL grammar; JavaScript and in-memory Rust
180
- also expose rollback-capable transaction wrappers. Native bindings expose the
181
- same transaction lifecycle through the C ABI.
171
+ a familiar surface, PicoVolt provides a `better-sqlite3`-inspired JavaScript API
172
+ (`import Database from "picovolt/sqlite"`), a Python DB-API 2.0 module
173
+ (`import picovolt.dbapi2 as sqlite`), and a Go `database/sql` driver
174
+ ([`bindings/go/pvsql`](bindings/go/pvsql)). These are interface adapters, not
175
+ drop-in compatibility layers: shared limits include positional `?` only and the
176
+ intentionally compact SQL grammar. JavaScript and in-memory Rust also expose
177
+ rollback-capable transaction wrappers. Native bindings expose the same
178
+ transaction lifecycle through the C ABI.
182
179
 
183
180
  ## Server mode
184
181
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "picovolt",
3
3
  "type": "module",
4
- "description": "PicoVolt (PVDB): a polymorphic embedded database engine in Rust.",
5
- "version": "1.7.0",
4
+ "description": "Embedded SQL database with MVCC history and single-file deployment",
5
+ "version": "1.7.1",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/MiniJe/picovolt"
9
+ "url": "git+https://github.com/MiniJe/picovolt.git"
10
10
  },
11
11
  "files": [
12
12
  "picovolt_bg.wasm",
@@ -18,6 +18,7 @@
18
18
  "worker.js"
19
19
  ],
20
20
  "main": "picovolt.js",
21
+ "homepage": "https://github.com/MiniJe/picovolt",
21
22
  "types": "picovolt.d.ts",
22
23
  "sideEffects": [
23
24
  "./picovolt.js",
package/picovolt_bg.wasm CHANGED
Binary file
package/sqlite.js CHANGED
@@ -1,5 +1,6 @@
1
- // A better-sqlite3-style synchronous API over PicoVolt's WebAssembly engine, so
2
- // code written for better-sqlite3 can use PicoVolt with minimal change:
1
+ // A better-sqlite3-inspired synchronous API over PicoVolt's WebAssembly engine.
2
+ // It follows the familiar prepare/run/get/all shape while retaining PicoVolt's
3
+ // focused SQL surface:
3
4
  //
4
5
  // import Database from "picovolt/sqlite";
5
6
  // const db = new Database();