Class | Sequel::Firebird::Database
In: | lib/sequel/adapters/firebird.rb
Parent: | Sequel::Database

### Methods

connect execute new

### Included Modules

Sequel::Firebird::DatabaseMethods

### Constants

DISCONNECT_ERRORS | = | /Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements/

### Public Class methods

new(*args)

Add the primary_keys instance variables. so we can get the correct return values for inserted rows.

[Source]

        # File lib/sequel/adapters/firebird.rb, line 17
    17:       def initialize(*args)
    18:         super
    19:         @primary_keys = {}
    20:       end

### Public Instance methods

connect(server)

[Source]

        # File lib/sequel/adapters/firebird.rb, line 22
    22:       def connect(server)
    23:         opts = server_opts(server)
    24:
    25:         Fb::Database.new(
    26:           :database => "#{opts[:host]}:#{opts[:database]}",
    27:           :username => opts[:user],
    28:           :password => opts[:password]).connect
    29:       end

execute(sql, opts={}) {|r| ...}

[Source]

        # File lib/sequel/adapters/firebird.rb, line 31
    31:       def execute(sql, opts={})
    32:         begin
    33:           synchronize(opts[:server]) do |conn|
    34:             if conn.transaction_started && !@transactions.has_key?(conn)
    35:               conn.rollback
    36:               raise DatabaseDisconnectError, "transaction accidently left open, rolling back and disconnecting"
    37:             end
    38:             r = log_yield(sql){conn.execute(sql)}
    39:             yield(r) if block_given?
    40:             r
    41:           end
    42:         rescue Fb::Error => e
    43:           raise_error(e, :disconnect=>DISCONNECT_ERRORS.match(e.message))
    44:         end
    45:       end

[Validate]