If I understand it correctly, DBD::AnyData provides SQL access to a number of specific formats.
What I find useful with TexQL is the ability to specify the format of the text at use-time. So it's basically a usable front-end to a parser/loader for SQLite.
Could you please elaborate a bit on in what way I could have used/reused DBD::AnyData to do this? | [reply] |
Your program could easily be re-written as a front-end to DBD::AnyData which would allow it to operate on FixedLength, XML, CSV (with any record and field separators, with alternate delimiters and escape characters, etc), and many other formats. This would not only allow you to use many other input formats, but you could also have an output flag that would allow you to dump the results to any of those formats or to any DBI database, not limited to SQLite as yours is. If all the user wants is the results of the query, with DBD::AnyData as a backend, everything would happen in memory without creating an intermediate database on disk as your script does.
If you want to submit a patch, I'd be glad to include it (with credit natch) in DBD::AnyData (I'm its author), or it could be a standalone. Either way, holler if you need AnyData to do something it doesn't currently.
| [reply] |
That's a useless use of cat.
This might be true if you're tight on CPU cycles. But in the evaluation process of the "correct" cmdline, I often exchange another filter with just "cat" for a quick check. You could argue that I could use "< some_random_file" instead, but on the beginning of a command line it's likely that I use the wrong angle bracket :-/ (It is far less likely on the end of a command line)
| [reply] |