DBIx-Class

 view release on metacpan or  search on metacpan

lib/DBIx/Class/Storage/DBI/ADO/Microsoft_SQL_Server.pm  view on Meta::CPAN

    set => 8000,

# Pg types
    serial => 100,
    bigserial => 100,
    int8 => 100,
    integer8 => 100,
    serial8 => 100,
    int4 => 100,
    integer4 => 100,
    serial4 => 100,
    int2 => 100,
    integer2 => 100,
    float8 => 100,
    float4 => 100,
    'bit varying' => 8000,
    'varbit' => 8000,
    inet => 100,
    cidr => 100,
    macaddr => 100,
    'time without time zone' => 100,
    'time with time zone' => 100,
    'timestamp without time zone' => 100,
    'timestamp with time zone' => 100,
    bytea => $lob_max,

# DB2 types
    graphic => 8000,
    vargraphic => 8000,
    'long vargraphic' => $lob_max,
    dbclob => $lob_max,
    clob => $lob_max,
    'char for bit data' => 8000,
    'varchar for bit data' => 8000,
    'long varchar for bit data' => $lob_max,

# oracle types
    varchar2 => 8000,
    binary_float => 100,
    binary_double => 100,
    raw => 8000,
    nclob => $lob_max,
    long => $lob_max,
    'long raw' => $lob_max,
    'timestamp with local time zone' => 100,

# Sybase ASE types
    unitext => $lob_max,
    unichar => 16000,
    univarchar => 16000,

# SQL Anywhere types
    'long varbit' => $lob_max,
    'long bit varying' => $lob_max,
    uniqueidentifierstr => 100,
    'long binary' => $lob_max,
    'long varchar' => $lob_max,
    'long nvarchar' => $lob_max,

# Firebird types
    'char(x) character set unicode_fss' => 16000,
    'varchar(x) character set unicode_fss' => 16000,
    'blob sub_type text' => $lob_max,
    'blob sub_type text character set unicode_fss' => $lob_max,

# Informix types
    smallfloat => 100,
    byte => $lob_max,
    lvarchar => 8000,
    'datetime year to fraction(5)' => 100,
    # FIXME add other datetime types

# MS Access types
    autoincrement => 100,
    long => 100,
    integer4 => 100,
    integer2 => 100,
    integer1 => 100,
    logical => 100,
    logical1 => 100,
    yesno => 100,
    currency => 100,
    single => 100,
    ieeesingle => 100,
    ieeedouble => 100,
    number => 100,
    string => 8000,
    guid => 100,
    longchar => $lob_max,
    memo => $lob_max,
    longbinary => $lob_max,
  }
}

package # hide from PAUSE
  DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::DateTime::Format;

my $datetime_format = '%m/%d/%Y %I:%M:%S %p';
my $datetime_parser;

sub parse_datetime {
  shift;
  require DateTime::Format::Strptime;
  $datetime_parser ||= DateTime::Format::Strptime->new(
    pattern  => $datetime_format,
    on_error => 'croak',
  );
  return $datetime_parser->parse_datetime(shift);
}

sub format_datetime {
  shift;
  require DateTime::Format::Strptime;
  $datetime_parser ||= DateTime::Format::Strptime->new(
    pattern  => $datetime_format,
    on_error => 'croak',
  );
  return $datetime_parser->format_datetime(shift);
}

=head1 FURTHER QUESTIONS?

Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.



( run in 1.447 second using v1.01-cache-2.11-cpan-39bf76dae61 )