CheckSpelling
The model's checks in Postgres's own spelling, so that a live database can be compared with the model without reporting a check that is already there.
Postgres keeps a check as an expression tree and hands back its own rendering of it: between becomes two comparisons, a literal on a numeric column gains a cast, in becomes = any. No list of rewrites on our side would keep up with that deparser, so the model's checks are given to Postgres to spell, on a temporary table inside a transaction or savepoint that is always rolled back. This happens only when comparing with a live database: the snapshot, freeze and the migration files keep the readable spelling and never need a database (issue 322).
A check Postgres refuses to create here, an invalid expression, a column whose name needs quoting, a read only connection, keeps the model's spelling: the comparison then reports it, as it did before, rather than failing, because the dev server asks for this on every request.
Attributes
- Source
- CheckSpelling.scala
- Graph
-
- Supertypes
- Self type
-
CheckSpelling.type