Bulk insert mechanism in the insert row dialog#2813
Draft
simonw wants to merge 6 commits into
Draft
Conversation
Works entirely using existing JSON API. User can paste in CSV, TSV or JSON (or drop a text file on). They get a preview of the rows to be imported, then they are imported in max_insert_rows batches.
Similar to insert rows from JSON/CSV/TSV but it creates a brand new table instead.
I was getting a confirm() dialog when I clicked outside the dialog on the create table from data page despite not having filled out any fields.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2813 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 73 73
Lines 12035 12037 +2
=====================================
- Misses 12035 12037 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
Author
Moved text around, added clickable 'open a file' button for mobile. Screenshot: #2813 (comment)
Owner
Author
|
Point of confusion: I tried importing the same external data (with a concrete primary key - it was the JSON from https://api.github.com/users/simonw/repos) twice - once to create the table, and then again with the edit feature. This happened:
I guess I was actually trying to do an upsert here, which the UI doesn't yet support. Need to think about if upsert should be a feature and how it should work. |
Owner
Author
|
Note that upsert requires an additional permission, |
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.


It's effectively https://github.com/datasette/datasette-import as a core feature.