feat: complete ORM query builder and model-driven workflows#311
Merged
feat: complete ORM query builder and model-driven workflows#311
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.
What problem does this PR solve?
KiteSQL already had the first piece of ORM support, but it still could not cover most of KiteSQL's query and maintenance capabilities through a consistent high-level API.
This PR completes that layer so model-driven workflows can stay inside the ORM for projections, joins, subqueries, set queries, mutations, introspection, and related documentation/tests, instead of falling back to raw SQL or exposed AST details.
Issue link:
What is changed and how it works?
ORM query builder
sqlparserAST while keeping AST details hidden from end usersCASE, aliased values,DISTINCT, and richer subquery predicatesgroup_by,having, tuple/value projections, and DTO projections via#[derive(Projection)]USING, cross joins, and join-aware struct projectionsQueryOperandand supportUNION/EXCEPTwith result-level ordering, limits,count,exists,get, andexplainORM mutations and maintenance
from::<M>()...update()/delete()INSERT ... SELECTsupport and ORM-side insert/overwrite builders at the end of query chainsinsert_many,truncate,create_view,create_or_replace_view,drop_view,show_tables,show_views,describe, andexplainFixes, docs, and tests
INsubqueries, set-query binding/top-level ordering, andEXCEPT DISTINCT/EXCEPT ALLsemanticsCode changes
Check List
Tests
Side effects
Note for reviewer
This PR is large because it carries the whole ORM completion pass on top of the initial model-driven ORM groundwork. The main thread is: finish the ORM around the existing KiteSQL capability surface, keep AST details internal, and add enough tests/docs to make the new builder flow stable and understandable.