Categories: Perl | DBIx::MyModules

DBIx::MyParse


DBIx::MyParse is a Perl module for parsing SQL queries. It works by calling the native MySQL parser from libmysqld and making the parse tree available in Perl.

Contents

[edit] Example

 use DBIx::MyParse;
 use Data::Dumper;
 
 my $parser = DBIx::MyParse->new();
 my $query = $parser->parse("SELECT 1");
 
 print Dumper $query->getWhere();
 print $query->toString();

[edit] Installation

1. Download and unpack the latest MySQL 5.0 source from here

2. Download and unpack DBIx::MyParse from here

3. Patch the MySQL source:

  $ cd /path/to/mysql-source
  $ cat /path/to/dbix-myparse-source/mysql.patch | patch -P1

4. Configure and compile the MySQL source:

  $ cd /path/to/mysql-source
  $ ./configure --with-embedded-server
  $ make && make test

(you do NOT need to do "make install" to install the patched MySQL server)

5. Configure and compile DBIx::MyParse:

  $ cd /path/to/dbix-myparse-source
  $ perl Makefile.PL
  $ make
  $ make test
  $ sudo make install
  

DBIx::MyParse can not be installed automatically using CPAN.

[edit] Query Rewriting

DBIx::MyParse can be used for on-the-fly query rewriting. In conjunction with DBIx::MyServer, a MySQL proxy can be built which intercepts, rewrites and responds to queries.

[edit] Links

Retrieved from "http://forge.mysql.com/wiki/DBIx::MyParse"

This page has been accessed 2,566 times. This page was last modified 15:41, 12 September 2007.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...