Granite::Querying::ClassMethods
Instance methods
All will return all rows in the database. The clause allows you to specify a WHERE, JOIN, GROUP BY, ORDER BY and any other SQL92 compatible query to your table. The result will be a Collection(Model) object which lazy loads an array of instantiated instances of your Model class. This allows you to take full advantage of the database that you are using so you are not restricted or dummied down to support a DSL. Lazy load prevent running unnecessary queries from unused variables.
Returns true if a records exists with a PK of id, otherwise false.
Returns true if a records exists that matches criteria, otherwise false.
find returns the row with the primary key specified. Otherwise raises an exception.
Returns the first row found that matches criteria. Otherwise nil.
Returns the first row found that matches criteria. Otherwise raises a NotFound exception.
Returns the first row found that matches criteria. Otherwise raises a NotFound exception.
First adds a LIMIT 1 clause to the query and returns the first result
Entrypoint for creating a new object from a result set.