Repository navigation
ADFA-6740: docdb-studio and the db writers read and write schema 3.0.0 - #57
Merged
Merged
Conversation
…and the db writers
docdb-studio
- Opens majors 2 and 3 (refuses >3); version read newest changeTime, then rowid, as the app does.
- Tooltip reads name {tooltips}/{buttons}; on schema 3 they become 2.x-shaped subqueries over
Tooltips+TooltipTexts and TooltipButtons+Descriptions+Uris.
- Writes: insert TooltipTexts first and key Tooltips on its id; text updates go to TooltipTexts;
button strings deduped through the lookup tables; deletes remove the text row and any button
strings nothing uses, before the existing VACUUM.
- New Templates page: list/filter/edit/save. Schema 3 decodes with the dictionary and encodes
with brotli -D -w 24, rejecting large-window output and checking the round trip.
- Removed add_tooltip_button / update_tooltip_button (no callers).
populate_db.py, sync_javadoc_json_to_db.py, load_android_json_db.py (+ verify_android_json_db.py)
- From 3.0.0 templates are written compressed against CompressionDictionary (-w 24, decoded back
before storing) instead of refused; below it, plain as before.
- A 3.x database keeps its version: populate_db no longer rewrites it to 2.0.0 and the Android
loader no longer appends 3.1.0.
- A major above 3 (unknown format) is refused before backup or copy.
- The verifier decodes compressed templates.
v2 support is kept: the master and the other 2.x-only tools still exist.
Tests: refusal tests replaced with round trips on v3 fixtures; docdb-studio's v3 fixture is a 2.x
database converted by the real migrate_tooltip_schema.py.
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.
Jira: ADFA-6740
The master documentation.db is moving to schema 3.0.0 (ADFA-3305). This teaches the tools that edit it to read and write that shape instead of refusing it. v2 support is kept: the 2.x master and the 2.x-only tools (check-tools, sync_kdoc, TooltipManager) still exist.
docdb-studio
ORDER BY changeTime DESC, rowid DESC; was rowid only).{tooltips}/{buttons};_tooltip_sqlfills in the tables (v2) or 2.x-shaped subqueries overTooltips+TooltipTextsandTooltipButtons+TooltipButtonDescriptions+TooltipButtonUris(v3). Browse, search, view, edit, export, Validate URIs and Browse content all go through it.TooltipTextsfirst and takes its id. Text updates go toTooltipTexts. Button strings are deduped through the lookup tables. Deletes drop the text row and any button strings nothing uses, before the existing VACUUM.CompressionDictionaryand encodes withbrotli -D -w 24, rejects large-window output (brotli4j refuses it) and checks the round trip before writing. In v2 it reads and writes plain.add_tooltip_button/update_tooltip_button(no callers).Writers: populate_db.py, sync_javadoc_json_to_db.py, load_android_json_db.py
-w 24, decoded back before storing) instead of refused. Below 3.0.0 they're written plain, as before.verify_android_json_db.pydecodes compressed templates.DictionaryCompressor.compressnow passes-w 24explicitly. That's the CLI default for stdin, so the bytes are unchanged.Tests
docdb-studio/tests/test_schema_v3.pybuilds its fixture by running the realmigrate_tooltip_schema.pyon a 2.x database. It covers reads, insert (id from TooltipTexts, app queries find it), rename, delete with no orphans, CSV import, template round trip, and version ordering.Checked against the real 3.0.0 database (copy of the 2026-10-23 file)
verify_remint_dictionary.py original editedreports 22,725/22,725 items and 1,649/1,650 templates byte-identical. The one mismatch is the edited template.Not done here