-
Notifications
You must be signed in to change notification settings - Fork 48
Description
(Follow-up from #192)
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.