Skip to content

Commit

Permalink
docs(changeset): PgSource has been renamed to PgResource, `PgType…
Browse files Browse the repository at this point in the history
…Codec` to `PgCodec`,

`PgEnumTypeCodec` to `PgEnumCodec`, `PgTypeColumn` to `PgCodecAttribute` (and
similar for related types/interfaces). `source` has been replaced by `resource`
in various of the APIs where it relates to a `PgResource`.

`PgSourceBuilder` is no more, instead being replaced with `PgResourceOptions`
and being built into the final `PgResource` via the new
`makeRegistryBuilder`/`makeRegistry` functions.

`build.input` no longer contains the `pgSources` directly, instead
`build.input.pgRegistry.pgResources` should be used.

The new registry system also means that various of the hooks in the gather
phase have been renamed/replaced, there's a new `PgRegistryPlugin` plugin in
the default preset. The only plugin that uses the `main` method in the `gather`
phase is now `PgRegistryPlugin` - if you are using the `main` function for
Postgres-related behaviors you should consider moving your logic to hooks
instead.

Plugin ordering has changed and thus the shape of the final schema is likely to
change (please use `lexicographicSortSchema` on your before/after schemas when
comparing).

Relationships are now from a codec to a resource, rather than from resource to
resource, so all the relationship inflectors (`singleRelation`,
`singleRelationBackwards`, `_manyRelation`, `manyRelationConnection`,
`manyRelationList`) now accept different parameters (`{registry, codec,
relationName}` instead of `{source, relationaName}`).

Significant type overhaul, most generic types no longer require generics to be
explicitly passed in many circumstances. `PgSelectStep`, `PgSelectSingleStep`,
`PgInsertStep`, `PgUpdateStep` and `PgDeleteStep` now all accept the resource
as their single type parameter rather than accepting the 4 generics they did
previously. `PgClassExpressionStep` now accepts just a codec and a resource as
generics. `PgResource` and `PgCodec` have gained a new `TName extends string`
generic at the very front that is used by the registry system to massively
improve continuity of the types through all the various APIs.

Fixed various issues in schema exporting, and detect more potential
issues/oversights automatically.

Fixes an RBAC bug when using superuser role for introspection.
  • Loading branch information
benjie committed Apr 4, 2023
1 parent d5312e6 commit 96b0bd1
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .changeset/odd-mayflies-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
"@graphile/simplify-inflection": patch
"graphile-build-pg": patch
"postgraphile": patch
"@dataplan/pg": patch
---

`PgSource` has been renamed to `PgResource`, `PgTypeCodec` to `PgCodec`,
`PgEnumTypeCodec` to `PgEnumCodec`, `PgTypeColumn` to `PgCodecAttribute` (and
similar for related types/interfaces). `source` has been replaced by `resource`
in various of the APIs where it relates to a `PgResource`.

`PgSourceBuilder` is no more, instead being replaced with `PgResourceOptions`
and being built into the final `PgResource` via the new
`makeRegistryBuilder`/`makeRegistry` functions.

`build.input` no longer contains the `pgSources` directly, instead
`build.input.pgRegistry.pgResources` should be used.

The new registry system also means that various of the hooks in the gather phase
have been renamed/replaced, there's a new `PgRegistryPlugin` plugin in the
default preset. The only plugin that uses the `main` method in the `gather`
phase is now `PgRegistryPlugin` - if you are using the `main` function for
Postgres-related behaviors you should consider moving your logic to hooks
instead.

Plugin ordering has changed and thus the shape of the final schema is likely to
change (please use `lexicographicSortSchema` on your before/after schemas when
comparing).

Relationships are now from a codec to a resource, rather than from resource to
resource, so all the relationship inflectors (`singleRelation`,
`singleRelationBackwards`, `_manyRelation`, `manyRelationConnection`,
`manyRelationList`) now accept different parameters
(`{registry, codec, relationName}` instead of `{source, relationaName}`).

Significant type overhaul, most generic types no longer require generics to be
explicitly passed in many circumstances. `PgSelectStep`, `PgSelectSingleStep`,
`PgInsertStep`, `PgUpdateStep` and `PgDeleteStep` now all accept the resource as
their single type parameter rather than accepting the 4 generics they did
previously. `PgClassExpressionStep` now accepts just a codec and a resource as
generics. `PgResource` and `PgCodec` have gained a new `TName extends string`
generic at the very front that is used by the registry system to massively
improve continuity of the types through all the various APIs.

Fixed various issues in schema exporting, and detect more potential
issues/oversights automatically.

Fixes an RBAC bug when using superuser role for introspection.

0 comments on commit 96b0bd1

Please sign in to comment.