| Oryx documentation | Contained in the Oryx distribution. |
Oryx::DBI::Util::SQLite - Oryx DBI utilities for SQLite connections
This provides an Oryx DBI utility class for use with DBD::SQLite.
Richard Hundt <richard NO SPAM AT protea-systems.com>
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
Copyrright (c) 2005 Richard Hundt.
This library is free software and may be used under the same terms as Perl itself.
| Oryx documentation | Contained in the Oryx distribution. |
package Oryx::DBI::Util::SQLite; use base qw(Oryx::DBI::Util); our %SQL_TYPES = ( 'Oid' => 'integer PRIMARY KEY AUTOINCREMENT', 'Integer' => 'integer', 'String' => 'text', 'Text' => 'text', 'Binary' => 'blob', 'Float' => 'real', 'Boolean' => 'integer', 'DateTime' => 'text', ); sub type2sql { my ($self, $type, $size) = @_; my $sql_type = $SQL_TYPES{$type}; return $sql_type; } # Columns may not be dropped in SQLite. Oh, well. sub column_drop { } sub table_exists { my ($self, $dbh, $table) = @_; my $sth = $dbh->table_info('%', '%', $table); $sth->execute(); my @rv = @{$sth->fetchall_arrayref}; $sth->finish; return grep { lc $_->[2] eq lc $table } @rv; } 1;