Class::DBI::Plugin::Backtickify - surround column and table names with backticks


Class-DBI-Plugin-Backtickify documentation  | view source Contained in the Class-DBI-Plugin-Backtickify distribution.

Index


NAME

Top

Class::DBI::Plugin::Backtickify - surround column and table names with backticks

SYNOPSIS

Top

    package Film;
    use base qw( Class::DBI ); 
    use Class::DBI::Plugin::Backtickify; # must come after the use base

DESCRIPTION

Top

Puts backticks around table and column names. This allows reserved words to be used as column (and table?) names in MySQL (and others?).

CAVEATS

Top

It works by installing a transform_sql method into your CDBI class. Other modules and plugins maybe do the same thing, in which case they may not play nicely with this. It does go through some hoops however to try and call other transform_sql methods, but all the replacement tags will already have been removed so this might not help anyway. YMMV.

The installed transform_sql finds column names using a regex over each @args passed in. If strings matching column names (but not supposed to represent column names) exist as words in the input to the method, they will also get wrapped. Not sure how likely this is.

I haven't tested if this works with joins, but it should.

No tests yet.

METHODS

Top

transform_sql

AUTHOR

Top

David Baird, <cpan@riverside-cms.co.uk>

BUGS

Top

Please report any bugs or feature requests to bug-class-dbi-plugin-backtickify@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-DBI-Plugin-Backtickify. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Class-DBI-Plugin-Backtickify documentation  | view source Contained in the Class-DBI-Plugin-Backtickify distribution.