Releases: mabulu-inc/simplicity-db
Releases · mabulu-inc/simplicity-db
Release list
Release 4.3.0
Added
- Optional
ON CONFLICT DO NOTHINGrace backstop inupsertMutation.
Pass{ onConflict: 'DO NOTHING' }to appendON CONFLICT DO NOTHING
to the generated INSERT (default: omitted, so existing output is
unchanged). This is a complement to the always-present
WHERE NOT EXISTS, not a replacement:WHERE NOT EXISTSstill prevents
serial/bigserial sequence churn, whileON CONFLICT DO NOTHINGcloses
the concurrency race where two writers both pass the not-exists check
and then collide on the unique constraint. It only affects theinsert
half.
Changed
- Generated SQL now uses uppercase keywords (
SELECT,INSERT INTO,
WHERE NOT EXISTS,IS DISTINCT FROM, …) acrossupdateMutationand
upsertMutation. Purely cosmetic — the statements are semantically
identical — but any test or snapshot asserting on the old lowercase
output needs updating.
Release 4.2.0
What's Changed
- fix: resolveDatabaseUrl drops silent 'postgres' dbname fallback by @SamMaxwell in #16
Full Changelog: v4.1.0...v4.2.0
Release 4.1.0
What's Changed
- feat: derived & input-only columns in the upsert generator by @SamMaxwell in #14
Full Changelog: v4.0.0...v4.1.0
Release 4.0.0
What's Changed
- feat: scalar params for upsertMutation + copy-free classifyPgError by @SamMaxwell in #12
Full Changelog: v3.1.0...v4.0.0
Release 3.1.0
What's Changed
- ci: refuse to publish when tag isn't on main by @SamMaxwell in #2
- feat: pool options, secret resolution, withTransaction, bulk upserts, typed pg-error classification by @SamMaxwell in #7
- docs: Astro Starlight docs-site on GitHub Pages by @SamMaxwell in #9
New Contributors
- @SamMaxwell made their first contribution in #2
Full Changelog: v3.0.0...v3.1.0
v3.0.0 — TypeScript port
TypeScript port of v2.x. No API changes — same default connect export, same withClient, updateMutation, and friendlyError. Consumers upgrade by swapping @mabulu-inc/db → @smplcty/db.
What changed
- Source is now TypeScript (
src/*.ts), compiled todist/viatsc. Type declarations ship in the package. pgis now a peer dependency (was a direct dep). Installpgin the consuming service.- No more
dotenv. Load.envat the edge of your application, not inside a library. - Tests migrated to vitest — unit tests for
updateMutationandfriendlyError, integration tests against a real Postgres (docker-compose locally, service container in CI) forwithClientandfriendlyErrorround-tripping real pg error codes. withClientis now generically typed —withClient<T>(pool, fn)infersTfrom the callback's return type.updateMutationexports aFieldSpectuple type so consumers get type-checked fieldsets.friendlyErrorexportsPgErrorLike,ERROR_CODES, andMESSAGESso consumers can extend or override the mapping.- CI and publish workflows matching the fleet baseline: lint, typecheck, gitleaks full-history scan, build, tests against a Postgres service container, OIDC trusted publishing with provenance, and a non-blocking
pnpm outdatedadvisory.
Scope
@smplcty/db stays a thin pg helper. It does not know about sessions, roles, RLS, or GUCs — that layering lives in @smplcty/auth via withSession. Use withClient for background jobs and migrations; use withSession for anything that talks to tenant data.
Migration
pnpm remove @mabulu-inc/db && pnpm add @smplcty/db- Ensure
pgis a direct dependency of your service (was previously transitive). - If you were relying on the package to load
.env, switch tonode --env-file=.envor loaddotenvexplicitly at your entry point. - Update imports from
@mabulu-inc/dbto@smplcty/db.