DBIO-Sybase

 view release on metacpan or  search on metacpan

lib/DBIO/Sybase/Storage/ASE.pm  view on Meta::CPAN

  @{$updated_cols}{ keys %$lob_values } = values %$lob_values;

  # The DEFAULT literals insert wrote for an empty insert are not values of the
  # row: the object holds the primary key and reads the rest on demand, as
  # after create({}) on every other driver (karr k84).
  delete @{$updated_cols}{ keys %{ $defaulted || {} } };

  return $updated_cols;
}

sub update {
  my $self = shift;

  # the writer storage is made by _init, at the first connect (karr k67)
  $self->_get_dbh;

  my ($source, $fields, $where, @rest) = @_;

  # The hash is the caller's: _remove_blob_cols and the delete below work on a
  # copy, which is also what next::method gets (karr k83).
  $fields = { %$fields };

t/84-lob-populate-mixed.t  view on Meta::CPAN

{
  package T::K81::Schema;
  use base 'DBIO::Schema';
  __PACKAGE__->load_components('Sybase');
  __PACKAGE__->register_class(Lob => 'T::K81::Result::Lob');
}

sub reset_records { @EXECUTED = @SENT = () }

sub inserts { grep { $_->{sql} =~ /\bINSERT INTO\b/ } @EXECUTED }
sub updates { grep { $_->{sql} =~ /\bUPDATE\b/ } @EXECUTED }

sub values_of {
  my ($list) = $_[0] =~ /\bVALUES\s*\((.*)\)/;
  return [ map { s/\A\s+|\s+\z//gr } split /,/, $list // '' ];
}

sub set_of {
  my ($list) = $_[0] =~ /\bSET\s+(.*?)\s+WHERE\b/s;
  return [ map { s/\A\s+|\s+\z//gr } split /,/, $list // '' ];
}



( run in 1.869 second using v1.01-cache-2.11-cpan-145b269f2f3 )