CheckSpelling

io.eezo.db.schema.CheckSpelling
object 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
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def drift(c: Connection, model: SchemaSnap, schema: String): List[Change]

One entry point for status, sync and DeployCheck.verify, so the three cannot disagree on which spelling they compare: Differ compares strings and knows nothing of a database.

One entry point for status, sync and DeployCheck.verify, so the three cannot disagree on which spelling they compare: Differ compares strings and knows nothing of a database.

Attributes

Source
CheckSpelling.scala

Public beside drift for a caller that diffs on its own, as the suites do: a snapshot whose checks Postgres has spelled is the only one a live database can be compared with.

Public beside drift for a caller that diffs on its own, as the suites do: a snapshot whose checks Postgres has spelled is the only one a live database can be compared with.

Attributes

Source
CheckSpelling.scala