View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Eriam Schaffter > POE-Component-Server-MySQL > POE::Component::Server::MySQL



Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  


POE::Component::Server::MySQL - A MySQL POE Server


This modules helps building a MySQL proxy in which you can write handler to deal with specific queries.

You can modifiy the query, write a specific response, relay a query or do wahtever you want within each handler.

This is the evolution of POE::Component::DBIx::MyServer, it uses Moose and POE.


First you create a server class that extends POE::Component::Server::MySQL.

   package MyMySQL;
   use Moose;
   extends 'POE::Component::Server::MySQL';
   with 'MooseX::Getopt';

Then in a perl script you can instantiate your new server

   use MyMySQL;
   my $server = MyMySQL->new_with_options();

In the MyMySQL namespace you can add roles which will act as handlers for your trapped queries:

   package MyMySQL::OnSteroids;
   use MooseX::MethodAttributes::Role;
   sub fortune : Regexp('qr{fortune}io') {
      my ($self) = @_;
        my $fortune = `fortune`;


Eriam Schaffter, with original work done by Philip Stoev in the DBIx::MyServer module.


At least one, in specific cases the servers sends several packets instead of a single one. It works fine with most clients but it crashes Toad for MySQL for example.


This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: