Skip to content

fix(server): migration 026 keeps model options as arrays on sqlite 3.54 - #254

Merged
AadiJo merged 1 commit into
mainfrom
migration-026-sqlite-json
Nov 12, 2026
Merged

AadiJo merged 1 commit into
mainfrom
migration-026-sqlite-json

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

CI started failing on 026_CanonicalizeModelSelectionOptions.test.ts once runners picked up Node 24.22.3. That Node bundles SQLite 3.54.1, which no longer carries the JSON subtype out of a scalar subquery. Migration 026 feeds a SELECT json_group_array(...) subquery into json_set, so on the new SQLite it stored options as a quoted string ("[...]") instead of an array. Anyone migrating a legacy database on that Node would get unreadable model selections, not just a red test.

Each of the four subqueries is now wrapped in json(...), which restores the array on both SQLite versions. The other migrations that build JSON in SQL (011, 016, 045, 050, 054) don't pass a subquery's JSON into a JSON function, so they are unaffected.

Proof: on node:sqlite, json_set('{"a":1}','$.o',(select json_group_array(1))) returns {"a":1,"o":[1]} on Node 24.22.1 / SQLite 3.53.4 and {"a":1,"o":"[1]"} on Node 24.22.3 / SQLite 3.54.1. The 026 test failed on 24.22.3 before this change and passes on 24.22.1 and 24.22.3 after. All persistence tests pass on 24.22.3.

Reviewed with sol-loop: 1 round with gpt-6.1-sol on high. Sol verdict: approved


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cadsense Skipped Skipped Nov 12, 2026 4:45am UTC

@AadiJo
AadiJo merged commit 8412f96 into main Nov 12, 2026
8 checks passed
@AadiJo
AadiJo deleted the migration-026-sqlite-json branch November 26, 2026 19:51

This branch was previously deployed

1 inactive deployment
Preview — 3e2ffe62 Deployed Nov 12, 2026 by vercel[bot]
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