Skip to content

feat: support string query functions#29

Merged
dodok8 merged 4 commits into
mainfrom
issue-17-string-functions
Jul 7, 2026
Merged

feat: support string query functions#29
dodok8 merged 4 commits into
mainfrom
issue-17-string-functions

Conversation

@dodok8

@dodok8 dodok8 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add initial query-language support for built-in string value functions.

Closes #17

Scope

  • Documented the MVP string function contract for concat(...) and str(expr).
  • Added parser coverage for variadic concat and str function-call syntax preservation.
  • Added StringFunctionExpr to Semantic IR with argument scalar type and cardinality metadata.
  • Resolved concat(...) and str(expr) with resolver-level arity, type, null, and many-cardinality checks.
  • Lowered resolved string functions into SQLite query plans without exposing SQLite operators in query syntax.
  • Rendered concat as SQLite || and str(bool) as a null-aware CASE expression returning true/false text.
  • Added query-pipeline render and execution coverage for string functions.

Spec and plan alignment

List the spec/ and plan/ files checked for this change. If the change
intentionally diverges from them, explain why and include the required document
update in this pull request.

  • spec/query.md
  • spec/ir.md
  • spec/sqlite-query-plan.md
  • plan/query-expression-model-plan.md
  • No intentional divergence. The spec updates are included in this pull request.

Tests

List the automated and manual checks performed.

  • cargo test --workspace
  • Other: targeted crate tests were run during TDD for query-parser, query-ir, query-resolver, sqlite-query-plan, sqlite-query-sqlgen, and query-pipeline-tests.

Review notes

Call out API boundaries, temporary rules, migration concerns, or follow-up work
that reviewers should inspect closely.

  • concat(...) is variadic but requires at least two str arguments.
  • str(expr) is explicit and does not introduce implicit string casts for comparisons, membership checks, arithmetic, or concatenation.
  • str(bool) intentionally renders true/false text through SQLite CASE instead of relying on SQLite CAST, which would expose 1/0 text behavior.
  • Other string helpers such as length, lower, upper, trim, replace, substr, and predicate helpers remain deferred.

AI assistance

Disclose AI tool usage according to AI_POLICY.md.

  • No AI tools were used.
  • AI tools were used and are disclosed here and in the relevant commit
    messages with Assisted-by trailers.

Tools and models:

  • Codex:gpt-5.5

dodok8 added 2 commits July 3, 2026 14:55
Assisted-by: Codex:gpt-5.5
Assisted-by: Codex:gpt-5.5
@dodok8 dodok8 marked this pull request as ready for review July 3, 2026 06:13
@dodok8

dodok8 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 65824e07db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@dodok8 dodok8 merged commit 17fda88 into main Jul 7, 2026
2 checks passed
@dodok8 dodok8 deleted the issue-17-string-functions branch July 7, 2026 04:38
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.

feat: support string manipulation functions in queries

1 participant