Skip to content

RDBI/rdbi-driver-rubyfb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rdbi-dbd-rubyfb

An RDBI driver for Firebird databases using the rubyfb bindings by George Georgiev.

Project home

github.com/pilcrow/rdbi-driver-rubyfb

Related software

Tested configuration(s)

ruby 1.9.2, Firebird 2.1.3, RDBI 0.9.1 and rubyfb 0.5.5.

Should work under ruby 1.8.7, as well. Firebird >= 1.5 needed (for CASE support under the hood).

Driver Quirks, Incompleteness and Brokenness

Result Sets

By default, rewindable_result is false and query result sets are “forward only” iterables, such that any attempt to look behind the current fetch index is an error.

If rewindable_result is true, rdbi-driver-rubyfb provides fully rewindable (and, indeed, random access) cursors which have the side effect of reading the entire result set into memory.

Transactions

  • “Manual commit” only There is no autocommit mode at present. This may change in a future release, but you should use explicit transactions anyway.

  • Transactional DDL requires commit Firebird supports transactional DDL like other industrial databases. However, DDL statements must be committed before their effects are visible to subsequent DML/query statements.

    For example, this won’t work:

    dbh.transaction do
      dbh.execute('create table TBL (I integer not null)')
      dbh.execute('insert into TBL (I) values (?)', 1) # Error: "TBL" not yet
                                                       # visible
    end
    

    Instead do this:

    dbh.transaction do
      dbh.execute('create table ...')
      ... other DML ...
    end
    dbh.transaction do
      dbh.execute('insert into ...')
    end

Types

  • Fixed-length CHAR fields are automatically right-trimmed. Firebird and Interbase databases pad CHAR columns with spaces. (In strict SQL trailing spaces are ignored on string comparisons, so ‘foo ’ = ‘foo’.)

  • TIMESTAMPs are understood _in the local time zone_ There is currently no way to override this.

  • BOOLEANs perhaps not supported Not all Firebird/Interbase databases offer a native BOOLEAN type, instead using CHAR(1) or SMALLINT flags, or user-defined SQL DOMAINs. Firebird 3.0 offers a BOOLEAN type.

RDBI Compliance

  • table_schema does not yet support default column values

Running tests

Tests make use of the RDBI::DBRC role ‘rubyfb_test’ to test against a local database. On a *NIX system, your ~/.dbrc might look like this:

rubyfb_test:
  driver: Rubyfb
  user: SYSDBA        # $ISC_USER, if omitted
  password: masterkey # $ISC_PASSWORD, if omitted
  database: employee

Copyright © 2011 Michael Pomraning. See LICENSE for details.

Releases

No releases published

Packages

No packages published

Languages