SPUG: Talk Tomorrow?
daotoad at gmail.com
Mon Sep 17 19:44:15 PDT 2012
I will be giving a talk on my SQL generation library called DBIx::PreQL.
DBIx::PreQL - Less awful SQL generation with templates
Do amazing things with SQL by sprinkling it with 7 characters: & | * #
? ! ~
Nearly every programmer will work with relational databases at one time or
another, if not every day. This means we have to work with SQL, whether we
write our queries by hand or use an abstraction layer to generate them.
No generator is perfect, and sometimes you just have to write SQL to get
the results you need.
DBIx::PreQL defines a small templating language that is designed to make it
easy to manage groups of related, complex queries.
For example, if you have a webpage that sells widgets, you may have a bunch
of nearly identical queries that provide:
* A list of available models of widget
* A count of available models of widget
* A count of widgets available of each type
* The above three queries for discontinued models only.
* The first three queries for currently available models only.
These queries are probably 90% identical, with only minor changes.
DBIx::PreQL addresses this problem by adding simple tags to the beginning
of each line of SQL that are used to determine whether or not a line is
included in the final query.
Here's a typical marked-up query:
& count(*) !count!
& status !~status!
* FROM tbl_widget
& status = ?status?
& AND model = ?model?
& AND name LIKE ?name?
You can see DBIx::PreQL on github right now:
I will be working like a feverish weasel tonight to get it uploaded to CPAN
before the talk.
On Mon, Sep 17, 2012 at 3:23 PM, Webster <webstermontego at gmail.com> wrote:
> There were some mentionings of a couple people that might be willing to
give a talk tomorrow but I never heard anything definite. Is anyone willing
to volunteer for tomorrow?
> Seattle Perl Users Group Mailing List
> POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
> MEETINGS: 3rd Tuesdays
> WEB PAGE: http://seattleperl.org/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the spug-list