DBD::Gofer middleware thoughts (was Idea for a Gofer transport for translating SQL - primarily intended for testing)

Andrew Ford <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
If we have a DBD::Gofer middleware feature then it would be helpful to 
add a new passthrough (or "passthru") transport.  This would be based on 
the null transport, but without the serialization/deserialization, i.e. 
something as simple as:

    package DBD::Gofer::Transport::passthrough;

    #   $Id: null.pm 10087 2007-10-16 12:42:37Z timbo
    $                                                                                                                                       

    #                                                                                                                                                                                         

    #   Copyright (c) 2007, Tim Bunce,
    Ireland                                                                                                                                                

    #                                                                                                                                                                                         

    #   You may distribute under the terms of either the GNU General
    Public                                                                                                                   

    #   License or the Artistic License, as specified in the Perl README
    file.                                                                                                                


    use strict;
    use warnings;

    use base qw(DBD::Gofer::Transport::Base);

    use DBI::Gofer::Execute;

    our $VERSION = sprintf("0.%06d", q$Revision: 10087 $ =~ /(\d+)/o);

    my $executor = DBI::Gofer::Execute->new();

    sub transmit_request_by_transport {
        my ($self, $request) = @_;
                                                                                                                                                    

        return $executor->execute_request( $request );
    }

    1;

This would be suitable for middleware modules to wrap.

Andrew
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.