Hacker News new | ask | show | jobs
by trgn 61 days ago
im sure, but honestly, i would love to have a db engine that just writes/reads csv or json. does it exist?
4 comments

DuckDB can do exactly this, once you get the API working in your system, it becomes something simple like

    SELECT \* from read_csv('example.csv');
Writing generally involves reading to an in-memory database, making whatever changes you want, then something like

    COPY new_table TO 'example.csv' (HEADER true, DELIMITER ',');
I wrote a CSV DB engine once! I can't remember why. For fun?
Microsoft actually provide an ODBC CSV data source out of the box.
Postgres can do that as well.
SQLite can do it
it's storage file is a csv? or do you mean import/export to csv?
You can import csv files into in memory tables and query them or you can use the csv extensions

$ sqlite3 :memory:

.import myfile.csv mytable

SELECT * FROM mytable;

$ sqlite3 :memory:

SELECT *

FROM csv_read('myfile.csv');