DBIx::Class::Migration::SqliteSandbox - Autocreate a Sqlite sandbox
use DBIx::Class::Migration; my $migration = DBIx::Class::Migration->new( schema_class=>'Local::Schema', db_sandbox_class=>'DBIx::Class::Migration::SqliteSandbox'), $migration->prepare; $migration->install;
Please note db_sandbox_class is a lazy built attribute, and it will default to DBIx::Class::Migration::SqliteSandbox.
db_sandbox_class
In order to help you jumpstart your database design and deployment, by default we will automatically create a sqlite based file database in your target-dir.
target-dir
This is the default supported option as documented in DBIx::Class::Migration and in DBIx::Class::Migration::Tutorial. DBD::SQLite is useful for your initial development and for when you are trying to build quick prototypes but for production and more serious work I recommend you target a different database. You can use MySQL::Sandbox to make it easy to create local MySQL sandboxes for development, including replication clusters. For a more simple (and limited) approach you can also use DBIx::Class::Migration::MySQLSandbox or DBIx::Class::Migration::PgSandbox.
Nothing else is required to install in order to use this default option.
Since Sqlite is a simple, single file database that doesn't run persistently we don't create any helper scripts. If you want to access the database directly you can do so with the sqlite3 commandline tool which you should get when you get DBD::Sqlite. To access the sandbox database:
sqlite3
sqlite3 [target_dir]/[schema_class].db
For example, if your schema_class is MyApp::Schema and your sandbox is in the default share:
schema_class
MyApp::Schema
share
sqlite3 MyApp-Web/share/myapp-schema.db
You can also follow the tutorial DBIx::Class::Migration::Tutorial since the bulk of the tutorial uses the sqlite sandbox.
DBIx::Class::Migration, DBD::Sqlite.
See DBIx::Class::Migration for author information
See DBIx::Class::Migration for copyright and license information
To install DBIx::Class::Migration, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::Migration
CPAN shell
perl -MCPAN -e shell install DBIx::Class::Migration
For more information on module installation, please visit the detailed CPAN module installation guide.