-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core refactors #126
Merged
Merged
Core refactors #126
Conversation
This file contains 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
mikeknep
requested review from
pimlock,
tylersbray,
sami-t,
johntmyers and
gracecvking
June 16, 2023 14:40
gracecvking
approved these changes
Jun 16, 2023
pimlock
approved these changes
Jun 21, 2023
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.
No user-facing changes here, strictly an internal refactor.
Previously, tables with JSON columns got "extra special treatment": after creating invented tables from them, we added the invented tables to the
RelationalData
graph as nodes, but not the source table itself; instead, metadata about that original table was stored in aRelationalJson
object responsible for knowing everything necessary to transform invented tables back to the original shape. Then theRelationalData
stored a dictionary of those objects. This was always a bit clunky and added a lot of mental overhead when trying to reason about the internal state.In the spirit of "cattle, not pets", this PR makes what we now call "producer" tables more similar to normal and invented tables. Probably the key takeaway is that every table is a node in the graph, whether it is a "normal" table, an invented table, or a producer of invented tables. All state for a given table is stored on the graph node. This brings several benefits:
RelationalJson
s)—they just write down everything known about all tables, and (by extension) the restore process is simplified. (RelationalJson
backup was also a bit "lossy"; no more!)There are also a few internal helper methods added to generally make things more readable.