
POE::Component::DBIx::MyServer::Client - A client connection to our server

This class is instantiated each time a client connects to our PoCo::DBIx::MyServer.
It provides a system resolver for a few base mysql queries (select @version_comment ..).
It also provides the methods with which you can send data to the client, send ok and send errors.

Then you can create various classes (that subclass the PoCo::DBIx::MyServer::Client class) that will behave as databases in your mysql server.
package MyServer::HelloWorld;
use POE;
sub resolve_query {
my ($self, $query) = @_;
return 'hello_world_event';
}
sub hello_world_event {
my ( $kernel, $session, $heap, $self ) = @_[ KERNEL, SESSION, HEAP, OBJECT];
my $data = $_[ARG0];
$self->send_results(['column1'], [['Hello World from a perl mysql DB !']]);
}
1;
In those classes you have to redefine the resolver method in which you can resolve queries to events name (by returning the event name). Then you implement events as methods (with special POE stuff, check the samples).

This actually send results and columns name to the client.
This send an ok to the client.
This returns an error to the client.

Eriam Schaffter, eriam@cpan.org and original work done by Philip Stoev in the DBIx::MyServer module.

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