Instance methods for datasets that connect to the FoundationDB SQL Layer.
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 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 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
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
FDBSQL supports quoted function names
# File lib/sequel/adapters/shared/fdbsql.rb, line 495 def supports_quoted_function_names? true end
FDBSQL has functions to support regular expression pattern matching.
# File lib/sequel/adapters/shared/fdbsql.rb, line 480 def supports_regexp? true end
Generated with the Darkfish Rdoc Generator 2.