Repository navigation
feat(core): UUID record ids for synced kinds - #4587
Merged
Merged
Conversation
… position in range
…ed folder cycles, keep old copies whole
datlechin
enabled auto-merge (squash)
November 25, 2026 22:10
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
record_id, a random UUIDv4 kept as lower-case text (core ADR 0052). The integeridstays as the rowid the full-text index, pages, pins and upgrade copies use.20261126000000_record_ids.sqlrebuildssaved_queries,saved_query_foldersandhistory, keeping rowids andsqlite_sequence, and recreates the FTS and store-sequence triggers. Linux beta.1 to beta.5 databases upgrade through it, with the ADR 0012 copy made first.ON DELETE CASCADEorSET NULL. Deleting a folder deletes its subfolders and moves its queries to the top in the store's code, and a connection delete lifts other connections' records out of its folders.connection_idis optional: a query or folder with no connection shows in every connection. Uniqueness follows 0052: names per connection or none, folder names per connection and parent, a keyword unique wherever its query expands.SavedQueries::putandSavedQueryFolders::putwrite records a pull or another store brings under their own ids and settle name and keyword collisions bycreated_at(now milliseconds), then id bytes, renaming to<name> (2)or clearing the keyword. They store names and keywords in the form the indexes compare, cap names at 200 characters, break folder cycles and lift folders past 64 levels.Uuid; history entries gainrecord_id;FolderCyclecarries aUuid.connection_id, history entries carryrecord_id. Windows bindings regenerated.tablepro-recordsmaps the history rowid as device-only andrecord_idas the id; foreign import, MCP; the Linux sidebar, saved queries dialog and quick open; the Windows interop and app (Guid ids; the edit dialog keeps a folder it cannot show).favourites_migration_testsand the copy tests inbackup_folderscompare by name or build old-format copies through a real beta upgrade, since the API no longer gives rowids. On Linux,malformed_hierarchies_are_refused_instead_of_hiding_queries_or_recursingdrops its orphan case andnew_folder_requires_a_successful_read_and_an_invalid_graph_keeps_the_last_good_rowsuses a cycle as its invalid graph, since a missing folder now reads as the top level per 0052. Migration counts move to 6.linux/docs/storage.md; Linux changelog fragment.Test plan
cargo test -p tablepro-storage: migration fixtures from Linux beta.3 and beta.5 databases (ids are distinct v4, filing, keywords, times, pins, FTS search, sequences and the copy), folders nested past the cascade limit, no foreign key or referential action, collision rules (created in one second, ids that sort the other way, any batch order, keywords across connections and none, swaps), put normalization, caps and cycles, copy trimming of both formats.cargo test -p tablepro-ffi --test saved_queries --test history --test foreign_import --test library --test library_details --test cloud_library,-p tablepro-records -p tablepro-foreign-import -p tablepro-mcp -p tablepro-cli.verify.sh --platform linux test(8 of 8 suites, 9372 passed, the copy tests on Linux's SQLite included) andlint(rustfmt, clippy with and without default features).verify.sh --platform windows bindings(no diff after regeneration) andtest(2506 passed) on the rebased tree; later commits change only core storage internals, Linux and docs.VACUUM INTOthe pre-created copy file, so the copy tests fail locally there, as on main; they pass on Linux.