DBIx-Auto-Migrate

 view release on metacpan or  search on metacpan

lib/DBIx/Auto/Migrate.pm  view on Meta::CPAN

 			UNIQUE(username)
 		)',
 	);
 }

Returns a list of migrations, creating a options table in the first migration is
obligatory since it is internally used to keep track of the current migration number.

=head2 dsn

 sub dsn {
 	return 'dbi:Pg:dbname=my_fancy_app_db';
 }

Returns a valid DSN for L<DBI>, you can use any logic to return this, even reading a database config file.

=head2 user

 sub user { 'mydbuser' }

Returns a valid user for L<DBI>, you can use any logic to return this, even reading a database config file.

=head2 pass

 sub pass { 'mypass' }

Returns a valid password for L<DBI>, you can use any logic to return this, even reading a database config file.

=head2 extra

 sub extra {
 	{
 		PrintError => 1,
 	}
 }

You can optionally implement this method to pass extra options to L<DBI>, the
return must be a hashref or undef.

=head1 FINALIZING THE DATABASE WRAPPER CLASS

 finish_auto_migrate();

Calling this method will ensure your class is completely ready to be used,
you can do it at any point if every prerequisite is available.

=head1 METHODS AUTOMATICALLY AVAILABLE IN YOUR WRAPPER

=head2 connect

 my $dbh = MyCompany::DB->connect;

Same as L<DBI>::C<connect> but without taking any argument.

=head2 connect_cached

 my $dbh = MyCompany::DB->connect_cached;

Same as L<DBI>::C<connect_cached> but without taking any argument.

=head1 BUGS AND LIMITATIONS

Tries to be database independent, but I cannot really ensure it.

More testing is needed.

=head1 AUTHOR

SERGIOXZ - Sergio Iglesias

=head1 CONTRIBUTORS

SERGIOXZ - Sergio Iglesias

=head1 COPYRIGHT

Copyright © Sergio Iglesias (2025)

=head1 LICENSE

This library is free software and may be distributed under the same terms
as perl itself. See L<https://dev.perl.org/licenses/>.

=cut



( run in 1.820 second using v1.01-cache-2.11-cpan-98e64b0badf )