Interchange6-Schema

 view release on metacpan or  search on metacpan

lib/Interchange6/Schema/Manual/DatabaseSupport.pod  view on Meta::CPAN

=head1 MySQL

MySQL databases should be created with UTF8 encoding and appropriate collation for your local, for example:

    CREATE DATABASE my_shop_db
        DEFAULT CHARACTER SET utf8
        DEFAULT COLLATE utf8_general_ci;

The following L<Connection attributes|DBIx::Class::Storage::DBI/DBIx::Class specific connection attributes> are recommended as a minimum for MySQL:

    mysql_enable_utf8 => 1,
    on_connect_call   => 'set_strict_mode',
    quote_names       => 1,

YAML-formatted configuration example for L<Dancer::Plugin::DBIC>:

  DBIC:
    default:
      dsn: "dbi:mysql:database=mydb;mysql_socket=/tmp/mysql.sock"
      user: myuser
      password: mypassword
      schema_class: Interchange6::Schema
      options:
        mysql_enable_utf8: 1
        on_connect_call: set_strict_mode
        quote_names: 1

=head1 PostgreSQL

PostgreSQL databases should be created with UT8 encoding, for example:

    createdb -E UTF8 my_shop_db

The following L<Connection attributes|DBIx::Class::Storage::DBI/DBIx::Class specific connection attributes> are recommended as a minimum for PostgreSQL:

lib/Interchange6/Test/Role/MySQL.pm  view on Meta::CPAN

Returns appropriate DBI connect info for this role.

=cut

sub connect_info {
    my $self = shift;
    return (
        $self->database->dsn( dbname => 'test' ),
        undef, undef,
        {
            mysql_enable_utf8 => 1,
            on_connect_call => 'set_strict_mode',
            quote_names => 1,
        }
    );
}

sub _build_database_info {
    my $self = shift;
    $self->ic6s_schema->storage->dbh_do(
        sub {



( run in 0.305 second using v1.01-cache-2.11-cpan-00829025b61 )