dsn => $dsn,
user => $user,
password => $password,
+ data_types => {
+ 'bigint' => { size => undef, data_type => 'bigint' },
+ 'int8' => { size => undef, data_type => 'int8' },
+ 'bigserial' => { size => undef, data_type => 'bigserial' },
+ 'serial8' => { size => undef, data_type => 'serial8' },
+ 'bit' => { size => undef, data_type => 'bit' },
+ 'boolean' => { size => undef, data_type => 'boolean' },
+ 'bool' => { size => undef, data_type => 'bool' },
+ 'box' => { size => undef, data_type => 'box' },
+ 'bytea' => { size => undef, data_type => 'bytea' },
+ 'cidr' => { size => undef, data_type => 'cidr' },
+ 'circle' => { size => undef, data_type => 'circle' },
+ 'date' => { size => undef, data_type => 'date' },
+ 'double precision' => { size => undef, data_type => 'double precision' },
+ 'float8' => { size => undef, data_type => 'float8' },
+ 'inet' => { size => undef, data_type => 'inet' },
+ 'integer' => { size => undef, data_type => 'integer' },
+ 'int' => { size => undef, data_type => 'int' },
+ 'int4' => { size => undef, data_type => 'int4' },
+ 'interval' => { size => undef, data_type => 'interval' },
+ 'interval(2)' => { size => 2, data_type => 'interval' },
+ 'line' => { size => undef, data_type => 'line' },
+ 'lseg' => { size => undef, data_type => 'lseg' },
+ 'macaddr' => { size => undef, data_type => 'macaddr' },
+ 'money' => { size => undef, data_type => 'money' },
+ 'path' => { size => undef, data_type => 'path' },
+ 'point' => { size => undef, data_type => 'point' },
+ 'polygon' => { size => undef, data_type => 'polygon' },
+ 'real' => { size => undef, data_type => 'real' },
+ 'float4' => { size => undef, data_type => 'float4' },
+ 'smallint' => { size => undef, data_type => 'smallint' },
+ 'int2' => { size => undef, data_type => 'int2' },
+ 'serial' => { size => undef, data_type => 'serial' },
+ 'serial4' => { size => undef, data_type => 'serial4' },
+ 'text' => { size => undef, data_type => 'text' },
+ 'time' => { size => undef, data_type => 'time' },
+ 'time(2)' => { size => 2, data_type => 'time' },
+ 'time without time zone' => { size => undef, data_type => 'time without time zone' },
+ 'time(2) without time zone' => { size => 2, data_type => 'time without time zone' },
+ 'time with time zone' => { size => undef, data_type => 'time with time zone' },
+ 'time(2) with time zone' => { size => 2, data_type => 'time with time zone' },
+ 'timestamp' => { size => undef, data_type => 'timestamp' },
+ 'timestamp(2)' => { size => 2, data_type => 'timestamp' },
+ 'timestamp without time zone' => { size => undef, data_type => 'timestamp without time zone' },
+ 'timestamp(2) without time zone' => { size => 2, data_type => 'timestamp without time zone' },
+ 'timestamp with time zone' => { size => undef, data_type => 'timestamp with time zone' },
+ 'timestamp(2) with time zone' => { size => 2, data_type => 'timestamp with time zone' },
+ 'bit varying(2)' => { size => 2, data_type => 'bit varying' },
+ 'varbit(2)' => { size => 2, data_type => 'varbit' },
+ 'character varying(2)' => { size => 2, data_type => 'character varying' },
+ 'varchar(2)' => { size => 2, data_type => 'varchar' },
+ 'character(2)' => { size => 2, data_type => 'character' },
+ 'char(2)' => { size => 2, data_type => 'char' },
+ 'numeric(6, 3)' => { size => [6,3], data_type => 'numeric' },
+ 'decimal(6, 3)' => { size => [6,3], data_type => 'decimal' },
+ },
extra => {
create => [
q{
sub run_tests {
my $self = shift;
- plan tests => 99;
+ plan tests => 101;
$self->create();
is( $obj2->id, 2 );
SKIP: {
- skip $self->{skip_rels}, 61 if $self->{skip_rels};
+ skip $self->{skip_rels}, 63 if $self->{skip_rels};
my $moniker3 = $monikers->{loader_test3};
my $class3 = $classes->{loader_test3};
ok ((not exists $rsobj3->result_source->relationship_info('loader_test4zes')->{attrs}{on_update}),
'has_many does not have on_update');
+ ok ((not exists $rsobj3->result_source->relationship_info('loader_test4zes')->{attrs}{is_deferrable}),
+ 'has_many does not have is_deferrable');
+
isnt $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{on_delete}, 'CASCADE',
"on_delete => 'CASCADE' not on belongs_to by default";
isnt $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{on_update}, 'CASCADE',
"on_update => 'CASCADE' not on belongs_to by default";
+ isnt $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{is_deferrable}, 1,
+ "is_deferrable => 1 not on belongs_to by default";
+
ok ((not exists $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{cascade_delete}),
'belongs_to does not have cascade_delete');
}
}
- plan tests => @connect_info * (171 + ($self->{extra}->{count} || 0));
+ plan tests => @connect_info * (174 + ($self->{extra}->{count} || 0));
foreach my $info_idx (0..$#connect_info) {
my $info = $connect_info[$info_idx];
);
SKIP: {
- skip $self->{skip_rels}, 113 if $self->{skip_rels};
+ skip $self->{skip_rels}, 116 if $self->{skip_rels};
my $moniker3 = $monikers->{loader_test3};
my $class3 = $classes->{loader_test3};
ok ((not exists $rsobj3->result_source->relationship_info('loader_test4zes')->{attrs}{on_update}),
'has_many does not have on_update');
+ ok ((not exists $rsobj3->result_source->relationship_info('loader_test4zes')->{attrs}{is_deferrable}),
+ 'has_many does not have is_deferrable');
+
is $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{on_delete}, 'CASCADE',
"on_delete => 'CASCADE' on belongs_to by default";
is $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{on_update}, 'CASCADE',
"on_update => 'CASCADE' on belongs_to by default";
+ is $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{is_deferrable}, 1,
+ "is_deferrable => 1 on belongs_to by default";
+
ok ((not exists $rsobj4->result_source->relationship_info('fkid_singular')->{attrs}{cascade_delete}),
'belongs_to does not have cascade_delete');
ok ((not exists $rsobj27->result_source->relationship_info('loader_test28')->{attrs}{on_update}),
'might_have does not have on_update');
+ ok ((not exists $rsobj27->result_source->relationship_info('loader_test28')->{attrs}{is_deferrable}),
+ 'might_have does not have is_deferrable');
+
# find on multi-col pk
my $obj5 =
eval { $rsobj5->find({id1 => 1, iD2 => 1}) } ||