Class: Exwiw::QueryAst::Subquery

Inherits:
Struct
  • Object
show all
Defined in:
lib/exwiw/query_ast.rb

Overview

Resolves a set of values on where_column to the rows' select_column via a nested SELECT. Used as the value of a WhereClause whose operator is :in_subquery, so a non primary-key ids_field can filter related tables through the target table's primary key:

. IN (SELECT . FROM WHERE . IN ())

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#select_columnObject

Returns the value of attribute select_column

Returns:

  • (Object)

    the current value of select_column



81
82
83
# File 'lib/exwiw/query_ast.rb', line 81

def select_column
  @select_column
end

#table_nameObject

Returns the value of attribute table_name

Returns:

  • (Object)

    the current value of table_name



81
82
83
# File 'lib/exwiw/query_ast.rb', line 81

def table_name
  @table_name
end

#where_columnObject

Returns the value of attribute where_column

Returns:

  • (Object)

    the current value of where_column



81
82
83
# File 'lib/exwiw/query_ast.rb', line 81

def where_column
  @where_column
end

#where_valuesObject

Returns the value of attribute where_values

Returns:

  • (Object)

    the current value of where_values



81
82
83
# File 'lib/exwiw/query_ast.rb', line 81

def where_values
  @where_values
end

Instance Method Details

#to_hObject



82
83
84
85
86
87
88
89
# File 'lib/exwiw/query_ast.rb', line 82

def to_h
  {
    table_name: table_name,
    select_column: select_column,
    where_column: where_column,
    where_values: where_values,
  }
end