CPAN RT

# In your configuration:
'myspops' => {
'isa' => [ qw/ SPOPS::DBI::InterBase SPOPS::DBI / ],
# If you use a generator to create unique keys, set
# increment_field to a true value...
'increment_field' => 1,
# and set 'sequence_name' to the name of the generator
'sequence_name' => 'mygen',
# ...optionally, you can also specify the increment for the
# generated values (defaults to 1 if not specified)
'sequence_increment' => 4,
...
},

This just implements some InterBase-specific routines so we can abstract them out.

The main one is to be able to utilize an existing generator object for creating unique key values. We cannot use the same pattern as with Oracle/PostgreSQL sequences because there does not seem to be a way to retrieve the current (rather than next) value from a generator object.

Therefore, we need to retrieve the next value from the database and use that in the INSERT. (This happens in the background, no worry to you.)

You must to let this module know if you are using this option by setting in your class configuration the key 'increment_field' to a true value and also setting key 'sequence_name' to the name of your generator.

Returns 'CURRENT_TIMESTAMP', used in InterBase to return the value for right now.

TODO: See how this is used and whether we need to add another methods for executing this as a standalone statement ('SELECT CURRENT_TIMESTAMP' on its own does not work.)

sql_case_insensitive()

Returns 'LIKE' right now, even though this does not seem to be correct.

TODO: See if there is a separate operator for case-insensitive matching.

sql_quote( $value, $data_type, [ $db_handle ] )

DBD::InterBase uses the type of a field if you are quoting values to put into a statement, so we override the default 'sql_quote' from SPOPS::SQLInterface to ensure the type of the field is used in the DBI->quote call.

The $data_type should correspond to one of the DBI datatypes (see the file 'dbi_sql.h' in your Perl library tree for more info). If the DBI database handle $db_handle is not passed in, we try to find it with the class method global_datasource_handle().

pre_fetch_id( \%params )

If 'increment_field' is not set we do not fetch an ID. If 'sequence_name' is not also set we do not fetch an ID. Otherwise we execute a statement like: