delete
select
select_single
+ with_deferred_fk_checks
get_use_dbms_capability
get_dbms_capability
=head3 DBIx::Class specific connection attributes
-In addition to the standard L<DBI|DBI/ATTRIBUTES_COMMON_TO_ALL_HANDLES>
-L<connection|DBI/Database_Handle_Attributes> attributes, DBIx::Class recognizes
+In addition to the standard L<DBI|DBI/ATTRIBUTES COMMON TO ALL HANDLES>
+L<connection|DBI/Database Handle Attributes> attributes, DBIx::Class recognizes
the following connection options. These options can be mixed in with your other
L<DBI> connection attributes, or placed in a separate hashref
(C<\%extra_attributes>) as shown above.
# as a new txn is started immediately on commit
$self->transaction_depth(1) if (
!$self->transaction_depth
- and
+ and
defined $self->_dbh_autocommit
and
! $self->_dbh_autocommit
# as a new txn is started immediately on commit
$self->transaction_depth(1) if (
!$self->transaction_depth
- and
+ and
defined $self->_dbh_autocommit
and
! $self->_dbh_autocommit
# easier to override in NoBindVars without duping the rest. It takes up
# all of _execute's args, and emits $sql, @bind.
sub _prep_for_execute {
+ #my ($self, $op, $ident, $args) = @_;
+ return shift->_gen_sql_bind(@_)
+}
+
+sub _gen_sql_bind {
my ($self, $op, $ident, $args) = @_;
my ($sql, @bind) = $self->sql_maker->$op(
}];
}
+ if ($op eq 'select'
+ && first { blessed($_->[1]) && $_->[1]->isa('DateTime') } @final_bind) {
+
+ carp_unique 'DateTime objects passed to search() are not supported '
+ . 'properly (InflateColumn::DateTime formats and settings are not '
+ . 'respected.) See "Formatting DateTime objects in queries" in '
+ . 'DBIx::Class::Manual::Cookbook';
+ }
+
($sql, \@final_bind);
}
$_->{dbd_attrs}
}
elsif($_->{sqlt_datatype}) {
- $self->bind_attribute_by_data_type($_->{sqlt_datatype}) || undef;
+ # cache the result in the dbh_details hash, as it can not change unless
+ # we connect to something else
+ my $cache = $self->_dbh_details->{_datatype_map_cache} ||= {};
+ if (not exists $cache->{$_->{sqlt_datatype}}) {
+ $cache->{$_->{sqlt_datatype}} = $self->bind_attribute_by_data_type($_->{sqlt_datatype}) || undef;
+ }
+ $cache->{$_->{sqlt_datatype}};
}
elsif ($sba_attrs and $_->{dbic_colname}) {
$sba_attrs->{$_->{dbic_colname}} || undef;
my ($op, $ident, @args) =
$self->_select_args(@_);
- # my ($sql, $prepared_bind) = $self->_prep_for_execute($op, $ident, [ $select, $cond, $rs_attrs, $rows, $offset ]);
- my ($sql, $prepared_bind) = $self->_prep_for_execute($op, $ident, \@args);
+ # my ($sql, $prepared_bind) = $self->_gen_sql_bind($op, $ident, [ $select, $cond, $rs_attrs, $rows, $offset ]);
+ my ($sql, $prepared_bind) = $self->_gen_sql_bind($op, $ident, \@args);
$prepared_bind ||= [];
return wantarray
to L<DBIx::Class::Schema/connect>. For a list of available limit dialects
see L<DBIx::Class::SQLMaker::LimitDialects>.
-=head2 sth
-
-=over 4
-
-=item Arguments: $sql
-
-=back
-
-Returns a L<DBI> sth (statement handle) for the supplied SQL.
-
=cut
sub _dbh_sth {
if ($data_type =~ /^(?:
l? (?:var)? char(?:acter)? (?:\s*varying)?
|
- (?:var)? binary (?:\s*varying)?
+ (?:var)? binary (?:\s*varying)?
|
raw
)\b/x