tasks: cleanup pass 2026-05-15#119
Merged
Merged
Conversation
commit: |
mmkal
added a commit
that referenced
this pull request
May 16, 2026
## Summary Deepens runtime parameter binding into a driver-neutral Module behind the Adapter seam. - Adds `packages/sqlfu/src/sql-params.ts` for named SQL parameter scanning and driver bind-shape projection. - Moves D1, Durable Objects, Expo SQLite, Turso serverless, sqlite-wasm, and Postgres onto that Module. - Deletes the old sqlite-text named-param helper and the Postgres private `?` to `$N` scanner, so Postgres named params now bind directly to `$1`, `$2`, etc. while preserving dollar-quoted SQL bodies. - Removes the old root export for `rewriteNamedParamsToPositional`; this was adapter plumbing, not product surface. ## Design Choice The `grill-you` pass challenged whether Postgres should keep its private scanner. The decision was to use one extended scanner for binding, including Postgres dollar-quoted strings, because two scanners over the same authored SQL were the source of the architectural wart. ## Checks Passed: - `pnpm --filter sqlfu exec vitest run test/sql-params.test.ts test/adapters/pg.test.ts test/sqlite-text.test.ts` - `pnpm --filter sqlfu exec vitest run test/adapters/d1.test.ts test/adapters/durable-object.test.ts test/adapters/expo-sqlite.test.ts test/adapters/sqlite-wasm.test.ts` - `pnpm --filter sqlfu exec vitest run test/adapters/turso-remote.test.ts test/adapters/turso-database.test.ts` - `pnpm --filter sqlfu typecheck` - `pnpm --filter @sqlfu/ui build` - `pnpm --filter sqlfu exec vitest run test/resolve-sqlfu-ui.test.ts` - `git diff --check` Full `pnpm --filter sqlfu test` still fails `test/import-surface.test.ts` because the existing vendored TypeSQL bundle for `sqlfu/analyze` imports `node:sqlite`. That is outside this PR; the initial full run also needed `@sqlfu/ui` built before `resolve-sqlfu-ui` passed. ## Replacement Compare Branches | Existing PR | Replacement compare | Strategy | | --- | --- | --- | | [#124 `bedtime/2026-05-15-default-db-gitignore`](#124) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-124) | clean merge | | [#123 `bedtime/2026-05-15-pg-docs-followup`](#123) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-123) | clean merge | | [#122 `bedtime/2026-05-15-db-base-directory`](#122) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-122) | clean merge | | [#121 `bedtime/2026-05-15-improve-docs`](#121) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-121) | clean merge | | [#120 `bedtime/2026-05-15-landing-trace`](#120) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-120) | clean merge | | [#119 `bedtime/2026-05-15-cleanup-tasks`](#119) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-119) | clean merge | | [#117 `bedtime/2026-05-14-query-identity-manifest`](#117) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-117) | clean merge | | [#114 `bedtime/2026-05-14-generate-preflight`](#114) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-114) | clean merge | | [#111 `issue-110-sqlite3-parser-schemadiff`](#111) | [comparison](bedtime/2026-05-15-architecture...bedtime/2026-05-15-architecture-pr-111) | clean merge | Replacement checks: all replacement branches passed `git diff --check`; targeted tests/builds are recorded in `tasks/architecture-2026-05-15.md`. <!-- package-size:start --> <details> <summary>Package size — packed 236.8 kB (+259 B, +0.1%)</summary> ## Package size | | main | this PR | Δ | | - | - | - | - | | packed | 236.5 kB | 236.8 kB | +0.1% | | unpacked | 971.5 kB | 974.5 kB | +0.3% | | files | 181 | 183 | +2 | ### `dist/vendor/*.js` bundles | | main | this PR | Δ | | - | - | - | - | | `vendor/sha256.js` | 4.3 kB | 4.3 kB | 0 | | `vendor/sql-formatter/*.js` | 58.3 kB | 58.3 kB | 0 | | `vendor/sqlfu-sqlite-parser/*.js` | 17.2 kB | 17.2 kB | 0 | | `vendor/standard-schema/*.js` | 2.8 kB | 2.8 kB | 0 | | `vendor/typesql/*.js` | 134.6 kB | 134.6 kB | 0 | _Measured with `npm pack --dry-run --json` on `sqlfu` (0.0.3-7 on main vs 0.0.3-7 on this PR)._ </details> <!-- package-size:end --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches SQL parameter rewriting/binding used by multiple runtime adapters (including Postgres), so subtle placeholder-scanning edge cases could change query behavior. Added targeted unit tests for Postgres and the new binder to reduce regression risk. > > **Overview** > Moves SQL placeholder scanning and parameter binding into a new driver-neutral `sql-params.ts`, supporting `?`-style positional, Postgres `$N` placeholders, and sqlite-wasm’s prefixed named binds. > > Updates D1, Durable Objects, Expo SQLite, Turso serverless, sqlite-wasm, and the Postgres adapter to use the shared binder; Postgres drops its custom `?`→`$N` conversion and now binds named params directly while preserving dollar-quoted strings, casts, and JSON `?` operators. > > Removes the adapter-plumbing export `rewriteNamedParamsToPositional` (and its tests) from `sqlite-text.ts`/root `index.ts`, and adds new unit tests covering the shared binder plus Postgres binding behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8780812. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> ## Review Follow-up Independent review found two Postgres scanner gaps after the first push: `:param::type` casts and JSONB `?` / `?|` / `?&` operators. Both are fixed in `8780812` with regression tests in `test/sql-params.test.ts` and `test/adapters/pg.test.ts`. Replacement compare branches were refreshed by merging the updated architecture head and all replacement branches still pass `git diff --check`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Finish the 2026-05-15 cleanup pass for stale task files and local worktrees.
Cleanup result
Removed local worktrees only, preserving branches:
bedtime-2026-05-14-cleanup-tasksbedtime-2026-05-14-improve-docsbedtime-evergreen-2026-05-12typebox-validatorquery-identity-refresh-pr-115query-identity-refresh-pr-116improve-codebase-architecture-2026-05-14-pr-101improve-codebase-architecture-2026-05-14-pr-108Test plan
gh pr list --state all --limit 35 --json number,title,headRefName,baseRefName,state,mergedAt,closedAt,urlfind tasks -maxdepth 1 -type f -name '*.md' -print | sortgit worktree list --porcelaingit status --shortPackage size — packed 236.5 kB (no change)
Package size
dist/vendor/*.jsbundlesvendor/sha256.jsvendor/sql-formatter/*.jsvendor/sqlfu-sqlite-parser/*.jsvendor/standard-schema/*.jsvendor/typesql/*.jsMeasured with
npm pack --dry-run --jsononsqlfu(0.0.3-7 on main vs 0.0.3-7 on this PR).Note
Low Risk
Low risk documentation-only change that updates task tracking notes; no product code or runtime behavior is affected.
Overview
Updates
tasks/cleanup-tasks.mdwith a new 2026-05-15 cleanup pass entry, including an updated status summary, scope/checklist, and implementation notes.Records that PRs
#115/#116remain evergreen (so no task files were moved) and documents removal of eight clean local worktrees while explicitly leaving open/dirty/ambiguous worktrees untouched.Reviewed by Cursor Bugbot for commit f0f37b8. Bugbot is set up for automated code reviews on this repo. Configure here.