Test::Database::Driver::SQLite - A Test::Database driver for SQLite


Test-Database documentation Contained in the Test-Database distribution.

Index


Code Index:

NAME

Top

Test::Database::Driver::SQLite - A Test::Database driver for SQLite

SYNOPSIS

Top

    use Test::Database;
    my @handles = Test::Database->handles( 'SQLite' );

DESCRIPTION

Top

This module is the Test::Database driver for DBD::SQLite.

SEE ALSO

Top

Test::Database::Driver

AUTHOR

Top

Philippe Bruhat (BooK), <book@cpan.org>

COPYRIGHT

Top

LICENSE

Top

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


Test-Database documentation Contained in the Test-Database distribution.

package Test::Database::Driver::SQLite;
use strict;
use warnings;

use Test::Database::Driver;
our @ISA = qw( Test::Database::Driver );

use DBI;
use File::Spec;

sub is_filebased {1}

sub _version { return DBI->connect( $_[0]->driver_dsn() )->{sqlite_version}; }

sub dsn {
    my ( $self, $dbname ) = @_;
    return $self->make_dsn(
        dbname => File::Spec->catdir( $self->base_dir(), $dbname ) );
}

sub drop_database {
    my ( $self, $dbname ) = @_;
    my $dbfile = File::Spec->catfile( $self->base_dir(), $dbname );
    unlink $dbfile;
}

'SQLite';

__END__