Class Sequel::Fdbsql::Database
In: lib/sequel/adapters/fdbsql.rb
Parent: Sequel::Database

Database class for the FoundationDB SQL Layer used with Sequel and the pg driver

Methods

Included Modules

Sequel::Fdbsql::DatabaseMethods

Public Instance methods

Connects to the database. In addition to the standard database options, :connect_timeout is a connection timeout in seconds, :sslmode sets whether to use ssl, and :notice_receiver handles server notices in a proc.

[Source]

    # File lib/sequel/adapters/fdbsql.rb, line 21
21:       def connect(server)
22:         opts = server_opts(server)
23:         Connection.new(self, opts)
24:       end

Execute the given SQL with the given args on an available connection.

[Source]

    # File lib/sequel/adapters/fdbsql.rb, line 27
27:       def execute(sql, opts = {}, &block)
28:         res = nil
29:         synchronize(opts[:server]) do |conn|
30:           res = check_database_errors do
31:             if sql.is_a?(Symbol)
32:               execute_prepared_statement(conn, sql, opts, &block)
33:             else
34:               log_yield(sql) do
35:                 conn.query(sql, opts[:arguments])
36:               end
37:             end
38:           end
39:           yield res if block_given?
40:           res.cmd_tuples
41:         end
42:       end

[Source]

    # File lib/sequel/adapters/fdbsql.rb, line 44
44:       def server_version
45:         return @server_version if @server_version
46: 
47:         version = get{VERSION{}}
48:         unless ver = version.match(/(\d+)\.(\d+)\.(\d+)/)
49:           raise Error, "No match when checking FDB SQL Layer version: #{version}"
50:         end
51: 
52:         @server_version = (100 * ver[1].to_i + ver[2].to_i) * 100 + ver[3].to_i
53:       end

[Validate]