Introduce columns_info, switch a large portion of the code over
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Sybase / ASE.pm
index 1022cc2..dbbee6f 100644 (file)
@@ -16,6 +16,8 @@ use Data::Dumper::Concise 'Dumper';
 use Try::Tiny;
 use namespace::clean;
 
+__PACKAGE__->sql_limit_dialect ('RowCountOrGenericSubQ');
+
 __PACKAGE__->mk_group_accessors('simple' =>
     qw/_identity _blob_log_on_update _writer_storage _is_extra_storage
        _bulk_storage _is_bulk_storage _began_bulk_work
@@ -83,8 +85,8 @@ To turn off this warning set the DBIC_SYBASE_FREETDS_NOWARN environment
 variable.
 EOF
 
-    if (not $self->_typeless_placeholders_supported) {
-      if ($self->_placeholders_supported) {
+    if (not $self->_use_typeless_placeholders) {
+      if ($self->_use_placeholders) {
         $self->auto_cast(1);
       }
       else {
@@ -102,7 +104,7 @@ EOF
     $self->_rebless;
   }
   # this is highly unlikely, but we check just in case
-  elsif (not $self->_typeless_placeholders_supported) {
+  elsif (not $self->_use_typeless_placeholders) {
     $self->auto_cast(1);
   }
 }
@@ -152,16 +154,6 @@ for my $method (@also_proxy_to_extra_storages) {
   };
 }
 
-sub _sql_maker_opts {
-  my ( $self, $opts ) = @_;
-
-  if ( $opts ) {
-    $self->{_sql_maker_opts} = { %$opts };
-  }
-
-  return { limit_dialect => 'RowCountOrGenericSubQ', %{$self->{_sql_maker_opts}||{}} };
-}
-
 sub disconnect {
   my $self = shift;
 
@@ -270,7 +262,7 @@ sub _prep_for_execute {
   ;
   my $identity_col =
     blessed $ident &&
-    first { $ident->column_info($_)->{is_auto_increment} } $ident->columns
+    first { $_->{is_auto_increment} } values %{ $ident->columns_info }
   ;
 
   if (($op eq 'insert' && $bound_identity_col) ||
@@ -359,7 +351,7 @@ sub insert {
   my ($source, $to_insert) = @_;
 
   my $identity_col =
-    (first { $source->column_info($_)->{is_auto_increment} } $source->columns)
+    (first { $_->{is_auto_increment} } values %{ $source->columns_info } )
     || '';
 
   # check for empty insert
@@ -444,7 +436,7 @@ sub update {
   my $table = $source->name;
 
   my $identity_col =
-    first { $source->column_info($_)->{is_auto_increment} } $source->columns;
+    first { $_->{is_auto_increment} } values %{ $source->columns_info };
 
   my $is_identity_update = $identity_col && defined $fields->{$identity_col};
 
@@ -494,7 +486,7 @@ sub insert_bulk {
   my ($source, $cols, $data) = @_;
 
   my $identity_col =
-    first { $source->column_info($_)->{is_auto_increment} } $source->columns;
+    first { $_->{is_auto_increment} } values %{ $source->columns_info };
 
   my $is_identity_insert = (first { $_ eq $identity_col } @{$cols}) ? 1 : 0;
 
@@ -1160,7 +1152,7 @@ Real limits and limited counts using stored procedures deployed on startup.
 
 =item *
 
-Adaptive Server Anywhere (ASA) support, with possible SQLA::Limit support.
+Adaptive Server Anywhere (ASA) support
 
 =item *