X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F19informix_common.t;h=07b05239d9699cbd49f5cba77ce2f41b71a8d515;hb=128f61d834839db22612bcca96e1014ed9f7e8df;hp=f3deeed5a89c70ad6a8790974539a31b7762d1c3;hpb=b511f36e7550cfe8aac546be689c8bd320a83975;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/19informix_common.t b/t/19informix_common.t index f3deeed..07b0523 100644 --- a/t/19informix_common.t +++ b/t/19informix_common.t @@ -13,15 +13,106 @@ my $password = $ENV{DBICTEST_INFORMIX_PASS} || ''; my $tester = dbixcsl_common_tests->new( vendor => 'Informix', - auto_inc_pk => 'SERIAL PRIMARY KEY', + auto_inc_pk => 'serial primary key', null => '', - default_function => 'CURRENT YEAR TO FRACTION(5)', - default_function_def => 'DATETIME YEAR TO FRACTION(5) DEFAULT CURRENT YEAR TO FRACTION(5)', + default_function => 'current year to fraction(5)', + default_function_def => 'datetime year to fraction(5) default current year to fraction(5)', dsn => $dsn, user => $user, password => $password, loader_options => { preserve_case => 1 }, quote_char => '"', + data_types => { + # http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=/com.ibm.sqlr.doc/ids_sqr_094.htm + + # Numeric Types + 'int' => { data_type => 'integer' }, + integer => { data_type => 'integer' }, + int8 => { data_type => 'bigint' }, + bigint => { data_type => 'bigint' }, + serial => { data_type => 'integer', is_auto_increment => 1 }, + bigserial => { data_type => 'bigint', is_auto_increment => 1 }, + serial8 => { data_type => 'bigint', is_auto_increment => 1 }, + smallint => { data_type => 'smallint' }, + real => { data_type => 'real' }, + smallfloat => { data_type => 'real' }, + # just 'double' is a syntax error + 'double precision' => { data_type => 'double precision' }, + float => { data_type => 'double precision' }, + 'float(1)' => { data_type => 'double precision' }, + 'float(5)' => { data_type => 'double precision' }, + 'float(10)' => { data_type => 'double precision' }, + 'float(15)' => { data_type => 'double precision' }, + 'float(16)' => { data_type => 'double precision' }, + numeric => { data_type => 'numeric' }, + decimal => { data_type => 'numeric' }, + dec => { data_type => 'numeric' }, + 'numeric(6,3)' => { data_type => 'numeric', size => [6,3] }, + 'decimal(6,3)' => { data_type => 'numeric', size => [6,3] }, + 'dec(6,3)' => { data_type => 'numeric', size => [6,3] }, + + # Boolean Type + # XXX this should map to 'boolean' + boolean => { data_type => 'smallint' }, + + # Money Type + money => { data_type => 'money' }, + 'money(3,3)' => { data_type => 'numeric', size => [3,3] }, + + # Byte Type + byte => { data_type => 'bytea', original => { data_type => 'byte' } }, + + # Character String Types + char => { data_type => 'char', size => 1 }, + 'char(3)' => { data_type => 'char', size => 3 }, + character => { data_type => 'char', size => 1 }, + 'character(3)' => { data_type => 'char', size => 3 }, + 'varchar(3)' => { data_type => 'varchar', size => 3 }, + 'character varying(3)' + => { data_type => 'varchar', size => 3 }, + # XXX min size not supported, colmin from syscolumns is NULL + 'varchar(3,2)' => { data_type => 'varchar', size => 3 }, + 'character varying(3,2)' + => { data_type => 'varchar', size => 3 }, + nchar => { data_type => 'nchar', size => 1 }, + 'nchar(3)' => { data_type => 'nchar', size => 3 }, + 'nvarchar(3)' => { data_type => 'nvarchar', size => 3 }, + 'nvarchar(3,2)' => { data_type => 'nvarchar', size => 3 }, + 'lvarchar(3)' => { data_type => 'lvarchar', size => 3 }, + 'lvarchar(33)' => { data_type => 'lvarchar', size => 33 }, + text => { data_type => 'text' }, + + # DateTime Types + date => { data_type => 'date' }, + 'date default today' + => { data_type => 'date', default_value => \'today' }, + # XXX support all precisions + 'datetime year to fraction(5)', + => { data_type => 'datetime year to fraction(5)' }, + 'datetime year to fraction(5) default current year to fraction(5)', + => { data_type => 'datetime year to fraction(5)', default_value => \'current year to fraction(5)' }, + # XXX do interval + + # Blob Types + # XXX no way to distinguish opaque types boolean, blob and clob + blob => { data_type => 'blob' }, + clob => { data_type => 'blob' }, + + # IDSSECURITYLABEL Type + # + # This requires the DBSECADM privilege and a security policy on the + # table, things I know nothing about. +# idssecuritylabel => { data_type => 'idssecuritylabel' }, + + # List Types + # XXX need to introspect element type too + 'list(varchar(20) not null)' + => { data_type => 'list' }, + 'multiset(varchar(20) not null)' + => { data_type => 'multiset' }, + 'set(varchar(20) not null)' + => { data_type => 'set' }, + }, ); if( !$dsn ) {