SQL-Translator
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/SQL/Translator/Parser/Excel.pm view on Meta::CPAN
is_auto_increment => undef,
) or die $table->error;
if ($col == 0) {
$table->primary_key($field->name);
$field->is_primary_key(1);
}
}
#
# If directed, look at every field's values to guess size and type.
#
unless (defined $args->{'scan_fields'}
&& $args->{'scan_fields'} == 0) {
my %field_info = map { $_, {} } @field_names;
for (
my $iR = $ws->{'MinRow'} == 0 ? 1 : $ws->{'MinRow'};
defined $ws->{'MaxRow'} && $iR <= $ws->{'MaxRow'};
$iR++
) {
lib/SQL/Translator/Parser/xSV.pm view on Meta::CPAN
is_auto_increment => undef,
) or die $table->error;
if ($i == 0) {
$table->primary_key($field->name);
$field->is_primary_key(1);
}
}
#
# If directed, look at every field's values to guess size and type.
#
unless (defined $args->{'scan_fields'}
&& $args->{'scan_fields'} == 0) {
my %field_info = map { $_, {} } @field_names;
while (my $rec = $parser->fetchrow_hashref) {
for my $field (@field_names) {
my $data = defined $rec->{$field} ? $rec->{$field} : '';
my $size = [ length $data ];
my $type;
t/66-postgres-dbi-parser.t view on Meta::CPAN
my @t1_fields = $t1->get_fields;
is(scalar @t1_fields, 5, '5 fields in sqlt_test1');
my $f1 = shift @t1_fields;
is($f1->name, 'f_serial', 'First field is "f_serial"');
is($f1->data_type, 'integer', 'Field is an integer');
is($f1->is_nullable, 0, 'Field cannot be null');
is(${ $f1->default_value }, "nextval('sqlt_test1_f_serial_seq'::regclass)", 'Default value is nextval()');
is($f1->is_primary_key, 1, 'Field is PK');
#FIXME: not set to auto-increment? maybe we can guess auto-increment behavior by looking at the default_value (i.e. it call function nextval() )
#is( $f1->is_auto_increment, 1, 'Field is auto increment' );
my $f2 = shift @t1_fields;
is($f2->name, 'f_varchar', 'Second field is "f_varchar"');
is($f2->data_type, 'character varying', 'Field is a character varying(255)');
is($f2->is_nullable, 1, 'Field can be null');
is($f2->size, 255, 'Size is "255"');
is($f2->default_value, undef, 'Default value is undefined');
is($f2->is_primary_key, 0, 'Field is not PK');
is($f2->is_auto_increment, 0, 'Field is not auto increment');
t/data/sqlserver/create.sql view on Meta::CPAN
from master.dbo.spt_values
where type = "D"
and name = "ALL SETTABLE OPTIONS"
select @stat2opt = number
from master.dbo.spt_values
where type = "D2"
and name = "ALL SETTABLE OPTIONS"
/*
** If we can't find the option masks, guess at them
*/
if @statopt is null
select @statopt = 4 | 8 | 16 | 512 | 1024 | 2048 | 4096 | 8192
if @stat2opt is null
select @stat2opt = 1 | 2 | 4 | 8 | 64
if @dbname is null
begin
/*
** 17420, "Settable database options."
t/data/sybase/create.sql view on Meta::CPAN
from master.dbo.spt_values
where type = "D"
and name = "ALL SETTABLE OPTIONS"
select @stat2opt = number
from master.dbo.spt_values
where type = "D2"
and name = "ALL SETTABLE OPTIONS"
/*
** If we can't find the option masks, guess at them
*/
if @statopt is null
select @statopt = 4 | 8 | 16 | 512 | 1024 | 2048 | 4096 | 8192
if @stat2opt is null
select @stat2opt = 1 | 2 | 4 | 8 | 64
if @dbname is null
begin
/*
** 17420, "Settable database options."
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.451 second using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )