-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update table data via CSV import #10313
Update table data via CSV import #10313
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## develop #10313 +/- ##
===========================================
- Coverage 69.88% 69.16% -0.72%
===========================================
Files 536 524 -12
Lines 19537 19306 -231
Branches 3893 3840 -53
===========================================
- Hits 13653 13353 -300
- Misses 5449 5517 +68
- Partials 435 436 +1
... and 116 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDIT - failed to notice the table type being passed around - all good.
Description
Added a toggle for internal DB CSV imports that allows a user to update existing rows.
You choose one or more fields to match for the update. This could easily be changed to a single options picker if that's easier to understand for the user.
I choose to only make this option available for the Internal DB because to be honest I wasn't able to figure out how to do an upsert with Knex - the blogs I saw were for a specific DB implementation and not a generic one.
Also an upsert would also need to be implemented for Google Sheets, so it may be worth adding this feature just for the Internal DB to start with.
There is also no import verification for uniqueness. As it is, it's up to the user to pick fields appropriately, but a check could potentially be added.
Addresses:
Screenshots
Insert mode
Duplicate row:
Upsert mode (one key field)
Upsert mode (multiple key fields)
Original row updated: