Revision history for DBIx::Class
+ - Complete Sybase RDBMS support including:
+ - Support for TEXT/IMAGE columns
+ - Support for the 'money' datatype
+ - Transaction savepoints support
- - Support for bind variables when connecting via Sybase OpenClient
++ - Support for bind variables when connecting to a newer Sybase with
++ OpenClient libraries
++ - Support for bind variables over FreeTDS with CASTs when needed
+ - Support for interpolated variables with proper quoting when
- connecting via FreeTDS
++ connecting to an older Sybase or via FreeTDS
+ - Fixed a complex prefetch + regular join regression introduced
+ in 0.08108
+ - SQLT related fixes:
+ - sqlt_type is now called on the correct storage object
+ - hooks can now see the correct producer_type
+ - POD improvements
0.08109 2009-08-18 08:35:00 (UTC)
- Replication updates:
$self->dbh_do('_dbh_last_insert_id', @_);
}
- =head2 sqlt_type
+ =head2 _native_data_type
- Returns the database driver name.
+ =over 4
- =cut
+ =item Arguments: $type_name
+
+ =back
+
+ This API is B<EXPERIMENTAL>, will almost definitely change in the future, and
+ currently only used by L<::AutoCast|DBIx::Class::Storage::DBI::AutoCast> and
+ L<::Sybase|DBIx::Class::Storage::DBI::Sybase>.
+
+ The default implementation returns C<undef>, implement in your Storage driver if
+ you need this functionality.
- sub sqlt_type { shift->_get_dbh->{Driver}->{Name} }
+ Should map types from other databases to the native RDBMS type, for example
+ C<VARCHAR2> to C<VARCHAR>.
+ Types with modifiers should map to the underlying data type. For example,
+ C<INTEGER AUTO_INCREMENT> should become C<INTEGER>.
+
+ Composite types should map to the container type, for example
+ C<ENUM(foo,bar,baz)> becomes C<ENUM>.
+
+ =cut
+
+ sub _native_data_type {
+ #my ($self, $data_type) = @_;
+ return undef
+ }
+# Check if placeholders are supported at all
+sub _placeholders_supported {
+ my $self = shift;
+ my $dbh = $self->_get_dbh;
+
+ # some drivers provide a $dbh attribute (e.g. Sybase and $dbh->{syb_dynamic_supported})
+ # but it is inaccurate more often than not
+ eval {
+ local $dbh->{PrintError} = 0;
+ local $dbh->{RaiseError} = 1;
+ $dbh->do('select ?', {}, 1);
+ };
+ return $@ ? 0 : 1;
+}
+
+# Check if placeholders bound to non-string types throw exceptions
+#
+sub _typeless_placeholders_supported {
+ my $self = shift;
+ my $dbh = $self->_get_dbh;
+
+ eval {
+ local $dbh->{PrintError} = 0;
+ local $dbh->{RaiseError} = 1;
+ # this specifically tests a bind that is NOT a string
+ $dbh->do('select 1 where 1 = ?', {}, 1);
+ };
+ return $@ ? 0 : 1;
+}
+
+ =head2 sqlt_type
+
+ Returns the database driver name.
+
+ =cut
+
+ sub sqlt_type {
+ my ($self) = @_;
+
+ if (not $self->_driver_determined) {
+ $self->_determine_driver;
+ goto $self->can ('sqlt_type');
+ }
+
+ $self->_get_dbh->{Driver}->{Name};
+ }
=head2 bind_attribute_by_data_type