Move storage_impl.h and storage_traits.h into the vocabulary layer's tiers - #1560
Merged
Merged
Conversation
…iers Neither header is about the storage object; both compute over the schema, the tuple of mapped database objects. storage_traits.h: - The per-table computations become the vocabulary algorithms column_field_types_t and column_field_expressions_t, in vocabulary/algorithms/column_field_types.h. - The lookup of the table first is schema-wide: storage_mapped_columns and storage_mapped_column_expressions become schema_mapped_columns and schema_mapped_column_expressions in schema/algorithms/table_lookup.h, out of the storage_traits namespace. - column_field_expression_t, whose only user they were, gives way to the plain projection member_pointer_type_t, so that the vocabulary layer does not depend on schema/column.h. storage_impl.h: - lookup_table_name() is defined in table_lookup.h, where it was already declared. - find_column_name(), materialize_column_pointer() and is_column_unique() move to schema/algorithms/column_lookup.h. - tables_index_sequence, views_index_sequence and foreign_keys_count() move to schema/algorithms/table_filters.h. The vocabulary doc and AGENTS.md describe the new places, and the doc's open-work item for storage_traits.h is done. Co-Authored-By: Claude Opus 5.5
trueqbit
marked this pull request as draft
October 3, 2026 18:53
…orithms schema_mapped_columns and schema_mapped_column_expressions become schema_mapped_column_field_types and schema_mapped_column_field_expressions, matching the column_field_types_t and column_field_expressions_t they apply to the table found for a lookup type. Co-Authored-By: Claude Opus 5.5
…thms Co-Authored-By: Claude Opus 5.5
…thms Co-Authored-By: Claude Opus 5.5
trueqbit
marked this pull request as ready for review
October 4, 2026 07:10
fnc12
approved these changes
Oct 4, 2026
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.
Summary
Neither
storage_impl.hnorstorage_traits.his about the storage object. Both compute over the schema, the tuple of mapped database objects. This PR places their contents by the rules indocs/internals/vocabulary-layer.mdand gives themschema_*names instead ofstorage_*, as planned there.storage_traits::storage_mapped_columns_implcolumn_field_types_t, invocabulary/algorithms/column_field_types.hstorage_traits::storage_mapped_column_expressions_implcolumn_field_expressions_t, same filestorage_traits::storage_mapped_columnsschema_mapped_column_field_types, inschema/algorithms/table_lookup.hstorage_traits::storage_mapped_column_expressionsschema_mapped_column_field_expressions, same filelookup_table_name()(declared intable_lookup.h, defined instorage_impl.h)schema/algorithms/table_lookup.hfind_column_name(),materialize_column_pointer(),is_column_unique()schema/algorithms/column_lookup.htables_index_sequence,views_index_sequence,foreign_keys_count()schema/algorithms/table_filters.hcolumn_field_expression_t(schema/column.h)member_pointer_type_t, invocabulary/projections/nested_types.hcolumn_field_expression_thad only one user, the column expressions computation. Replacing it with a plain projection means the new vocabulary algorithm doesn't depend onschema/column.h.column_result.handcolumn_expression.hnow reachschema/column.hlater in the amalgamation than before, becausestorage_traits.hno longer pulls it in. The column names they and the headers beforecolumn.huse are forward-declared invocabulary/node_fwd.handtraits/grammar_traits_fwd.h.storage_traits.his removed as done.AGENTS.mdno longer listsstorage_impl.h.Test plan
tests/static_tests/select_return_type.cppchecksschema_mapped_column_field_types(formerlystorage_mapped_columns), and adds checks forschema_mapped_column_field_expressionson a mapped and an unmapped type.select(asterisk<T>())and theasteriskcolumn result tests exercise both throughcolumn_result_t/column_expression_type.find_column_nametests (tests/storage_tests.cpp,tests/logger_tests.cpp) and the CTE tests cover the column lookups. The foreign key tests coverforeign_keys_count().🤖 Generated with Claude Code