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.
# File lib/sequel/adapters/fdbsql.rb, line 21 def connect(server) opts = server_opts(server) Connection.new(self, opts) end
Execute the given SQL with the given args on an available connection.
# File lib/sequel/adapters/fdbsql.rb, line 27 def execute(sql, opts = {}, &block) res = nil synchronize(opts[:server]) do |conn| res = check_database_errors do if sql.is_a?(Symbol) execute_prepared_statement(conn, sql, opts, &block) else log_yield(sql) do conn.query(sql, opts[:arguments]) end end end yield res if block_given? res.cmd_tuples end end
# File lib/sequel/adapters/fdbsql.rb, line 44 def server_version return @server_version if @server_version version = get{VERSION{}} unless ver = version.match(/(\d+)\.(\d+)\.(\d+)/) raise Error, "No match when checking FDB SQL Layer version: #{version}" end @server_version = (100 * ver[1].to_i + ver[2].to_i) * 100 + ver[3].to_i end
Generated with the Darkfish Rdoc Generator 2.