Conversation
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.
Add
sqlite.query()— typed object array returnssqlite.all()returnsstring[]where multi-column rows are pipe-delimited ("1|Alice|NYC"), requiring.split("|")and positional indexing.sqlite.query()returns typed object arrays instead, enabling direct field access:How it works
@__sqlite_row_to_structconverts each row into a flat struct ofi8*fields (one strdup'd column per field), replacing the pipe-delimited string builder@__sqlite_queryand@__sqlite_query_paramsmirror the existing@__sqlite_all/@__sqlite_all_paramshelpers but return%ObjectArray*instead of%StringArray*declaredTypefallback handles thePost[]→ interface metadata wiring automatically — no generics neededChanges
src/codegen/stdlib/sqlite.tsgenerateQuery(), 3 new IR helpers,canHandle()updatedsrc/codegen/expressions/method-calls.ts"query"dispatch casesrc/codegen/infrastructure/generator-context.tsISqliteGeneratorinterface + mocksrc/codegen/llvm-generator.tstests/fixtures/builtins/sqlite-query.ts.claude/rules.md@testauto-discovery, C bridges, stale compiler, worktree setupTest plan
npm run build— TypeScript compiles cleannpm test— 199/199 tests pass (including new sqlite-query fixture)