Module: Sequel::Fdbsql::DatasetMethods::PreparedStatementMethods

Included in:
Sequel::Fdbsql::Dataset::BindArgumentMethods
Defined in:
lib/sequel/adapters/shared/fdbsql.rb

Overview

Shared methods for prepared statements used with the FoundationDB SQL Layer

Instance Method Summary collapse

Instance Method Details

#prepared_sqlObject



408
409
410
411
412
413
# File 'lib/sequel/adapters/shared/fdbsql.rb', line 408

def prepared_sql
  return @prepared_sql if @prepared_sql
  @opts[:returning] = insert_pk if @prepared_type == :insert
  super
  @prepared_sql
end

#runObject

Override insert action to use RETURNING if the server supports it.



416
417
418
419
420
421
422
# File 'lib/sequel/adapters/shared/fdbsql.rb', line 416

def run
  if @prepared_type == :insert
    fetch_rows(prepared_sql){|r| return r.values.first}
  else
    super
  end
end