DBIx::Class::Schema::PgSetTimezone
# Define your Schema class
package MyApp::Schema;
use base qw/DBIx::Class::Schema::PgSetTimezone/;
__PACKAGE__->load_classes(qw/Arthur Ford Zaphod/);
# Initialize the schema
# (Only hashref connect_info style supported)
$schema = MyApp::Schema->connection({
dsn => 'dbi:Pg:database=myapp',
user => undef,
pass => undef,
auto_commit => 1,
raise_error => 1,
)};
# Set time zone for the connection. SQL will be executed immediately,
# and on any further connect/reconnects
$schema->timezone('America/Chicago');
Component for DBIx::Class::Schema
Set the connection time_zone in a way that persists within connection managers like DBIx::Connection and Catalyst::Model::DBIC::Schema
Schema->connection() supports several formats of parameter list
This module only supports a hashref parameter list, as in the synopsis
Read or set the time zone string
Overload "connection" in DBIx::Class::Schema
Inserts a callback into "on_connect_call" in DBIx::Class::Storage::DBI
Use of this module requires using only the hashref style of connect_info arguments. Other connect_info formats are not supported. See "connect_info" in DBIx::Class::Storage::DBI
Execute sql statement to set session time zone
DBIx::Class::Schema, DBIx::Connection, Catalyst::Model::DBIC::Schema
(c) 2019 Mitch Jackson [email protected] under the perl5 license