module QueryBuilder::CQL::Modifiers::With

Provides WITH clauses for statements

Public Instance Methods

with(options) click to toggle source

Adds WITH clause to the statement

@param [Hash] options

@return [QueryBuilder::Core::Statement] updated statement

# File lib/query_builder/cql/modifiers/with.rb, line 17
def with(options)
  options
    .map { |key, value| Clause.new(column: key, value: value) }
    .inject(self, :<<)
end

Private Instance Methods

maybe_with() click to toggle source
# File lib/query_builder/cql/modifiers/with.rb, line 25
def maybe_with
  list = clauses(:with)
  ["WITH", list.join(" AND ")] if list.any?
end