simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.62k stars 109 forks source link

`--stop-after` option for `insert` and `upsert` commands #561

Closed simonw closed 1 year ago

simonw commented 1 year ago

I found myself wanting to insert rows from a 849MB CSV file without processing the whole thing: https://huggingface.co/datasets/jerpint-org/HackAPrompt-Playground-Submissions/tree/main

simonw commented 1 year ago

Got this working:

sqlite-utils insert /tmp/playground.db Playground_Submission_Data \
  ~/Downloads/Playground_Submission_Data.csv --csv --stop-after 2000