#oraccept a raw SQL clause, with an optional placeholder (
$for Postgres) to avoid SQL Injection.
allmethod, the selected fields will match the fields specified in the model unless the
selectmacro was used to customize the SELECT.
select_statementmacro allows you to customize the entire query, including the SELECT portion. This shouldn't be necessary in most cases, but allows you to craft more complex (i.e. cross-table) queries if needed:
firstfor maximum flexibility:
exists?class method returns
trueif a record exists in the table that matches the provided id or criteria, otherwise
String, it will attempt to find a record with that primary key. If passed a
NamedTuple, it will find the record that matches that criteria, similar to
exists?method can also be used with the query builder.