Class/Module Index [+]

Quicksearch

Sequel::Fdbsql::DatasetMethods

Instance methods for datasets that connect to the FoundationDB SQL Layer.

Public Instance Methods

complex_expression_sql_append(sql, op, args) click to toggle source

Emulate the bitwise operators.

# File lib/sequel/adapters/shared/fdbsql.rb, line 426
def complex_expression_sql_append(sql, op, args)
  case op
  when :&, :|, :^, :<<, :>>, :'B~'
    complex_expression_emulate_append(sql, op, args)
  # REGEXP_OPERATORS = [:~, :'!~', :'~*', :'!~*']
  when :'~'
    function_sql_append(sql, SQL::Function.new(:REGEX, args.at(0), args.at(1)))
  when :'!~'
    sql << Sequel::Dataset::NOT_SPACE
    function_sql_append(sql, SQL::Function.new(:REGEX, args.at(0), args.at(1)))
  when :'~*'
    function_sql_append(sql, SQL::Function.new(:IREGEX, args.at(0), args.at(1)))
  when :'!~*'
    sql << Sequel::Dataset::NOT_SPACE
    function_sql_append(sql, SQL::Function.new(:IREGEX, args.at(0), args.at(1)))
  else
    super
  end
end
insert(*values) click to toggle source

Insert given values into the database.

# File lib/sequel/adapters/shared/fdbsql.rb, line 447
def insert(*values)
  if @opts[:returning]
    # Already know which columns to return, let the standard code handle it
    super
  elsif @opts[:sql] || @opts[:disable_insert_returning]
    # Raw SQL used or RETURNING disabled, just use the default behavior
    # and return nil since sequence is not known.
    super
    nil
  else
    # Force the use of RETURNING with the primary key value,
    # unless it has been disabled.
    returning(*insert_pk).insert(*values){|r| return r.values.first}
  end
end
insert_select(*values) click to toggle source

Insert a record returning the record inserted. Always returns nil without inserting a query if disable_insert_returning is used.

# File lib/sequel/adapters/shared/fdbsql.rb, line 465
def insert_select(*values)
  unless @opts[:disable_insert_returning]
    ds = opts[:returning] ? self : returning
    ds.insert(*values){|r| return r}
  end
end
insert_select_sql(*values) click to toggle source

The SQL to use for an insert_select, adds a RETURNING clause to the insert unless the RETURNING clause is already present.

# File lib/sequel/adapters/shared/fdbsql.rb, line 474
def insert_select_sql(*values)
  ds = opts[:returning] ? self : returning
  ds.insert_sql(*values)
end
supports_quoted_function_names?() click to toggle source

FDBSQL supports quoted function names

# File lib/sequel/adapters/shared/fdbsql.rb, line 495
def supports_quoted_function_names?
  true
end
supports_regexp?() click to toggle source

FDBSQL has functions to support regular expression pattern matching.

# File lib/sequel/adapters/shared/fdbsql.rb, line 480
def supports_regexp?
  true
end
supports_returning?(type) click to toggle source

Returning is always supported.

# File lib/sequel/adapters/shared/fdbsql.rb, line 485
def supports_returning?(type)
  true
end
supports_timestamp_usecs?() click to toggle source

FDBSQL truncates all seconds

# File lib/sequel/adapters/shared/fdbsql.rb, line 490
def supports_timestamp_usecs?
  false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.