5 ms·
Seems if the query is always going to start with SELECT, that maybe it should be assumed? I would never use this though, ack or find seem sufficient to me.
by m00s3 9y ago
Seems if the query is always going to start with SELECT, that maybe it should be assumed?
I would never use this though, ack or find seem sufficient to me.
- dTal 9y agoIt's a shame Bash used 'select' as an elaborate menu built-in - it'd be quite neat to name the binary that (and drop the quotes). The you could just type the query right into your prompt!
- koolba 9y agoYou could use an alias. They're case sensitive so SELECT could be mapped without impacting the built in "select".
- labster 9y agoJust use the fish shell instead, and you can avoid the years of shell cruft of bash, or the endless customization of zsh. Bash is a good environment for shell scripting, but not really the best for user interaction. Although perl is probably the best environment for shell scripting.
- fnj 9y agoXonsh is far better both interactively and for scripting than bash, fish, zsh, or perl.
- lorenzhs 9y ago"alias select=command select" lets you override it.
- emmelaich 9y agoYeah, I like the idea of using sql but it is painful to write. It would be nice to omit the select and the quoting; my suggestion would be that fsql "select * from ..." could be written as select all from ... and all could be assumed if ommitted; so you could write select from or just from ... But unfortunately `select` is a sh(1) reserved word and `from` is an existing command! (shows who who your mail is from) So maybe select and from could be shortened to sel and frm.
- kshvmdn 9y agoI like this! I've started work on this [0], feel free to add to the issue if you'd like. [0] https://github.com/kshvmdn/fsql/issues/10 https://github.com/kshvmdn/fsql/issues/10
- lorenzhs 9y agoYou can do "alias select=command select", it works in bash and zsh (and maybe others). In zsh you could also "alias select=noglob command select" and it wouldn't do wildcard matching. Then you could use select * from ... and it would pass the asterisk to your select binary :)
- stephenr 9y ago> or just > from ... Or just ... Why even bother naming fields. Just make <space> enter return everything from anywhere from all time for all people on all platforms. How many times are we going to have this ridiculous suggestion that less characters/words is automatically better. This is 'short/arrow functions' (pick your language) all over again, and invariably ends up with the situation where the new syntax is just fucking impossible to read at first glance, because it has so many variances. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... Parens are optional. Unless you have no arguments, then they're required. Curly braces are optional, unless you want more than a simple expression, or no return or to return an object literal, then they're required. I grow weary enough of this bullshit notion that code must 'look pretty', but when you're using "less characters is always best" as the definition for 'pretty' it just becomes unbearable.
- mpfundstein 9y agostill arrow functions are the single one ES6 addition to js that made the language finally nice enough for me to enjoy ;-) as a fp geek
- cheezbrgr 9y ago> How many times are we going to have this ridiculous suggestion that less characters/words is automatically better. Fewer is better, in this case, and anyone who spends a large portion of their time in a terminal will likely agree. In most situations, one simply wants to answer a query or perform an operation as soon and as painlessly as possible and move on with their work. How pretty the command is is irrelevant. You're never going to look at it again once it gives you the answer. Ain't nobody got time to write full-fledged SQL queries to get access to a subset of GNU find.
- evincarofautumn 9y agoIt could be extended with other queries like “update” for batch file operations, I suppose. Like you, I’m fine with my existing suite of find/grep/ack/awk/perl/whatever, but I already know how to use them; a beginner or someone who doesn’t live their whole life at a Unix terminal could probably benefit from the simpler interface.
- lucashill14769 9y agoPay me then sick of walking or riding