Live data from Hacker News

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

github.com

21–30 of 46 posts

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

#21

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

It's also a single letter in the alphabet. Anyone who names their project a single letter (or two) is expecting some amount of collision. The real question is whether or not the collision is worth it.

In this case, it might be... they are trying to make a command-line tool. So in theory, you'll be typing the command often, meaning that a short name is preferable.

But honestly, it would have probably been a better idea to use a more descriptive name.

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

#22
post #11

Earlier quoted context omitted.

In what way would you write regexes verbosely? I'm actually quite interested in the idea because regexes can be confusing to write at times, and it's difficult to remember which form to use where, if you use them in many languages/interfaces. There are tools like Regexper[1] that let you visualize the regex as an automata graph, and there are tools like text2re[2] which will allow you to put in text and visually gene…

> In what way would you write regexes verbosely? Something like SQL would be fine. It's not a really thought out theory, but I think I'd like to manipulate text via a programming language like VI gods manipulate text with shortcuts. Thanks for the link I will have a look at them.

You might like https://github.com/VerbalExpressions/JSVerbalExpressions

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

#23
Matt Might wrote a blog post about using standard CLI tools for this purpose: http://matt.might.net/articles/sql-in-the-shell/

Rather than making a custom tool to issue SQL, the idea is that regular CLI tools map well to the traditional relational algebra operations. sed is like selection, cat is like union, etc.

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

#24
post #11

Earlier quoted context omitted.

In what way would you write regexes verbosely? I'm actually quite interested in the idea because regexes can be confusing to write at times, and it's difficult to remember which form to use where, if you use them in many languages/interfaces. There are tools like Regexper[1] that let you visualize the regex as an automata graph, and there are tools like text2re[2] which will allow you to put in text and visually gene…

I'm probably heavily biased, but to me Perl is the best command-line regex tool. Perl was invented to gather data and report on it, and its regex engine is incredibly fast and powerful. As an added bonus it supports some Python and PCRE-specific extensions. But this Q app is useful for people who either don't know Perl or can get what they need done faster with SQL than with scripting. In terms of 'verbosity' you can…

> As an added bonus it supports some Python and PCRE-specific extensions.

This is a bit of a strange thing to say, since nearly all of the advanced regex features showed up in Perl first. PCRE stands for "Perl-compliant regular expressions," so there's certainly no extensions there that didn't originally come from Perl. I'm less sure about Python, but I get the sense that they borrow from Perl regular expressions as well.

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

#25

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

Dataset provides ad-hoc SQL querying of ... SQL databases.

It looks like a neat API, but it's not really similar to this project.

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

#26
post #21

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

It's also a single letter in the alphabet. Anyone who names their project a single letter (or two) is expecting some amount of collision. The real question is whether or not the collision is worth it. In this case, it might be... they are trying to make a command-line tool. So in theory, you'll be typing the command often, meaning that a short name is preferable. But honestly, it would have probably been a better ide…

Hi, i'm q's creator (HN made the name q uppercase, but it's actually a lowercase q). The reasoning was that it's used as a command line tool, and used often. So "q" and not "Q" :)I'm currently preparing the debian package, and one-letter names are not allowed, so it's going to be named "qsql" there.

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

#28
post #21

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

It's also a single letter in the alphabet. Anyone who names their project a single letter (or two) is expecting some amount of collision. The real question is whether or not the collision is worth it. In this case, it might be... they are trying to make a command-line tool. So in theory, you'll be typing the command often, meaning that a short name is preferable. But honestly, it would have probably been a better ide…

Given that the command argument is in full SQL notation, which must be passed quoted, saving three or four characters on the executable name doesn't really seem worth it. The shortest example they give, a SELECT/GROUP query, is over 50 characters.

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

#29

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

That's not ad hoc querying of a tabular text file.
Post reply on HN