class Jennifer::QueryBuilder::Condition

Overview

Container for any kind of expression/condition.

Included Modules

Defined in:

jennifer/query_builder/condition.cr

Constant Summary

IN_OPERATOR_PATTERN = "%s IN(%s)"

Constructors

Instance Method Summary

Instance methods inherited from module Jennifer::QueryBuilder::Statement

as_sql(sql_generator) as_sql, filterable? filterable?, sql_args : Array(DBAny) sql_args

Instance methods inherited from module Jennifer::QueryBuilder::LogicOperator::Operators

&(other : Criteria)
&(other : Operandable)
&
, xor(other : Criteria)
xor(other : Operandable)
xor
, |(other : Criteria)
|(other : Operandable)
|

Constructor Detail

def self.new(field : String, table : String, relation = nil) #

[View source]
def self.new(lhs, operator, rhs) #

[View source]
def self.new(lhs) #

[View source]

Instance Method Detail

def ==(other) #
Description copied from class Reference

Returns false (other can only be a Value here).


[View source]
def alias_tables(aliases) #

[View source]
def as_sql(generator) #
Description copied from module Jennifer::QueryBuilder::Statement

Converts node to SQL using sql_generator SQLGenerator.


[View source]
def as_sql #

[View source]
def change_table(old_name, new_name) #

[View source]
def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def eql?(other : Condition) #

[View source]
def eql?(other) #

[View source]
def filterable? #
Description copied from module Jennifer::QueryBuilder::Statement

Returns whether node has an argument to be added to SQL statement arguments.


[View source]
def lhs : SQLNode #

Left hand side of condition.


[View source]
def not #

Makes condition negative.

Will add NOT statement before condition in generated SQL.


[View source]
def operator : Symbol #

Condition operator.


[View source]
def rhs : Criteria::Rightable? #

Right hand side of condition.


[View source]
def set_relation(table, name) #

[View source]
def sql_args : Array(DBAny) #
Description copied from module Jennifer::QueryBuilder::Statement

Returns array of SQL query arguments.


[View source]
def to_s(io : IO) #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]