Earlier quoted context omitted.
Generally, I make use of file_fdw module of Postgres to achieve this. https://www.postgresql.org/docs/11/file-fdw.html
Didn't know about that, thanks! Is there a way to connect this to other databases, to basically have views of your redis/MySQL/other databases in postgres?
Show HN: OctoSQL – Query and join multiple databases and files, written in Go
11–20 of 74 posts
Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#12Thanks for sharing. This is cool, just what I wanted. I like the fact I can create config files and query not just he database but also query JSON.
The Go standard library really helped handling all the different json file formats you might expect. (Like being a whole file table, or record per line)
Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#13Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#14Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#15 function csv_to_sqlite() {
echo "used as csv_to_sqlite PATH_TO_CSV TABLE_NAME"
sqlite3 -csv -cmd ".import $1 $2" -cmd ".headers on"
}
Two suggestions:1. It would be a lot more useful if I could link an entire database rather than just tables
2. Sometimes I just want to query a single CSV, so a command line argument where I can just specify the path would be nice
Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#16Something similar (with a GUI) is https://www.dremio.com/ that I think has gained some traction.
Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#17Really cool, thanks for sharing. You all might want to look at Apache Calcite ( http://calcite.apache.org/ ) as well for inspiration, which has similar functionality as a subset of its features!
Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#18Hey, one of the authors here. The motivation behind this project is that I always wanted a simple commandline tool allowing me to join data from different places, without needing to set up stuff like presto or spark. On another hand, I never encountered any tool which allows me to easily query csv and json data using SQL (which at least in my opinion is fairly ergonomic to use). This started as an university project,…
This exactly describes Drill (https://drill.apache.org/) which can query any data source under the sun (RDBMS, NoSQL, files, clusters, serialized data (JSON, CSV, Parquet...), object storage (S3, OpenStack, ...)) using SQL and JOIN between them with pushdown optimizations. It's got an awesome CLI and can be used in any language via REST or JDBC.
Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#19Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go
#20This is great. I keep the following in my bash profile for querying CSVs with SQL, which works OK, but this is probably better: function csv_to_sqlite() { echo "used as csv_to_sqlite PATH_TO_CSV TABLE_NAME" sqlite3 -csv -cmd ".import $1 $2" -cmd ".headers on" } Two suggestions: 1. It would be a lot more useful if I could link an entire database rather than just tables 2. Sometimes I just want to query a single CSV, s…
1. Initially we wanted to do one table per config-entry, but that'll be an easy to do UX improvement.
2. We're planning to add support for piping the csv/json file through stdin! That would be the most seamless workflow I think.