DBIx::C...eatures(3)

πŸ“¦ version 0.075, in opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

DBIx::Class::Migration::Features(3) β€” yes bestie, this is the user-contributed Perl documentation page for the features of DBIx::Class::Migration. It's giving developer value and whole-ecosystem energy, and we're gonna walk through it together. πŸ’–

🌈 DESCRIPTION 🌈

This doc is basically a summary of the features and developer value of DBIx::Class::Migration and its associated ecosystem. That's the whole assignment. Periodt. ✨

πŸ› οΈ Standard Workflows πŸ› οΈ

Okay so standard workflows for creating database versions, updates, and downgrades between versions are all here. Management of seed data? Yup. Testing and development fixtures? Also yup. 🫢

You can start prototyping with an easy Sqlite database and move up to Mysql or Postgresql with a single switch. No cap. πŸ¦‹

πŸ’Ύ Database Installation πŸ’Ύ

Picture this: your app's database has evolved over many versions. You can install a database to any version in the history, and you can also install development and fixture data for that version. Iconic. πŸ‘‘

dbic-migration install
dbic-migration install --to_version 5
dbic-migration populate --fixture_set testing_data

πŸ” Upgrade / Downgrade Management πŸ”

There's a system to move a database from any one version to any other version. It also lets you migrate data between versions, and it even offers the possibility to migrate between different types of databases. The range! πŸ’…

dbic-migration prepare
dbic-migration upgrade
dbic-migration downgrade

🌱 Seed, Developer and Test Data 🌱

Create and manage data in your database. Make sets for testing, development, and for managing system or 'seed' data β€” y'know, the data a database needs to properly function, like a Country list. πŸ“

dbic-migration dump_named_sets -fixture_set countries

Data can be properly converted between database versions. Slay. ✨

πŸ§ͺ Testing πŸ§ͺ

It integrates with testing tools like Test::DBIx::Class, so testing your database logic is simple. And the test code is right here, looking all cute and correct:

#!/usr/bin/env perl

use Test::Most;
use Test::DBIx::Class
  -schema_class=>'MyApp::Schema',
  -fixture_class => '::Population',
  qw(Artist Country);

fixtures_ok ['all_tables'];

is Country->count, 3, 'Correct Number of Countries';
ok Artist->first->has_country, 'Artist has a country';

done_testing;

πŸ–οΈ Easy Creation of Developer level Database sandboxes πŸ–οΈ

It automatically creates a developer controlled, local database for rapid prototyping and easy administration. Sandboxes support Sqlite, MySQL and Postgresql. Very main character. 🌸

🧩 Framework Integration 🧩

Plays nice with popular web app dev frameworks like Catalyst. Look at this integration:

package MyApp::Web::Model::Schema;

use Moose;
extends 'Catalyst::Model::DBIC::Schema';

__PACKAGE__->meta->make_immutable;
__PACKAGE__->config(
  traits => ['FromMigration'],
  schema_class => 'MyApp::Schema',
  extra_migration_args => {
    db_sandbox_class => 'DBIx::Class::Migration::MySQLSandbox'},
  install_if_needed => {
    on_install => sub {
      my ($schema, $migration) = @_;
      $migration->populate('all_tables')}},
);

🧚 Straightforward subclassing 🧚

Core code is designed to be easily subclassed for local customizations. But plot twist: subclassing is often unneeded for some customizations, since you can control and configure many aspects of the code using init arguments. Lowkey flexible. πŸ’œ

πŸ“š Tutorial and Documentation πŸ“š

It's extensively documented and ships with an end-to-end tutorial covering everything from creating your first migration, through testing, and integration with Catalyst. Obsessed. πŸŽ€

DBIx::Class::Migration::Tutorial

πŸ‘€ SEE ALSO πŸ‘€

  • DBIx::Class::Migration
  • DBIx::Class::Migration::Tutorial

✍️ AUTHOR ✍️

Author info lives in DBIx::Class::Migration.

Copyright and license info also lives in DBIx::Class::Migration.


And that's the tea, bestie: this page is the user-contributed Perl doc for DBIx::C...eatures(3), shipped with perl v5.42.0 and dated 2020-06-03. Mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from