Live data from Hacker News

Show HN: OctoSQL – Query and join multiple databases and files, written in Go

github.com

11–20 of 74 posts

Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go

#11
post #4

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?

Postgres Foreign Data Wrappers are an incredibly powerful tool. I've in the past built a basic data warehouse for a distributed system by pulling in read slaves from assorted service's databases as FDW sources to a central Postgres instance, after which Postgres allows you to treat them all as one big database.

Re: Show HN: OctoSQL – Query and join multiple databases and files, written in Go

#12
post #9

Thanks 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.

Make sure to let us know if you have any feedback after testing it out!

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

#15
This 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, 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

#18
post #2

Hey, 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,…

> 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 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

#20
post #15

This 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…

Thanks!

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.

Post reply on HN