DBIO-Firebird

 view release on metacpan or  search on metacpan

lib/DBIO/Firebird/Storage/InterBase.pm  view on Meta::CPAN

=item * C<db=host[/port]:path> (also C<dbname=>, C<database=>): the prefix of
the database name is replaced;

=item * C<host=h[/port]> or C<hostname=h>, with the port inside the host or in
C<port=>: replaced where it stands. A view port goes to C<port=>; a view
without a port leaves the answer's;

=item * a local database name: C<host=> (and C<port=>) are put in front.

=back

It declines, naming the form and never a value of the DSN, a part that is not
C<key=value>, a host named both in the database name and in C<host=>, more than
one database or host key, a URL-style database name (C<inet://...>), a
service name where a port stands (C<db=host/service:path>, and C<host=h/service>
when the view brings no port to take its place: the service would drop out of
the DSN without a word), an IPv6 database name (C<db=[::1]:path>), a
drive-relative path (C<db=C:data.fdb>, neither a host nor an absolute local
path), a view host with a colon, slash or space in it, and a DSN of any other
DBD. The ODBC
storage declines every DSN: its driver takes the server inside
C<DBNAME=host/port:path>.

=head1 METHODS

=head2 connect_call_use_softcommit

Used as:

  on_connect_call => 'use_softcommit'

In L<connect_info|DBIO::Storage::DBI/connect_info> to set the
L<DBD::InterBase> C<ib_softcommit> option.

With it L<DBD::Firebird> commits and rolls back I<retaining>, and a cursor that
still has rows to fetch stays open across the commits of other statements on
the connection. Without it the first such commit closes it, and the next fetch
dies with C<Cursor is not open>; C<< disable_sth_caching => 1 >> does not
change that.

Neither setting keeps a cursor open across the commit that follows DDL: see
L</Statements the DBD destroys>.

The downside of using this option is that your process will B<NOT> see UPDATEs,
INSERTs and DELETEs from other processes for already open statements.

=head2 connect_call_datetime_setup

Used as:

  on_connect_call => 'datetime_setup'

In L<connect_info|DBIO::Storage::DBI/connect_info> to set the date and
timestamp formats using:

  $dbh->{ib_time_all} = 'ISO';

Every connection of this storage does that by itself, before the
caller's C<on_connect_*> actions run: without it L<DBD::Firebird> reads a
timestamp back in the locale's C<%c> format ("Mon 19 Oct 2026 04:43:18 AM
CET"), which the parser of this driver does not expect. This call does the
same and is harmless twice; an action of your own that sets another
C<ib_time_all> comes after the default and wins.

See L<DBD::InterBase> for more details.

The C<TIMESTAMP> data type supports up to 4 digits after the decimal point for
second precision. The full precision is used.

The C<DATE> data type stores the date portion only, and it B<MUST> be declared
with:

  data_type => 'date'

in your Result class.

Timestamp columns can be declared with either C<datetime> or C<timestamp>.

Datetime inflation is handled by L<DBIO::Firebird::DateTime::Format> (a
L<DBIO::Storage::DateTimeFormat> subclass backed by L<DateTime::Format::Strptime>),
which loads L<DateTime::Format::Strptime> when a datetime column is first
inflated. It is a recommended, not a required, dependency of this
distribution: install it to use datetime columns.

For L<DBIO::Firebird::Storage::ODBC>, this is a noop.

=head1 CAVEATS

=over 4

=item *

with L</connect_call_use_softcommit>, you will not be able to see changes made
to data in other processes. If this is an issue, do without it and do not keep
a cursor open across another statement's commit: fetch the rows first.
L<disable_sth_caching|DBIO::Storage::DBI/disable_sth_caching> is no workaround
for that: a cursor is closed by the commit whether or not its statement came
out of the cache.

=item *

a cursor that is still open does not survive the commit that follows DDL on the
same connection, nor, without L</connect_call_use_softcommit>, a rollback
inside a transaction. See L</Statements the DBD destroys>.

=back

=head1 SEE ALSO

=over

=item * L<DBIO::Firebird> - Firebird schema component

=item * L<DBIO::Firebird::Storage> - Firebird driver via L<DBD::Firebird>

=item * L<DBIO::Firebird::Storage::Common> - Shared Firebird/InterBase logic

=item * L<DBIO::Firebird::Storage::ODBC> - Firebird via L<DBD::ODBC>

=item * L<DBIO::Storage::DBI> - Base DBI storage class



( run in 1.254 second using v1.01-cache-2.11-cpan-1bcd28dbaf1 )