Clear::SQL::SelectBuilder
Inherits Clear::SQL::Query::WithPagination < Clear::SQL::Query::BeforeQuery < Clear::SQL::Query::Change < Clear::SQL::Query::Connection < Clear::SQL::Query::Pluck < Clear::SQL::Query::Fetch < Clear::SQL::Query::Execute < Clear::SQL::Query::Lock < Clear::SQL::Query::Window < Clear::SQL::Query::CTE < Clear::SQL::Query::Aggregate < Clear::SQL::Query::OffsetLimit < Clear::SQL::Query::GroupBy < Clear::SQL::Query::OrderBy < Clear::SQL::Query::Having < Clear::SQL::Query::Where < Clear::SQL::Query::Join < Clear::SQL::Query::From < Clear::SQL::Query::Select
Constructors
Instance methods
A hook to apply some operation just before the query is executed.
call = 0
req = Clear::SQL.select("1").before_query { call += 1 }
10.times { req.execute }
pp call # 10
Duplicate the current request. Select query are mutable objects, and many of the methods will change the state of the collection:
collection = User.query # SELECT * FROM users;
collection.select("id") # SELECT id FROM users;
collection.select("id") # SELECT id, id FROM users;
Therefore, you may want to use dup to duplicate the current state of the collection.
Construct and return a delete query from this select query
Note: It uses only the from and the where clause from the current select
request.
Construct and return an update query from this select query
Note: It uses only the from and the where clause from the current select
request.
Return the list of where clause; each where clause are transformed into Clear::Expression::Node