jhspetersson/fselect

Feature request: allow "from" at end of query

Closed this issue · 0 comments

Please allow "from" to come at the end of the query (yes, breaking the SQL standard).

Why? Unlike database queries, fselect commands can be re-used against different directories. Putting it at the end makes it easier to quickly re-use a query for a different directory. It would also make it possible to store an fselect query as a shell alias.

For example,

alias count-git-repos='fselect count(*) where name = '.git' from'

I can then do:

count-git-repos ~/repos

I realize I can currently do this:

function count() { fselect "count(*)" from "$1" "where name = '.git'" }

But to me the alias feels cleaner, and simpler to understand and to re-use.