Repository navigation
Add --extract to CLI insert and upsert - #909
Open
goingforstudying-ctrl wants to merge 1 commit into
Open
goingforstudying-ctrl wants to merge 1 commit into
goingforstudying-ctrl wants to merge 1 commit into
Conversation
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.
Importing repeated values into lookup tables currently requires the Python API or a separate normalization step. Add repeatable
--extract COLUMNoptions toinsertandupsert, using the existingextracts=implementation and the interface prototyped in #352.Each selected column uses a same-name lookup table with
idandvaluecolumns. Repeated values reuse the same lookup ID, and nulls stay null. New target tables receive integer foreign keys; existing target schemas are preserved. CSV/TSV type inference continues for other columns and keeps extracted foreign keys as integers. Imports without the option retain their current behavior.Includes usage examples, generated CLI help and coverage for JSON, newline JSON, CSV, TSV,
--code, repeated extracts, batching, upserts, nulls, strict tables, type overrides, quoted identifiers, existing schemas and invalid input.Validation: offline focused and full pytest suites, Black, Flake8, mypy, Cog and the added documentation section on Python 3.11.6 / SQLite 3.42.0. Other Python/SQLite versions and upstream CI have not been run for this change.
Refs #352.
📚 Documentation preview 📚: https://sqlite-utils--909.org.readthedocs.build/en/909/