Repository navigation
Conversation
trueqbit
force-pushed
the
refactor/operators-under-ast
branch
from
September 28, 2026 17:00
7732cd7 to
70022e6
Compare
trueqbit
force-pushed
the
refactor/lift-alias-and-quoting-traits
branch
3 times, most recently
from
September 28, 2026 17:14
e07344d to
0d8f0c5
Compare
The alias traits and those of the table reference, table-valued expression and literal were declared and defined in their own headers, alias_holder and alias_column_t had no trait at all, and the consumers pattern-matched them along with column_pointer. - alias.h, column_pointer.h, literal.h and table_reference.h move to ast/. - `is_alias`, `is_column_alias`, `is_recordset_alias`, `is_table_alias`, `is_cte_moniker` and `is_table_valued_expression` are declared in grammar_traits_fwd.h, `is_literal` and `is_table_reference` in structural_traits_fwd.h; the alias traits stay defined next to `alias_tag`, since aliases are user-definable. - New grammar traits `is_alias_holder` and `is_alias_column`. - node_tuple, column_result_t, statement_serializer, the CTE storage, the table name and CTE column name collectors, `materialize_column_pointer()` and `find_column_name()`, the multi ORDER BY streaming and `unpacked_arg` match by trait. The column pointer referring to a CTE column alias is told apart by its `field_type`, no longer by a partial specialization refining the one for column pointers. - Fix: the type trait `is_column_alias` derived from `is_alias`, and thus held for record set aliases too, unlike `is_column_alias_v`. Co-Authored-By: Claude Opus 5.5
trueqbit
force-pushed
the
refactor/lift-alias-and-quoting-traits
branch
from
September 28, 2026 17:32
0d8f0c5 to
ec16f4e
Compare
…and-quoting-traits Co-Authored-By: Claude Opus 5.5
The serializer was the last consumer still matching `literal_holder` by its template; it now goes by `is_literal` like the other consumers. Co-Authored-By: Claude Opus 5
`is_rtree_table_element_or_constraint_v` is an admissibility composite over `is_column`, like the base and FTS5 table checks; it now lives as an alias beside them in `vocabulary/algorithms/ddl_predicates.h`. That leaves nothing of the open-work item about schema-level traits: `is_dbo_name_literal_v` recognizes a reflection annotation that is read out and filtered away while a table or view definition is built, and never becomes a node, so it stays with the code consuming it. The guidance on which `is_*_v` belong in the layer moves to "Deciding where something goes", without the removed `is_builtin_window_function_v`. Co-Authored-By: Claude Opus 5
…and-quoting-traits Resolved: - This branch moved alias.h, column_pointer.h, literal.h and table_reference.h into ast/, while dev moved the vtabs/ headers and the schema table into builtin/dbos/ and split core_functions.h into builtin/functions/. Includes of the four headers take dev's location of the including file and this branch's location of the included one - in builtin/dbos/, builtin/functions/core.h and the ast/ headers. - core_functions.h, whose includes this branch adjusted, is gone on dev. - column_expression.h includes ast/alias.h and, for schema_mapped_column_field_expressions, schema/algorithms/table_lookup.h. - The vocabulary doc's open-work section loses both the trait lift, done here, and storage_traits.h, done on dev. Co-Authored-By: Claude Opus 5.5
…and-quoting-traits The merged branches bring dev's move of the statement serializer and its helpers into serialization/ (#1562). Resolved: - serializing_util.h, statement_serializer.h and table_name_collector.h take their paths relative to serialization/, and include alias.h, column_pointer.h, literal.h and table_reference.h from ast/, where this branch moved them. - cte_column_names_collector.h, which this branch adjusted at its old place, was rewritten and moved by #1562: its new version includes ast/alias.h and tests is_alias_holder_v, like this branch's. Co-Authored-By: Claude Opus 5.5
…and-quoting-traits Co-Authored-By: Claude Opus 5.5
…and-quoting-traits Co-Authored-By: Claude Opus 5.5
…and-quoting-traits # Conflicts: # dev/ast_iterator.h # include/sqlite_orm/sqlite_orm.h
…and-quoting-traits
…and-quoting-traits
This branch has not been deployed
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.
Stacked on #1552.
Summary
The open-work item "lift the remaining traits into the vocabulary layer" of
docs/internals/vocabulary-layer.md, for everything belowast/: the alias traits and those of table references, table-valued expressions and literals were declared and defined in their own headers,alias_holderandalias_column_thad no trait, and consumers pattern-matched them - along withcolumn_pointer.alias.h,column_pointer.h,literal.handtable_reference.hmove todev/ast/.grammar_traits_fwd.h(new "Alias traits" section):is_alias,is_column_alias,is_recordset_alias,is_table_alias,is_cte_moniker,is_table_valued_expression, and the newis_alias_holderandis_alias_column. Declared instructural_traits_fwd.h(quoting):is_literal,is_table_reference. The alias traits stay defined inalias_traits.hnext toalias_tag, since aliases are user-definable rather than sqlite_orm nodes; the others are defined right after their nodes.node_tuple(column alias and alias holder in one, table-valued expression),column_result_t(alias column, column pointer),statement_serializer(alias holder, column alias, alias column),ast_iterator,cte_storage.h,cte_column_names_collector.h,table_name_collector.h,storage_impl.h(materialize_column_pointer(),find_column_name()), the multi ORDER BY streaming inserializing_util.h, andunpacked_arginast/app_function.h.column_pointer<T, F>(incolumn_result_t, and as overloads instorage_impl.h) - which is why they matched the template rather than a trait. They are now told apart by the column pointer'sfield_typebeing an alias holder.is_column_aliasderived fromis_alias, and thus held for record set aliases as well, unlikeis_column_alias_v. It now agrees with the variable template - which affectsas<A>(), explicit CTE columns and theast_iteratorskipping aliases, none of which is meant to see a record set alias.is_*_vbelongs in the traits layer:is_rtree_table_element_or_constraintis an admissibility composite and moves beside its base and FTS5 siblings invocabulary/algorithms/ddl_predicates.h, andis_dbo_name_literal_vrecognizes a reflection annotation that never becomes a node, so it stays inschema/dbo_name.h. The guidance on whichis_*_vqualify moves to "Deciding where something goes".Test plan
tests/static_tests/expression_classification.cpp: new "aliases and quoting" section - the alias traits includingis_column_aliasagainst a record set alias,is_alias_holder,is_alias_column,is_literal,is_table_reference,is_table_valued_expression, and the node tuples of a column alias and an alias holder.🤖 Generated with Claude Code