Class: Rooq::DSL::DeleteQuery
- Inherits:
-
Object
- Object
- Rooq::DSL::DeleteQuery
- Defined in:
- lib/rooq/dsl/delete_query.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#returning_fields ⇒ Object
readonly
Returns the value of attribute returning_fields.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(table) ⇒ DeleteQuery
constructor
A new instance of DeleteQuery.
- #returning(*fields) ⇒ Object
- #to_sql(dialect = Rooq::Dialect::PostgreSQL.new) ⇒ Object
- #where(condition) ⇒ Object
Constructor Details
#initialize(table) ⇒ DeleteQuery
Returns a new instance of DeleteQuery.
8 9 10 11 12 |
# File 'lib/rooq/dsl/delete_query.rb', line 8 def initialize(table) @table = table @conditions = nil @returning_fields = [] end |
Instance Attribute Details
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
6 7 8 |
# File 'lib/rooq/dsl/delete_query.rb', line 6 def conditions @conditions end |
#returning_fields ⇒ Object (readonly)
Returns the value of attribute returning_fields.
6 7 8 |
# File 'lib/rooq/dsl/delete_query.rb', line 6 def returning_fields @returning_fields end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
6 7 8 |
# File 'lib/rooq/dsl/delete_query.rb', line 6 def table @table end |
Instance Method Details
#returning(*fields) ⇒ Object
18 19 20 |
# File 'lib/rooq/dsl/delete_query.rb', line 18 def returning(*fields) dup_with(returning_fields: fields.flatten) end |
#to_sql(dialect = Rooq::Dialect::PostgreSQL.new) ⇒ Object
22 23 24 |
# File 'lib/rooq/dsl/delete_query.rb', line 22 def to_sql(dialect = Rooq::Dialect::PostgreSQL.new) dialect.render_delete(self) end |
#where(condition) ⇒ Object
14 15 16 |
# File 'lib/rooq/dsl/delete_query.rb', line 14 def where(condition) dup_with(conditions: condition) end |