Subject: | "Pluggable" fork of Querylet on github |
Date: | Tue, 19 Jul 2011 22:47:12 +0200 |
To: | Ricardo SIGNES <rjbs [...] cpan.org> |
From: | Max Maischein <corion [...] corion.net> |
Hello Ricardo!
I use Querylet a lot at $work, and I finally got around to rewriting it
to be more extensible. The changes are _very_ preliminary, but I like
them for now, as they will enable better error messages and better
extensibility (I think - I haven't written any new features yet!). The
changes currently live in the "pluggable" branch on Github [1]. The main
change is to the Querylet parser, which is not one huge s/// statement
anymore but splits up the sections into lightweight objects.
My plans for these objects are:
1) Store line number information and include that information as #line
comments, so that later error messages raised by Perl correspond to the
original file and line number.
2) Add another "input" class that takes input parameters from the
command line via Getopt::Long
3) Add a "title" option
4) Add a generic parser that can fetch the title and input parameters
from a Querylet without running it (similar to ::CGI, but for automatic
monthly reports and determining whether they need to run)
5) Add an "email the output" option
6) Add a "used parameters for this query" option that lists the
parameters for _this_ result, for easy reproducibility and convenient
auto-generation of filenames.
All of these should be fairly easy to add once I've tested my changes.
They already pass all original tests, but I haven't moved my production
Querylet scripts over to the new version, so this still is somewhat
theoretical.
If you find time to look at my changes and whether they can make it into
the mainline Querylet, that would be really great! If you have ideas on
how to make the API better, these are also very welcome!
Thanks for writing such a useful module!
-max
[1] https://github.com/Corion/querylet/tree/pluggable