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
Within the CTE implementation in db/update_and_check.rs, we use the statement RETURNING * to extract the results of the UPDATE subquery. Additionally, when selecting from the JOIN of the SELECT and UPDATE queries, we access found.* to wild-card access the found structure.
This works, but isn't the best for backwards compatibility. If we add a column to the DB, but still run the old version of software, this risks bumping into migration issues - we'll accidentally read "more columns than we know how to parse".
In contrast, nearly all native Diesel operations select on columns explicitly. Using the traits provided within Diesel, it should be possible to do the same for this CTE, and would protect against these migration issues.
The text was updated successfully, but these errors were encountered:
(Follow-up from #192)
Within the CTE implementation in db/update_and_check.rs, we use the statement
RETURNING *
to extract the results of theUPDATE
subquery. Additionally, when selecting from theJOIN
of theSELECT
andUPDATE
queries, we accessfound.*
to wild-card access the found structure.This works, but isn't the best for backwards compatibility. If we add a column to the DB, but still run the old version of software, this risks bumping into migration issues - we'll accidentally read "more columns than we know how to parse".
In contrast, nearly all native Diesel operations select on columns explicitly. Using the traits provided within Diesel, it should be possible to do the same for this CTE, and would protect against these migration issues.
The text was updated successfully, but these errors were encountered: