Enumex.Static.Adapters.Postgres (Enumex v1.0.0)

View Source

PostgreSQL adapter for Enumex.Static.Adapter behaviour based on the Enumerated Types.

Custom queries

Due to limitations in the parameterised queries, this adapter generates its own queries based on the quote_ident/1 and quote_literal/1 database functions. Please read Quoting Values in Dynamic Queries to get more information.

Quert prefix

This implementation uses a query prefix as a database schema.

Safe migrations

Adding (within a transaction) and dropping an enumerated type value requires a few additional steps:

  • The existing enumerated type is renamed.
  • A new enumerated type with updated values is created.
  • The database table columns are then automatically converted to the new enumerated type.
  • Finally, the old, renamed enumerated type is deleted.