Module Sequel::Fdbsql::DatasetMethods
In: lib/sequel/adapters/shared/fdbsql.rb

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

Methods

Classes and Modules

Module Sequel::Fdbsql::DatasetMethods::PreparedStatementMethods

Public Instance methods

Emulate the bitwise operators.

[Source]

     # File lib/sequel/adapters/shared/fdbsql.rb, line 426
426:       def complex_expression_sql_append(sql, op, args)
427:         case op
428:         when :&, :|, :^, :<<, :>>, 'B~''B~'
429:           complex_expression_emulate_append(sql, op, args)
430:         # REGEXP_OPERATORS = [:~, :'!~', :'~*', :'!~*']
431:         when '~''~'
432:           function_sql_append(sql, SQL::Function.new(:REGEX, args.at(0), args.at(1)))
433:         when '!~''!~'
434:           sql << Sequel::Dataset::NOT_SPACE
435:           function_sql_append(sql, SQL::Function.new(:REGEX, args.at(0), args.at(1)))
436:         when '~*''~*'
437:           function_sql_append(sql, SQL::Function.new(:IREGEX, args.at(0), args.at(1)))
438:         when '!~*''!~*'
439:           sql << Sequel::Dataset::NOT_SPACE
440:           function_sql_append(sql, SQL::Function.new(:IREGEX, args.at(0), args.at(1)))
441:         else
442:           super
443:         end
444:       end

Insert given values into the database.

[Source]

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

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

[Source]

     # File lib/sequel/adapters/shared/fdbsql.rb, line 465
465:       def insert_select(*values)
466:         unless @opts[:disable_insert_returning]
467:           ds = opts[:returning] ? self : returning
468:           ds.insert(*values){|r| return r}
469:         end
470:       end

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

[Source]

     # File lib/sequel/adapters/shared/fdbsql.rb, line 474
474:       def insert_select_sql(*values)
475:         ds = opts[:returning] ? self : returning
476:         ds.insert_sql(*values)
477:       end

FDBSQL supports quoted function names

[Source]

     # File lib/sequel/adapters/shared/fdbsql.rb, line 495
495:       def supports_quoted_function_names?
496:         true
497:       end

FDBSQL has functions to support regular expression pattern matching.

[Source]

     # File lib/sequel/adapters/shared/fdbsql.rb, line 480
480:       def supports_regexp?
481:         true
482:       end

Returning is always supported.

[Source]

     # File lib/sequel/adapters/shared/fdbsql.rb, line 485
485:       def supports_returning?(type)
486:         true
487:       end

FDBSQL truncates all seconds

[Source]

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

[Validate]