[Bast-commits] r8490 -
DBIx-Class/0.08/branches/sybase_computed_columns/lib/DBIx/Class/Storage/DBI/Sybase
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Sun Jan 31 12:39:32 GMT 2010
Author: caelum
Date: 2010-01-31 12:39:32 +0000 (Sun, 31 Jan 2010)
New Revision: 8490
Modified:
DBIx-Class/0.08/branches/sybase_computed_columns/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm
Log:
add POD about computed columns and timestamps for Sybase
Modified: DBIx-Class/0.08/branches/sybase_computed_columns/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm
===================================================================
--- DBIx-Class/0.08/branches/sybase_computed_columns/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm 2010-01-31 12:18:33 UTC (rev 8489)
+++ DBIx-Class/0.08/branches/sybase_computed_columns/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm 2010-01-31 12:39:32 UTC (rev 8490)
@@ -1102,6 +1102,42 @@
When inserting IMAGE columns using this method, you'll need to use
L</connect_call_blob_setup> as well.
+=head1 COMPUTED COLUMNS
+
+If you have columns such as:
+
+ created_dtm AS getdate()
+
+represent them in your Result classes as:
+
+ created_dtm => {
+ data_type => undef,
+ default_value => \'getdate()',
+ is_nullable => 0,
+ }
+
+The C<data_type> must exist and must be C<undef>. Then empty inserts will work
+on tables with such columns.
+
+=head1 TIMESTAMP COLUMNS
+
+C<timestamp> columns in Sybase ASE are not really timestamps, see:
+L<http://dba.fyicenter.com/Interview-Questions/SYBASE/The_timestamp_datatype_in_Sybase_.html>.
+
+They should be defined in your Result classes as:
+
+ ts => {
+ data_type => 'timestamp',
+ is_nullable => 0,
+ inflate_datetime => 0,
+ }
+
+The C<<inflate_datetime => 0>> is necessary if you use
+L<DBIx::Class::InflateColumn::DateTime>, and most people do, and still want to
+be able to read these values.
+
+The values will come back as hexadecimal.
+
=head1 TODO
=over
More information about the Bast-commits
mailing list