Lustra::SQL::Query::Select
Instance methods
clear_select
SourceIn some case you want you query to return table.* instead of *
if no select parameters has been set. This occurs in the case of joins
between models.
Add DISTINCT to the SELECT part of the query
- If
onis blank (empty string, default), will call a simpleSELECT DISTINCT ... - If
onis nil, will remove the distinct (seeclear_distinct) - If
onis a non empty string, will callSELECT DISTINCT ON (on) ...
distinct_value
Sourceselect(c : Column)
Sourceselect(*args)
Add field(s) to selection from tuple
select({user_id: "uid", updated_at: "updated_at"})
# => Output "SELECT user_id AS uid, updated_at AS updated_at"