3 use dbixcsl_common_tests;
6 my $dsn = $ENV{DBICTEST_SYBASE_DSN} || '';
7 my $user = $ENV{DBICTEST_SYBASE_USER} || '';
8 my $password = $ENV{DBICTEST_SYBASE_PASS} || '';
10 my $tester = dbixcsl_common_tests->new(
12 auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY',
15 password => $password,
19 CREATE TABLE sybase_loader_test1 (
20 id INTEGER IDENTITY NOT NULL PRIMARY KEY,
22 charfield VARCHAR(10) DEFAULT 'foo',
23 computed_dt AS getdate()
27 drop => [ qw/ sybase_loader_test1 / ],
30 my ($schema, $monikers, $classes) = @_;
32 my $rs = $schema->resultset($monikers->{sybase_loader_test1});
33 my $rsrc = $rs->result_source;
35 is $rsrc->column_info('id')->{data_type},
37 'INTEGER IDENTITY data_type is correct';
39 is $rsrc->column_info('id')->{is_auto_increment},
41 'INTEGER IDENTITY is_auto_increment => 1';
44 local $TODO = 'timestamp introspection broken';
46 is $rsrc->column_info('ts')->{data_type},
48 'timestamps have the correct data_type';
51 is $rsrc->column_info('charfield')->{data_type},
53 'VARCHAR has correct data_type';
56 local $TODO = 'constant DEFAULT introspection';
58 is $rsrc->column_info('charfield')->{default},
60 'constant DEFAULT is correct';
63 is $rsrc->column_info('charfield')->{size},
65 'VARCHAR(10) has correct size';
67 ok ((exists $rsrc->column_info('computed_dt')->{data_type}
68 && (not defined $rsrc->column_info('computed_dt')->{data_type})),
69 'data_type for computed column exists and is undef')
70 or diag "Data type is: ",
71 $rsrc->column_info('computed_dt')->{data_type}
77 if( !$dsn || !$user ) {
78 $tester->skip_tests('You need to set the DBICTEST_SYBASE_DSN, _USER, and _PASS environment variables');