Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C csvkit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wireservice
  • csvkit
  • Issues
  • #572
Closed
Open
Issue created Feb 09, 2016 by Administrator@rootContributor

csvsql: Add --unique-index a,b to add unique index

Created by: brandon-rhodes

It is wonderful that --insert exists and provides a quick way to have a table created and loaded with data!

But if the source CSV file is improved, tweaked, or regenerated, then the user is dead in the water. The table in the database is now out of sync with the CSV data, and there is no facility for ever updating it. There are at least two ways that csvkit could solve this:

  • Provide a --drop option that would, in a single database transaction, drop the table, create the table, and reload it with the new data.
  • The really fun solution would be an --upsert COLUMN[,COLUMN...] option that attempted to insert all of the rows, but for those that failed switched to attempting an update using the given columns as keys to search for and match.
Assignee
Assign to
Time tracking