from Hacker News

Show HN: Turn CSV Files into SQL Statements for Quick Database Transfers

by ryanwaldorf on 5/28/24, 12:26 PM with 15 comments

This package lets you unload a CSV from a warehouse, turn that CSV into SQL statements creating a temp table and inserting data with a CLI command, and copy those SQL statements into your query editor so you can start using the data in a different warehouse. Useful for when you need to join data together that's stored in two separate data warehouses (e.g. finance and product data).
  • by bdcravens on 5/28/24, 6:37 PM

    For small datasets, this is good, but for anything significant, using the database's native bulk load will be more efficient than INSERT statements.
  • by nbbaier on 5/28/24, 3:54 PM

    This is neat! Correct me if I'm wrong, but don't a lot of systems already have the ability to ingest CSV data? Why this intermediate step?
  • by ddgflorida on 5/29/24, 2:56 PM

    There are many browser based solutions for quick CSV to SQL also - i.e. www.convertcsv.com/csv-to-sql.htm
  • by mharig on 5/30/24, 5:11 PM

    One can do this with the sqlite3 CLI tool.