Repository navigation
refactor(core): share one column list between memory SELECTs and row_to_memory - #1346
Merged
Merged
Conversation
…to_memory row_to_memory decodes 22 columns by position, but ~26 hand-written SELECTs repeated (or truncated) the list. Queries that stopped at content_type silently returned default slug/source/source_type/author_type (e.g. list, search_content, list_at_time lost them). Add memory_columns!/memory_columns_m! macros that expand to string literals and compose with concat! into compile-time SQL. - convert all SELECTs feeding row_to_memory (crud, fts5, bulk, rooms, aging, dream, orphans) - round-trip test through every reader; macro agreement test Refs #1339 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 7, 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.
What
memory_columns!()/memory_columns_m!()(aliasm.) next torow_to_memoryinmemory/store.rs: one definition of the 22-column order the decoder reads by position. They expand to string literals, so SQL stays a compile-time constant (concat!), no runtimeformat!of column lists.row_to_memory(crud ×17, fts5 ×4, bulk ×2, dream ×2, rooms, aging, orphans).get_by_id,get_by_ids,get_by_id_in_namespace,load_all,list±tag,search_content,list_at_time±tag,find_similar,find_aged,deprecated_at) and a test that the two macros agree.Why
Architecture review item "one column list" — see #1339 (tracked in #1345).
row_to_memoryreads columns by index and silently defaults the tail, so a SELECT that drifts or stops short corrupts data without an error (the FTS5 bug in #1333 was this). It was not limited to FTS5:list,search_content,list_at_time,find_aged,find_similar,find_deprecated_for_prune, room-scoped recall, dream and orphans all stopped atcontent_type/slug, so memories read through them lostsource,source_type,author_typeanddeprecated_at.Testing
list: sourcewasNone) and passes after.cargo fmt --check,cargo clippy --workspace --all-targetsclean;cargo test --workspacegreen; vecq-only core build green.slug/source/source_type/author_typenow return the stored values.recall_room_scoped,find_deprecated_for_prune, dreamload_recent_memories,find_orphansare converted mechanically but not individually round-tripped.Refs #1339
🤖 Generated with Claude Code