class Jennifer::QueryBuilder::Criteria

Overview

Basic class describing filterable/selectable database atom. By default it is table column.

Direct Known Subclasses

Defined in:

jennifer/adapter/postgres/criteria.cr
jennifer/query_builder.cr
jennifer/query_builder/criteria.cr

Constructors

Instance Method Summary

Instance methods inherited from class Jennifer::QueryBuilder::SQLNode

alias_tables(aliases) alias_tables, as_sql as_sql, change_table(old_name, new_name) change_table, eql?(other) eql?, set_relation(table, name) set_relation, to_condition to_condition

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

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

Constructor Detail

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

[View source]

Instance Method Detail

def !=(value : Symbol) #

[View source]
def !=(value : Rightable) #

[View source]
def &(other : LogicOperator::Operandable) #

[View source]
def *(value : Rightable) #

[View source]
def +(value : Rightable) #

[View source]
def -(value : Rightable) #

[View source]
def /(value : Rightable) #

[View source]
def <(value : Rightable) #

[View source]
def <=(value : Rightable) #

[View source]
def ==(value : Symbol) #

[View source]
def ==(value : Rightable) #

[View source]
def =~(value : String) #

[View source]
def >(value : Rightable) #

[View source]
def >=(value : Rightable) #

[View source]
def [](key) #

[View source]
def alias(name : String?) #

Specifies identifier alias

nil value disable alias.


[View source]
def alias : String? #

[View source]
def alias_tables(aliases : Hash(String, String)) #

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

Converts node to SQL using sql_generator SQLGenerator.


[View source]
def asc #

[View source]
def between(left : Rightable, right : Rightable) #

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

[View source]
def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def contain(value : Rightable) #

Presents :contain operator.

PostgreSQL specific.


[View source]
def contained(value : Rightable) #

Presents :contained operator.

PostgreSQL specific.


[View source]
def definition(sql_generator) #

[View source]
def definition #

[View source]
def desc #

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

[View source]
def equal(value : Rightable) #

[View source]
def field : String #

[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 hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


[View source]
def identifier(sql_generator) #

[View source]
def identifier : String #

[View source]
def ilike(value : Rightable) #

[View source]
def in(arr : Array) #

[View source]
def in(arr : SQLNode) #

[View source]
def is(value : Symbol | Bool | Nil) #

[View source]
def like(value : Rightable) #

[View source]
def not(value : Symbol | Bool | Nil) #

[View source]
def not #

[View source]
def not_equal(value) #

[View source]
def not_like(value : Rightable) #

[View source]
def not_regexp(value : Rightable) #

[View source]
def order(direction : String | Symbol) #

[View source]
def overlap(value : Rightable) #

Presents :overlap operator.

PostgreSQL specific.


[View source]
def path(elements : String) #

[View source]
def regexp(value : Rightable) #

[View source]
def relation : String? #

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

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

Returns array of SQL query arguments.


[View source]
def table : String #

[View source]
def take(key : String | Number) #

[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]
def xor(other : LogicOperator::Operandable) #

[View source]
def |(other : LogicOperator::Operandable) #

[View source]