@graphile-contrib/view-constraints
v0.2.0
Published
Derive PostGraphile view constraints from PostgreSQL plans and catalogs.
Readme
@graphile-contrib/view-constraints
An opt-in PostGraphile v5 plugin that derives a view's foreign keys, primary key, and non-null columns from PostgreSQL's query plan and system catalogs.
Install
npm install @graphile-contrib/view-constraintsUse
import { PgViewConstraintsPlugin } from '@graphile-contrib/view-constraints'
export default {
plugins: [PgViewConstraintsPlugin()]
}The plugin runs before PgFakeConstraintsPlugin, which turns the derived tags
into relations in the generated schema.
Pass declare: false only to inspect a report without changing the schema.
