question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Idea: import CSV to memory, run SQL, export in a single command

See original GitHub issue

I quite often load a CSV file into a SQLite DB, then do stuff with it (like export results back out again as a new CSV) without any intention of keeping the CSV file around afterwards.

What if sqlite-utils could do this for me? Something like this:

sqlite-utils --csv blah.csv --csv baz.csv "select * from blah join baz ..."

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
simonwcommented, Jun 16, 2021

Solution: sqlite-utils memory - attempts to detect the input based on if it starts with a { or [ (likely JSON) or if it doesn’t use the csv.Sniffer() mechanism. Or you can use sqlite-utils memory -:csv to specifically indicate the type of input.

0reactions
simonwcommented, Jun 19, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Import | IntelliJ IDEA Documentation - JetBrains
In the Database tool window (View | Tool Windows | Database), right-click a schema or a table and select Import/Export | Import Data...
Read more >
How to Import and Export CSV Files Using PHP and MySQL
Importing and Exporting data from MySQL and CSV is really easy with PHP. Learn how to carry out this exchange in this excellent...
Read more >
Import data in MySQL from a CSV file using LOAD DATA INFILE
You can use the LOAD DATA INFILE command to import a CSV file into a table. Check the link MySQL - LOAD DATA...
Read more >
Importing a CSV into SQL Server Shouldn't Be This Hard
A frustrating time importing CSV files leads Steve to test the ... thinking this would be just a few minutes to load and...
Read more >
Fast CSV Import in PowerShell to SQL Server - SQLTeam.com
I recently had to write some simple scripts for a proof of concept. These scripts use PowerShell to import and export CSV files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found