Class | Sequel::Fdbsql::Connection |
In: |
lib/sequel/adapters/fdbsql.rb
|
Parent: | PG::Connection |
Connection specific methods for Fdbsql with pg
DISCONNECT_ERROR_RE | = | /\A(?:could not receive data from server|no connection to the server|connection not open|connection is closed)/ | 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 213: def initialize(db, opts) 214: connect_opts = { 215: :host => opts[:host] || 'localhost', 216: :port => opts[:port] || 15432, 217: :dbname => opts[:database], 218: :user => opts[:user], 219: :password => opts[:password], 220: :hostaddr => opts[:hostaddr], 221: :connect_timeout => opts[:connect_timeout] || 20, 222: :sslmode => opts[:sslmode] 223: }.delete_if{|key, value| value.nil? or (value.respond_to?(:empty?) and value.empty?)} 224: super(connect_opts) 225: 226: @db = db 227: @prepared_statements = {} 228: 229: if opts[:notice_receiver] 230: set_notice_receiver(opts[:notice_receiver]) 231: else 232: # Swallow warnings 233: set_notice_receiver{|proc| } 234: end 235: end
Close the connection.
# File lib/sequel/adapters/fdbsql.rb, line 238 238: def close 239: super 240: rescue PGError, IOError 241: end
Execute the prepared statement of the given name, binding the given args.
# File lib/sequel/adapters/fdbsql.rb, line 252 252: def execute_prepared_statement(name, args) 253: check_disconnect_errors{exec_prepared(name, args)} 254: end
Prepare a statement for later use.
# File lib/sequel/adapters/fdbsql.rb, line 257 257: def prepare(name, sql) 258: check_disconnect_errors{super} 259: end