Skip to content

Add dart_node_sql_js as a publishable package (sql.js bindings)#60

Merged
MelbourneDeveloper merged 1 commit into
mainfrom
sql_js-release
Jun 7, 2026
Merged

Add dart_node_sql_js as a publishable package (sql.js bindings)#60
MelbourneDeveloper merged 1 commit into
mainfrom
sql_js-release

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Owner

TLDR

Promote dart_node_sql_js from a publish_to: none stub into a full tier-2 publishable package (typed sql.js / SQLite-on-WASM bindings) for the 0.13.0-beta release.

What Was Added?

  • packages/dart_node_sql_js as a real publishable package: README.md, CHANGELOG.md (## 0.13.0-beta), LICENSE, analysis_options.yaml (austerity), dart_test.yaml, package.json (sql.js ^1.14.1).
  • 32 integration tests in test/database_test.dart covering open/prepare/exec/run/get/all/save/close/pragma, data types, transactions and constraints — 100% line coverage (71/71).
  • Wiring: tools/lib/packages.dart (tier 2, node), tools/test.sh (NODE_PACKAGES + TIER2), coverage-thresholds.json (dart_node_sql_js: 100.0), publish-tier1.yml changelog validation, publish-tier2.yml publish list, release skill.

What Was Changed or Deleted?

  • Rewrote lib/src/database.dart and lib/src/statement.dart to use typed dart:js_interop extension types instead of nullable as casts, so the package passes dart analyze under austerity.
  • Bug fix: sql.js export() frees every live prepared statement, so the previous "auto-save after each write" design broke prepared-statement reuse (Statement closed) and rolled-back transactions silently committed. Persistence now happens on close() / explicit save() only. Added save() to the Database API. Removed publish_to: none; set version 0.13.0-beta.

How Do The Automated Tests Prove It Works?

  • Statement.run inserts multiple rows with incrementing rowid, updates rows and returns changes count, deletes rows and returns changes count — these failed before the fix (only the first write survived because export() closed the reused statement) and pass now.
  • Transactions rolls back transaction asserts the balance is restored to 100 — previously reported 200 because the mid-transaction export persisted uncommitted state.
  • save persists changes that survive reopen and loads an existing database file prove the new persistence model round-trips to disk.
  • openDatabase returns error when the path cannot be read and Database.close returns error when the save target directory is missing cover the Result error paths. Full suite: 32/32 passing, 100% coverage (enforced by the ratchet in tools/test.sh).

Spec / Doc Changes

  • New package README.md documents the async initializeSqlJs() + save/close persistence model. Release skill (SKILL.md) tier-2 lists updated to include dart_node_sql_js.

Breaking Changes

  • None (new package; first publish at 0.13.0-beta)

Promote dart_node_sql_js from a publish_to:none stub to a full tier-2
publishable package for the 0.13.0-beta release.

- Rewrite database/statement interop with typed extension types
  (no nullable casts), passing austerity analyze.
- Fix a correctness bug: sql.js export() frees all live prepared
  statements, so the old auto-save-after-every-write broke statement
  reuse and transactions. Persist on close()/save() instead and add an
  explicit save() to the Database API.
- Add 32 integration tests (100% line coverage), README, CHANGELOG,
  LICENSE, analysis_options, dart_test.yaml, package.json.
- Wire into tooling: tools/lib/packages.dart (tier 2, node), test.sh
  (NODE_PACKAGES + TIER2), coverage-thresholds.json (100.0),
  publish-tier1 changelog validation, publish-tier2 publish list,
  release skill.
@MelbourneDeveloper MelbourneDeveloper merged commit 284bc49 into main Jun 7, 2026
4 checks passed
@MelbourneDeveloper MelbourneDeveloper deleted the sql_js-release branch June 7, 2026 09:07
MelbourneDeveloper added a commit that referenced this pull request Jun 9, 2026
## TLDR
Promote `dart_node_sql_js` from a `publish_to: none` stub into a full
tier-2 publishable package (typed sql.js / SQLite-on-WASM bindings) for
the 0.13.0-beta release.

## What Was Added?
- **`packages/dart_node_sql_js`** as a real publishable package:
`README.md`, `CHANGELOG.md` (`## 0.13.0-beta`), `LICENSE`,
`analysis_options.yaml` (austerity), `dart_test.yaml`, `package.json`
(`sql.js ^1.14.1`).
- **32 integration tests** in `test/database_test.dart` covering
open/prepare/exec/run/get/all/save/close/pragma, data types,
transactions and constraints — **100% line coverage** (71/71).
- Wiring: `tools/lib/packages.dart` (tier 2, node), `tools/test.sh`
(`NODE_PACKAGES` + `TIER2`), `coverage-thresholds.json`
(`dart_node_sql_js: 100.0`), `publish-tier1.yml` changelog validation,
`publish-tier2.yml` publish list, release skill.

## What Was Changed or Deleted?
- Rewrote `lib/src/database.dart` and `lib/src/statement.dart` to use
**typed `dart:js_interop` extension types** instead of nullable `as`
casts, so the package passes `dart analyze` under austerity.
- **Bug fix:** sql.js `export()` frees every live prepared statement, so
the previous "auto-save after each write" design broke
prepared-statement reuse (`Statement closed`) and rolled-back
transactions silently committed. Persistence now happens on `close()` /
explicit `save()` only. Added `save()` to the `Database` API. Removed
`publish_to: none`; set version `0.13.0-beta`.

## How Do The Automated Tests Prove It Works?
- `Statement.run inserts multiple rows with incrementing rowid`,
`updates rows and returns changes count`, `deletes rows and returns
changes count` — these **failed before the fix** (only the first write
survived because `export()` closed the reused statement) and pass now.
- `Transactions rolls back transaction` asserts the balance is restored
to 100 — previously reported 200 because the mid-transaction export
persisted uncommitted state.
- `save persists changes that survive reopen` and `loads an existing
database file` prove the new persistence model round-trips to disk.
- `openDatabase returns error when the path cannot be read` and
`Database.close returns error when the save target directory is missing`
cover the `Result` error paths. Full suite: 32/32 passing, 100% coverage
(enforced by the ratchet in `tools/test.sh`).

## Spec / Doc Changes
- New package `README.md` documents the async `initializeSqlJs()` +
`save`/`close` persistence model. Release skill (`SKILL.md`) tier-2
lists updated to include `dart_node_sql_js`.

## Breaking Changes
- [x] None (new package; first publish at 0.13.0-beta)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant