Connection specific methods for Fdbsql with pg
Regular expression for error messages that note that the connection is closed.
Create a new connection to the FoundationDB SQL Layer. See Database#connect.
# File lib/sequel/adapters/fdbsql.rb, line 213 def initialize(db, opts) connect_opts = { :host => opts[:host] || 'localhost', :port => opts[:port] || 15432, :dbname => opts[:database], :user => opts[:user], :password => opts[:password], :hostaddr => opts[:hostaddr], :connect_timeout => opts[:connect_timeout] || 20, :sslmode => opts[:sslmode] }.delete_if{|key, value| value.nil? or (value.respond_to?(:empty?) and value.empty?)} super(connect_opts) @db = db @prepared_statements = {} if opts[:notice_receiver] set_notice_receiver(opts[:notice_receiver]) else # Swallow warnings set_notice_receiver{|proc| } end end
Close the connection.
# File lib/sequel/adapters/fdbsql.rb, line 238 def close super rescue PGError, IOError end
Execute the given SQL with this connection. If a block is given, yield the results, otherwise, return the number of changed rows.
# File lib/sequel/adapters/fdbsql.rb, line 245 def execute(sql, args=nil) q = query(sql, args) block_given? ? yield(q) : q.cmd_tuples end
Execute the prepared statement of the given name, binding the given args.
# File lib/sequel/adapters/fdbsql.rb, line 252 def execute_prepared_statement(name, args) check_disconnect_errors{exec_prepared(name, args)} end
Generated with the Darkfish Rdoc Generator 2.