The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

Object::Relation::Setup::DB::SQLite - Object::Relation SQLite data store setup

Synopsis

See Object::Relation::Setup.

Description

This module inherits from Object::Relation::Setup::DB to build a SQLite set up store.

Class Interface

Constructors

new

  my $sqlite_setup = Object::Relation::Setup::DB::SQLite->new(\%params);

The constructor inherits from Object::Relation::Setup::DB, but detects when the dsn attribute isn't set, and sets it to a default value. The database file in that value will be obj_rel.db and will live in the directory returned by File::Temp::tempdir().

Class Methods

connect_attrs

  DBI->connect(
      $dsn, $user, $pass,
      { Object::Relation::Setup::DB::SQLite->connect_attrs }
  );

Returns a list of arugments to be used in the attributes hash passed to the DBI connect() method. Overrides that provided by Object::Relation::Setup::DB to add unicode => 1.

Instance Interface

Instance Methods

setup

  $setup->setup;

Sets up the data store. This implementation simply constructs a database handle and assigns it to the dbh attribute, and then calls SUPER::setup() to let Object::Relation::Setup::DB handle the bulk of the work.

teardown

  $kbs->teardown;

Tears down the database by disconnecting all database connections and deleting the database file, which is extracted from the DSN.

Copyright and License

Copyright (c) 2004-2006 Kineticode, Inc. <info@obj_relode.com>

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