The Firebird adapter relies on the FireRuby extension,
version 0.4.0 or later (available as a gem or from RubyForge. FireRuby works with Firebird 1.5.x on Linux, OS
X and Win32 platforms.

Usage Notes

Sequence (Generator) Names

The Firebird adapter supports the same approach adopted for the Oracle
adapter. See ActiveRecord::Base#set_sequence_name for more details.

Note that in general there is no need to create a BEFORE INSERT
trigger corresponding to a Firebird sequence generator when using ActiveRecord. In other words, you
don’t have to try to make Firebird simulate an
AUTO_INCREMENT or IDENTITY column. When saving a new
record, ActiveRecord pre-fetches the next
sequence value for the table and explicitly includes it in the
INSERT statement. (Pre-fetching the next primary key value is the
only reliable method for the Firebird adapter to report back the
id after a successful insert.)

BOOLEAN Domain

Firebird 1.5 does not provide a native BOOLEAN type. But you can
easily define a BOOLEANdomain for this purpose, e.g.:

CREATEDOMAIND_BOOLEANASSMALLINTCHECK(VALUEIN(0,1));

When the Firebird adapter encounters a column that is based on a domain
that includes "BOOLEAN" in the domain name, it will attempt to
treat the column as a BOOLEAN.

By default, the Firebird adapter will assume that the BOOLEAN domain is
defined as above. This can be modified if needed. For example, if you have
a legacy schema with the following BOOLEAN domain defined:

BLOB Elements

The Firebird adapter currently provides only limited support for
BLOB columns. You cannot currently retrieve or insert a
BLOB as an IO stream. When selecting a BLOB, the entire
element is converted into a String. When
inserting or updating a BLOB, the entire value is included in-line
in the SQL statement, limiting you to values <= 32KB in size.

The standard practice is to use unquoted column names, which can be thought
of as case-insensitive. (In fact, Firebird converts them to uppercase.)
Quoted column names (not typically used) are case-sensitive.

Attribute accessors corresponding to column names are case-sensitive. The
defaults for primary key and inheritance columns are lowercase, and in
general, people use lowercase attribute names.

In order to map between the differing semantics in a way that conforms to
common usage for both Firebird and ActiveRecord, uppercase column names in
Firebird are converted to lowercase attribute names in ActiveRecord, and vice-versa. Mixed-case
column names retain their case in both directions. Lowercase (quoted)
Firebird column names are not supported. This is similar to the solutions
adopted by other adapters.

In general, the best approach is to use unqouted (case-insensitive) column
names in your Firebird DDL (or if you must quote, use uppercase column
names). These will correspond to lowercase attributes in ActiveRecord.

In <a href="/rails/ActiveRecord">ActiveRecord,</a>
the default inheritance column name is type. The word
type is a Firebird reserved word, so it must be quoted in any
Firebird SQL statements. Because of the case mapping described above, you
should always reference this column using quoted-uppercase syntax
("TYPE") within Firebird DDL or other SQL statements (as
in the example above). This holds true for any other Firebird reserved
words used as column names as well.

Migrations

The Firebird adapter does not currently support Migrations. I hope to add
this feature in the near future.

Connection Options

The following options are supported by the Firebird adapter. None of the
options have default values.

:database:

Required option. Specifies one of: (i) a Firebird database alias;
(ii) the full path of a database file; or (iii) a full Firebird
connection string. Do not specify :host,:service or
:port as separate options when using a full connection
string.

:host:

Set to "remote.host.name" for remote database
connections. May be omitted for local connections if a full database path
is specified for :database. Some platforms require a value of
"localhost" for local connections when using a Firebird
database alias.

:service:

Specifies a service name for the connection. Only used if :host is
provided. Required when connecting to a non-standard service.

:port:

Specifies the connection port. Only used if :host is provided and
:service is not. Required when connecting to a non-standard port
and :service is not defined.

:username:

Specifies the database user. May be omitted or set to nil
(together with :password) to use the underlying operating system
user credentials on supported platforms.

:password:

Specifies the database password. Must be provided if :username is
explicitly specified; should be omitted if OS user credentials are are
being used.

:charset:

Specifies the character set to be used by the connection. Refer to Firebird
documentation for valid options.