Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

izut (6269)

izut
  (email not shown publicly)
AOL IM: igorsutton (Add Buddy, Send Message)

Perl programmer and enthusiast.

Journal of izut (6269)

Tuesday February 13, 2007
04:23 AM

SQL::Tokenizer and Tao::DBI

[ #32386 ]

I've been working last week on SQL::Tokenizer, which was used to, erm, tokenize a SQL query correctly to extract named placeholders for a DBI subclass I'm working on. It is actually using the known-and-loved Perl's regular expression engine, but maybe I can write a version using Pugs::Compiler::Rule, let's see.

About the DBI subclass I mentioned above, Adriano wrote the Tao::DBI, which is a proxy to DBI that implements the named placeholders concept. I liked that and re-implemented the Tao::DBI as a subclass of DBI, but since it is not backward compatible with Adriano's one, I have to found another name for it before release.

Any suggestion?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I've been thinking of doing something similar for some SQL::Statement subclasses I've been working on, but you beat me to it. (S::S just does progressive regexes, which makes for some very muddy code at times). Should be very helpful in getting those subclasses done.

    BTW: I noted you only support ANSI comments; have you considered support for C style "/* ... */" comments ? (many databases support the latter).

    Also wrt named placeholders, I don't know if its possible, but it might be nifty to directly refe

    • I thank you for using my code :-) I'll implement the C style comments, following your suggestion.

      I'll see if the direct references to Perl variables when using named placeholders is a Good Thing(tm).

      I'm planning to release the code-that-was-named Tao::DBI when I find a new name for that. Some friends of mine suggested DBIx::WithPlaceholder, but I'm planning to ask about it at Perlmonks.
      --
      Igor Sutton