rewrite Pg "time without time zone" as "time"
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 15sybase_common.t
CommitLineData
fe67d343 1use strict;
2use lib qw(t/lib);
3use dbixcsl_common_tests;
804c115d 4use Test::More;
2d1dc6de 5use Test::Exception;
6ecee584 6use List::MoreUtils 'apply';
f9f65ded 7
fe67d343 8my $dsn = $ENV{DBICTEST_SYBASE_DSN} || '';
9my $user = $ENV{DBICTEST_SYBASE_USER} || '';
10my $password = $ENV{DBICTEST_SYBASE_PASS} || '';
11
12my $tester = dbixcsl_common_tests->new(
7cb9244f 13 vendor => 'sybase',
fe67d343 14 auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY',
41968729 15 default_function => 'getdate()',
16 default_function_def => 'AS getdate()',
fe67d343 17 dsn => $dsn,
18 user => $user,
19 password => $password,
5163dc4a 20 data_types => {
760fd65c 21 # http://ispirer.com/wiki/sqlways/sybase/data-types
22 # XXX organize by category
5163dc4a 23 'integer identity' => { data_type => 'integer', is_auto_increment => 1 },
24 'AS getdate()' => { data_type => undef, inflate_datetime => 1, default_value => \'getdate()' },
25 text => { data_type => 'text' },
26 unitext => { data_type => 'unitext' },
27 image => { data_type => 'image' },
28 bigint => { data_type => 'bigint' },
29 int => { data_type => 'integer' },
30 integer => { data_type => 'integer' },
31 smallint => { data_type => 'smallint' },
32 tinyint => { data_type => 'tinyint' },
33 date => { data_type => 'date' },
34 time => { data_type => 'time' },
35 datetime => { data_type => 'datetime' },
36 smalldatetime => { data_type => 'smalldatetime' },
37 money => { data_type => 'money' },
38 smallmoney => { data_type => 'smallmoney' },
39 timestamp => { data_type => 'timestamp', inflate_datetime => 0 },
40 bit => { data_type => 'bit' },
41 'char(2)' => { data_type => 'char', size => 2 },
42 'nchar(2)' => { data_type => 'nchar', size => 2 },
43 'unichar(2)' => { data_type => 'unichar', size => 2 },
44 'varchar(2)' => { data_type => 'varchar', size => 2 },
45 'nvarchar(2)' => { data_type => 'nvarchar', size => 2 },
46 'univarchar(2)' => { data_type => 'univarchar', size => 2 },
47 'binary(2)' => { data_type => 'binary', size => 2 },
48 'varbinary(2)' => { data_type => 'varbinary', size => 2 },
49 'double precision' => { data_type => 'double precision' },
50 real => { data_type => 'real' },
51 float => { data_type => 'double precision' },
52 'float(14)' => { data_type => 'real' },
53 'float(15)' => { data_type => 'real' },
54 'float(16)' => { data_type => 'double precision' },
55 'float(48)' => { data_type => 'double precision' },
56 'numeric(6,3)' => { data_type => 'numeric', size => [6,3] },
57 'decimal(6,3)' => { data_type => 'numeric', size => [6,3] },
58 numeric => { data_type => 'numeric' },
59 decimal => { data_type => 'numeric' },
804c115d 60 },
fe67d343 61);
62
63if( !$dsn || !$user ) {
64 $tester->skip_tests('You need to set the DBICTEST_SYBASE_DSN, _USER, and _PASS environment variables');
65}
66else {
67 $tester->run_tests();
68}