Scroll to navigation

FirebirdEmbedded(3pm) User Contributed Perl Documentation FirebirdEmbedded(3pm)


DBD::FirebirdEmbedded - embedded Firebird server (and client)


  use DBI;
  $dbh = DBI->connect("dbi:FirebirdEmbedded:db=$dbname", undef, undef);
  # See the DBI module documentation for full details


DBD::FirebirdEmbedded is a variant of DBD::Firebird, linked with the Firebird embedded library, libfbembed. In addition to the ability to work with remote Firebird servers (which DBD::FirebirdEmbedded has, being linked with the Firebird client library, libfbclient), DBD::FirebirdEmbedded can be used to work with Firebird databases without the need of a dedicated Firebird server.

The following things should be set up first:

These should be unset. Both in the "DBI->connection(...)" call and in the environment ("ISC_USER", "ISC_PASSWORD", "DBI_USER", "DBI_PASSWORD" variables).
The "FIREBIRD_LOCK" environment variable should be set to some place where the process can write. Note that if you plan for several processes to access the database file directly, they all should have "FIREBIRD_LOCK" set to the same directory, or else database corruption will occur.
Obviously, do not set any host when calling "DBI->connection(...)", not even "localhost".
Obviously, the process needs to be able to read/write the database file.


DBD::FirebirdEmbedded provides exactly the same functionality as the Firebird server of the same version as the libfbembed library. It still can work with remote datases, in which case the use is exactly the same (DSN, environment) as with the regular DBD::Firebird.


No need to setup/administer a Firebird server. All the server functionality is available via the libfbembed library. Shared access to databases is still possible (but read "Firebird lock directory" above).
Working directly with the database file eliminates possible network delays (even if the server is on the local host).


The libfbembed library contains a fully functional Firebird server and is therefore bigger than the ordinary client library, libfbclient.
It is very important to make sure that all processes that access a given database use the same lock directory. See "Firebird lock directory" above.


2022-10-20 perl v5.36.0