4 ms·
Good stuff, it's finally here! Now what I'd like is for someone to integrate the DDL/DML stuff as well (Git and CSV); The idea behind that is: 1. 'create table
by vkaku 7y ago
Good stuff, it's finally here! Now what I'd like is for someone to integrate the DDL/DML stuff as well (Git and CSV); The idea behind that is:
1. 'create table' should create a new .csv and new .schema.csv;
2. 'insert into' should insert records into .csv;
3. 'commit' should do a git commit
That way we get a human readable database + all the transaction semantics and data versioning + all the query goodness. Would like to know if there's a project doing exactly this.
- vdm 7y agohttps://medium.com/@zwischenzugs/a-non-cloud-serverless-application-pattern-using-git-and-docker-e853b33e126b https://medium.com/@zwischenzugs/a-non-cloud-serverless-appl...
- jolmg 7y agoThe query is just passed as-is to sqlite, so you can do inserts (and create tables, too): $ cq t:=- -q ' insert into t values (2,3); select * from t; ' <<EOF foo,bar 1,2 EOF foo,bar 1,2 2,3 I can't think of a good use-case to do create table from this tool, though. It would always be simpler to just create the CSV file. Also, I can't see the point of interpreting "commit" in the SQL to do a git commit. This tool just passes the SQL to an established SQL engine (only SQLite for now). I don't think I want to get into interpreting my own version of SQL. It doesn't sound KISS. In the same vein, interpreting "create table" to create a schema.csv also sounds out of scope just from having to interpret that instead of passing it to an SQL engine, and I can't see the point either. Ultimately, my aim is for this tool to be more analogous to jq than to sqlite. It's not so much an RDBMS, although you can query a directory of CSVs by globbing like it's a database. It's mainly an ad-hoc querying tool. EDIT: I don't know anymore. I'm growing to like your idea, and thinking of how it can be supported. I'll keep it in consideration. Does anyone have a concrete use-case for a human readable database with automatic git commits like that? It wouldn't be fast enough for anything intensive. I can only see it as a CLI version of Excel. It may also be nice to be able to use that to export a DB to SQL and then use cq to turn that into a set of CSV files. Would anyone really find something like that useful, though? Maybe that's pointless.
- vkaku 7y agoConcrete use-case: Infrastructure as code. Sometimes we like to keep track of servers, environments, accounts or what not, and a human readable/verifiable representation is useful to check differences in a period of time, for audit purposes. Git/SCM is a good tool to do versioning and atomicity; The CSV is for the readability.