Live data from Hacker News

Q – Execute SQL on text. Supports joins across files, RPM available

github.com

1–10 of 46 posts

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#4
Dataset (https://dataset.readthedocs.org/) is a similar project that provides ad-hoc SQL querying of structured data - example usage:

  import dataset

  db = dataset.connect('sqlite:///:memory:')

  table = db['sometable']
  table.insert(dict(name='John Doe', age=37))
  table.insert(dict(name='Jane Doe', age=34, gender='female'))

  john = table.find_one(name='John Doe')

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#8

This seems like a cool project, but Q is already a well-used JS promise library so there's a bit of a name conflict there even if the libs are aimed at very different tasks...

Any library with a really short name (<= 2 letters) should be prepared for name collisions. If they wanted to avoid name collisions, they should have chosen a slightly longer, more descriptive name in the first place. I think in this context (i.e. really short name) it doesn't really matter who was first.

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#9
If you need only a subset of full SQL, e.g. just joins, counting/aggregation, and date manipulation (as in several of these examples), I've found it fairly easy to work with a mixture of the standard Unix join(1) [found on nearly all systems], and some of the additions from Google's crush-tools (https://code.google.com/p/crush-tools/), mainly 'aggregate', 'grepfield', 'funiq', and 'convdate'. I find chaining them together a bit easier than writing monolithic SQL statements, but there's probably some crossover point at which that wouldn't be true.

It'd be interesting to compare runtimes as well. I would guess that there's some overhead in loading into the DB up front, but that you might gain some speedup by converting longer chains of Unix pipes into one SQL query. On the other hand you might lose some parallelism. Would take some testing on different kinds of queries and data sets to get an idea of the pros/cons I think.

Re: Q – Execute SQL on text. Supports joins across files, RPM available

#10
I have ended up with MySQL and PostgreSQL on nearly every linux I've installed. It is baffling to me that someone would decline these tools in favor of text file drivers or SQLite, with the exception of using SQLite as an embedded config database or something.
Post reply on HN