You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new.{{ crystal_db_alias.id }}(query, *args_, args: args, queryable: queryable) do |*yield_args|
yield*yield_args
end
end
{%end%}
Using these low-level crystal-db methods give a false sense of unified code in how they work. For example, it looks like you can do this, but you can't...
# assume this returns a single SpecialModelAppDatabase.query(sql, args: [1], as:SpecialModel)
# assume this returns an Array(SpecialModel)AppDatabase.query_all(sql, args: [1], as:SpecialModel)
The issue here is that query actually returns a ResultSet which could either be a single record or an array of records... There's no as: named arg for query.
The reason we map these though is so we can properly log them through Avram (and Dexter). I'm sure there's other wrong uses in here, but they should all be cleaned up.
The text was updated successfully, but these errors were encountered:
avram/src/avram/database.cr
Lines 87 to 123 in 519213e
Using these low-level crystal-db methods give a false sense of unified code in how they work. For example, it looks like you can do this, but you can't...
The issue here is that
query
actually returns aResultSet
which could either be a single record or an array of records... There's noas:
named arg forquery
.Ref: will/crystal-pg#202
The reason we map these though is so we can properly log them through Avram (and Dexter). I'm sure there's other wrong uses in here, but they should all be cleaned up.
The text was updated successfully, but these errors were encountered: