Class: Exwiw::QueryAst::Subquery
- Inherits:
-
Struct
- Object
- Struct
- Exwiw::QueryAst::Subquery
- 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 `–ids-column`/`–ids-field` can filter related tables through the target table’s primary key:
<table>.<fk> IN (SELECT <table_name>.<select_column>
FROM <table_name>
WHERE <table_name>.<where_column> IN (<where_values>))
Instance Attribute Summary collapse
-
#select_column ⇒ Object
Returns the value of attribute select_column.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
-
#where_column ⇒ Object
Returns the value of attribute where_column.
-
#where_values ⇒ Object
Returns the value of attribute where_values.
Instance Method Summary collapse
Instance Attribute Details
#select_column ⇒ Object
Returns the value of attribute select_column
57 58 59 |
# File 'lib/exwiw/query_ast.rb', line 57 def select_column @select_column end |
#table_name ⇒ Object
Returns the value of attribute table_name
57 58 59 |
# File 'lib/exwiw/query_ast.rb', line 57 def table_name @table_name end |
#where_column ⇒ Object
Returns the value of attribute where_column
57 58 59 |
# File 'lib/exwiw/query_ast.rb', line 57 def where_column @where_column end |
#where_values ⇒ Object
Returns the value of attribute where_values
57 58 59 |
# File 'lib/exwiw/query_ast.rb', line 57 def where_values @where_values end |
Instance Method Details
#to_h ⇒ Object
58 59 60 61 62 63 64 65 |
# File 'lib/exwiw/query_ast.rb', line 58 def to_h { table_name: table_name, select_column: select_column, where_column: where_column, where_values: where_values, } end |