From bd47329ab66e490461555c47c30332c6904f56ee Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 3 Aug 2026 21:13:17 +0100 Subject: [PATCH 1/5] Allow empty enum --- .../graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts b/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts index 9818688521..d3e2517ea8 100644 --- a/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts +++ b/graphile-build/graphile-build-pg/src/plugins/PgEnumTablesPlugin.ts @@ -314,7 +314,7 @@ Original error: ${e.message} (row) => row[pgAttribute.attname] != null, ); if (data.length < 1) { - throw new Error( + console.warn( `Enum table "${pgNamespace.nspname}"."${pgClass.relname}" contains no visible entries for enum constraint '${pgConstraint.conname}'. Check that the table contains at least one row and that the rows are not hidden by row-level security policies.`, ); } From 4b6f5bf91ce1ddcddc498319ebaf48b94b50d755 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 3 Aug 2026 21:15:08 +0100 Subject: [PATCH 2/5] docs(changeset): Allow PostgreSQL enum table with no values... catch at GraphQL layer. --- .changeset/large-buttons-end.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/large-buttons-end.md diff --git a/.changeset/large-buttons-end.md b/.changeset/large-buttons-end.md new file mode 100644 index 0000000000..a88f177865 --- /dev/null +++ b/.changeset/large-buttons-end.md @@ -0,0 +1,6 @@ +--- +"graphile-build-pg": patch +"postgraphile": patch +--- + +Allow PostgreSQL enum table with no values... catch at GraphQL layer. From 383822e1e27d9fe36491050a01aaa4244187c42e Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 3 Aug 2026 21:17:29 +0100 Subject: [PATCH 3/5] Add test for empty enum --- .../postgraphile/__tests__/kitchen-sink-schema.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql b/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql index 28e91281f4..835d545522 100644 --- a/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql +++ b/postgraphile/postgraphile/__tests__/kitchen-sink-schema.sql @@ -1272,6 +1272,16 @@ comment on constraint enum_2 on enum_tables.lots_of_enums is E'@enum\n@enumName comment on constraint enum_3 on enum_tables.lots_of_enums is E'@enum'; comment on constraint enum_4 on enum_tables.lots_of_enums is E'@enum'; +create table enum_tables.empty_enum ( + value text primary key, + description text +); +comment on table enum_tables.empty_enum is E'@enum'; + +create function enum_tables.empty_enum_query() returns enum_tables.empty_enum as $$ + select null::text as value, null::text as description; +$$ language sql stable; + -- Enum table needs values added as part of the migration, not as part of the -- data. insert into enum_tables.simple_enum (value, description) values From 08bfe8586bb0fc0fe0249ef1ebe1505eaf769a47 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 3 Aug 2026 21:36:38 +0100 Subject: [PATCH 4/5] Update snapshots --- .../__tests__/schema/v4/cjk.1.export.mjs | 18 ++++ .../v4/defaultOptions-minified.1.export.mjs | 6 ++ .../schema/v4/defaultOptions.1.export.mjs | 18 ++++ .../defaultOptions.inheritence.1.export.mjs | 18 ++++ .../defaultOptions.nested_arrays.1.export.mjs | 18 ++++ .../defaultOptions.subscriptions.1.export.mjs | 18 ++++ .../schema/v4/enum_tables.1.export.mjs | 88 ++++++++++++++++++- .../foreignKey-smart-tag-autofix.1.export.mjs | 18 ++++ .../v4/foreignKey-smart-tag-good.1.export.mjs | 18 ++++ ...ash-with-tags-file-workaround.1.export.mjs | 18 ++++ .../schema/v4/function-clash.1.export.mjs | 18 ++++ .../__tests__/schema/v4/geometry.1.export.mjs | 18 ++++ .../__tests__/schema/v4/indexes.1.export.mjs | 18 ++++ .../v4/indexes.index_expressions.1.export.mjs | 18 ++++ .../v4/inflect-builtin-lowercase.1.export.mjs | 18 ++++ .../schema/v4/inflect-core.1.export.mjs | 18 ++++ .../schema/v4/js-reserved.1.export.mjs | 17 ++++ .../__tests__/schema/v4/jwt.1.export.mjs | 18 ++++ .../schema/v4/mutation-no-fields.1.export.mjs | 18 ++++ .../schema/v4/network_types.1.export.mjs | 18 ++++ .../v4/network_types.custom.1.export.mjs | 18 ++++ .../schema/v4/noDefaultMutations.1.export.mjs | 18 ++++ .../schema/v4/omit-rename.1.export.mjs | 18 ++++ .../v4/omit-rename.omitcolumns.1.export.mjs | 18 ++++ ...it-rename.omitcolumns.execute.1.export.mjs | 18 ++++ ...ename.omitcolumns.loads-title.1.export.mjs | 18 ++++ ...tcolumns.shows-title-asterisk.1.export.mjs | 18 ++++ ...ename.omitcolumns.title-order.1.export.mjs | 18 ++++ ...name.omitcolumns.update-title.1.export.mjs | 18 ++++ .../v4/omit-rename.omitstuff.1.export.mjs | 18 ++++ ...-rename.omitstuff.constraints.1.export.mjs | 18 ++++ ...name.omitstuff.films-asterisk.1.export.mjs | 18 ++++ ...rename.omitstuff.films-create.1.export.mjs | 18 ++++ ...rename.omitstuff.films-delete.1.export.mjs | 18 ++++ ...-rename.omitstuff.films-loads.1.export.mjs | 18 ++++ ...rename.omitstuff.films-update.1.export.mjs | 18 ++++ ...-rename.omitstuff.shows-order.1.export.mjs | 18 ++++ .../schema/v4/partitions.1.export.mjs | 18 ++++ .../__tests__/schema/v4/pg11.1.export.mjs | 18 ++++ .../schema/v4/pg11.custom.1.export.mjs | 18 ++++ .../schema/v4/pgStrictFunctions.1.export.mjs | 18 ++++ .../polymorphic-auto-add-types.1.export.mjs | 18 ++++ .../schema/v4/polymorphic.1.export.mjs | 18 ++++ .../__tests__/schema/v4/rbac.1.export.mjs | 18 ++++ .../__tests__/schema/v4/refs.1.export.mjs | 18 ++++ .../__tests__/schema/v4/relay.1.export.mjs | 18 ++++ .../v4/relay.defaultNodeIdCodec.1.export.mjs | 18 ++++ .../schema/v4/relay.issue2334.1.export.mjs | 18 ++++ .../__tests__/schema/v4/relay1.1.export.mjs | 18 ++++ .../schema/v4/simple-collections.1.export.mjs | 18 ++++ ...-collections.omit-pets-simple.1.export.mjs | 18 ++++ ...-collections.only-people-omit.1.export.mjs | 18 ++++ .../v4/simple-collections.only.1.export.mjs | 18 ++++ ...imple-collections.pets-simple.1.export.mjs | 18 ++++ .../schema/v4/simplePrint.export.mjs | 18 ++++ .../schema/v4/skipNodePlugin.1.export.mjs | 18 ++++ .../skipNodePlugin.polymorphic.1.export.mjs | 18 ++++ .../v4/smart_comment_relations.1.export.mjs | 18 ++++ .../smart_comment_relations.post.1.export.mjs | 18 ++++ ...t_comment_relations.post_view.1.export.mjs | 18 ++++ ...ent_relations.post_view_no_pk.1.export.mjs | 18 ++++ ...nt_relations.view_fake_unique.1.export.mjs | 18 ++++ ...relations.view_fake_unique_pk.1.export.mjs | 18 ++++ .../__tests__/schema/v5/scifi.1.export.mjs | 18 ++++ .../schema/v5/skipNodePlugin.1.export.mjs | 18 ++++ .../skipNodePlugin.polymorphic.1.export.mjs | 18 ++++ 66 files changed, 1244 insertions(+), 1 deletion(-) diff --git a/postgraphile/postgraphile/__tests__/schema/v4/cjk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/cjk.1.export.mjs index 5a06fd668c..f909442b18 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/cjk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/cjk.1.export.mjs @@ -166,6 +166,24 @@ const resource_PgResource = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs index d2d7a4b703..1a5b9b430a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions-minified.1.export.mjs @@ -1986,6 +1986,12 @@ const registry = makeRegistry({ }], extensions: {} }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: {} + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs index dc06bcb225..639f0d2d13 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.1.export.mjs @@ -2773,6 +2773,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs index fdf45111c5..0017419bc2 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.inheritence.1.export.mjs @@ -263,6 +263,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs index 53acd4d454..64b414e9cc 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.nested_arrays.1.export.mjs @@ -253,6 +253,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs index dc06bcb225..639f0d2d13 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/defaultOptions.subscriptions.1.export.mjs @@ -2773,6 +2773,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs index a2b5ce46a2..b25ac53bf6 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/enum_tables.1.export.mjs @@ -1,4 +1,4 @@ -import { PgDeleteSingleStep, PgExecutor, PgSelectStep, TYPES, assertPgClassSingleStep, enumCodec, makeRegistry, pgDeleteSingle, pgInsertSingle, pgSelectFromRecord, pgUpdateSingle, recordCodec, sqlFromArgDigests, sqlValueWithCodec } from "@dataplan/pg"; +import { PgDeleteSingleStep, PgExecutor, PgResource, PgSelectStep, TYPES, assertPgClassSingleStep, enumCodec, makeRegistry, pgDeleteSingle, pgInsertSingle, pgSelectFromRecord, pgUpdateSingle, recordCodec, sqlFromArgDigests, sqlValueWithCodec } from "@dataplan/pg"; import { ConnectionStep, EdgeStep, ObjectStep, __ValueStep, access, assertStep, bakedInput, bakedInputRuntime, connection, constant, context, createObjectAndApplyChildren, first, get as get2, inhibitOnNull, inspect, lambda, list, makeDecodeNodeId, makeGrafastSchema, markSyncAndSafe, object, operationPlan, specFromNodeId, trap } from "grafast"; import { GraphQLError, Kind } from "graphql"; import { sql } from "pg-sql2"; @@ -129,6 +129,34 @@ const abcdViewCodec = recordCodec({ }, executor: executor }); +const emptyEnumIdentifier = sql.identifier("enum_tables", "empty_enum"); +const emptyEnumCodec = recordCodec({ + name: "emptyEnum", + identifier: emptyEnumIdentifier, + attributes: { + __proto__: null, + value: { + codec: TYPES.text, + notNull: true + }, + description: { + codec: TYPES.text + } + }, + extensions: { + isTableLike: true, + pg: { + serviceName: "main", + schemaName: "enum_tables", + name: "empty_enum" + }, + tags: { + __proto__: null, + enum: true + } + }, + executor: executor +}); const simpleEnumIdentifier = sql.identifier("enum_tables", "simple_enum"); const simpleEnumCodec = recordCodec({ name: "simpleEnum", @@ -496,6 +524,27 @@ const abcd_view_resourceOptionsConfig = { isPrimary: true }] }; +const empty_enum_resourceOptionsConfig = { + executor: executor, + name: "empty_enum", + identifier: "main.enum_tables.empty_enum", + from: emptyEnumIdentifier, + codec: emptyEnumCodec, + extensions: { + pg: { + serviceName: "main", + schemaName: "enum_tables", + name: "empty_enum" + }, + tags: { + enum: true + } + }, + uniques: [{ + attributes: ["value"], + isPrimary: true + }] +}; const simple_enum_resourceOptionsConfig = { executor: executor, name: "simple_enum", @@ -518,6 +567,7 @@ const simple_enum_resourceOptionsConfig = { }] }; const referencing_table_mutationFunctionIdentifer = sql.identifier("enum_tables", "referencing_table_mutation"); +const empty_enum_queryFunctionIdentifer = sql.identifier("enum_tables", "empty_enum_query"); const letter_descriptionsUniques = [{ attributes: ["id"], isPrimary: true @@ -629,6 +679,7 @@ const registry = makeRegistry({ abcd: abcdCodec, text: TYPES.text, abcdView: abcdViewCodec, + emptyEnum: emptyEnumCodec, simpleEnum: simpleEnumCodec, int4: TYPES.int, letterDescriptions: letterDescriptionsCodec, @@ -642,6 +693,24 @@ const registry = makeRegistry({ lotsOfEnums: lotsOfEnumsCodec, varchar: TYPES.varchar, bpchar: TYPES.bpchar, + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), LotsOfEnumsEnum4Enum: enumCodec({ name: "LotsOfEnumsEnum4Enum", identifier: TYPES.text.sqlType, @@ -788,6 +857,7 @@ const registry = makeRegistry({ __proto__: null, abcd: abcd_resourceOptionsConfig, abcd_view: abcd_view_resourceOptionsConfig, + empty_enum: empty_enum_resourceOptionsConfig, simple_enum: simple_enum_resourceOptionsConfig, referencing_table_mutation: { executor: executor, @@ -812,6 +882,22 @@ const registry = makeRegistry({ isUnique: true, isMutation: true }, + empty_enum_query: PgResource.functionResourceOptions(empty_enum_resourceOptionsConfig, { + name: "empty_enum_query", + identifier: "main.enum_tables.empty_enum_query()", + from(...args) { + return sql`${empty_enum_queryFunctionIdentifer}(${sqlFromArgDigests(args)})`; + }, + parameters: [], + returnsSetof: false, + extensions: { + pg: { + serviceName: "main", + schemaName: "enum_tables", + name: "empty_enum_query" + } + } + }), letter_descriptions: letter_descriptions_resourceOptionsConfig, referencing_table: referencing_table_resourceOptionsConfig, lots_of_enums: lots_of_enums_resourceOptionsConfig diff --git a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs index dbece25b53..c1e7f6df01 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-autofix.1.export.mjs @@ -1905,6 +1905,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs index 333f5af9c5..04d51eb0ec 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/foreignKey-smart-tag-good.1.export.mjs @@ -1899,6 +1899,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs index 1ad8fe284d..6cfff429c5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/function-clash-with-tags-file-workaround.1.export.mjs @@ -2783,6 +2783,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs index 0b8776c6e8..ead239a87b 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/function-clash.1.export.mjs @@ -2774,6 +2774,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs index ec62c4cf15..826f79a277 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/geometry.1.export.mjs @@ -225,6 +225,24 @@ const resource_geomPgResource = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs index eb67e02ccc..0108c77c13 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/indexes.1.export.mjs @@ -3200,6 +3200,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs index e312cdd476..070bc57996 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/indexes.index_expressions.1.export.mjs @@ -171,6 +171,24 @@ const resource_employeePgResource = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs index cda3d8efad..33ea4a00a7 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/inflect-builtin-lowercase.1.export.mjs @@ -2773,6 +2773,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs index 08ca0263b9..a5c5bba33f 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/inflect-core.1.export.mjs @@ -2773,6 +2773,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs index 59256bd5e8..6b07a93911 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/js-reserved.1.export.mjs @@ -675,6 +675,23 @@ const registryConfig = { name: "LetterAToDViaView" } } + })], ["EmptyEnumEnum", enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } })], ["EnumTheFirstEnum", enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs index a8ee8fdf3d..91e2a6fbfb 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/jwt.1.export.mjs @@ -933,6 +933,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/mutation-no-fields.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/mutation-no-fields.1.export.mjs index f58e3761fe..f1e426a113 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/mutation-no-fields.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/mutation-no-fields.1.export.mjs @@ -167,6 +167,24 @@ const resource_citationPgResource = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs index edd312df5e..ab632a566f 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/network_types.1.export.mjs @@ -175,6 +175,24 @@ const resource_networkPgResource = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs index 236e30e176..73793e4e17 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/network_types.custom.1.export.mjs @@ -175,6 +175,24 @@ const resource_networkPgResource = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs index b0170fa8e0..a5de27d215 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/noDefaultMutations.1.export.mjs @@ -1895,6 +1895,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs index e724bf494b..c006cc5b60 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.1.export.mjs @@ -562,6 +562,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs index f8d9be3b2e..d5a9669e14 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.1.export.mjs @@ -568,6 +568,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs index dab811c36b..e45c2bc62c 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.execute.1.export.mjs @@ -562,6 +562,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs index 7faa4da40e..2dc93b4a2f 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.loads-title.1.export.mjs @@ -568,6 +568,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs index e2e524bfd4..dcdc165518 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.shows-title-asterisk.1.export.mjs @@ -574,6 +574,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs index 243d5b78ae..ef7cc4ef67 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.title-order.1.export.mjs @@ -568,6 +568,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs index 6276a569b0..b6a0b1011c 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitcolumns.update-title.1.export.mjs @@ -568,6 +568,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs index 1dd1a040fe..29f72cf469 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.1.export.mjs @@ -567,6 +567,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs index 776b335dc1..d6bf6a7ed3 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.constraints.1.export.mjs @@ -571,6 +571,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs index dc638f1b31..6748b8cd1d 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-asterisk.1.export.mjs @@ -571,6 +571,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs index c7e83034a5..3dbcd9274a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-create.1.export.mjs @@ -567,6 +567,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs index d6560a8dab..0e9450871a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-delete.1.export.mjs @@ -567,6 +567,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs index 13c19a2a15..8f9bf0d9db 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-loads.1.export.mjs @@ -563,6 +563,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs index fabcc53c82..43507443ad 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.films-update.1.export.mjs @@ -567,6 +567,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs index 2ffc8e001a..65d76f9e2d 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/omit-rename.omitstuff.shows-order.1.export.mjs @@ -571,6 +571,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs index 05531f3b5d..f8391e6cc5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/partitions.1.export.mjs @@ -817,6 +817,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs index 06e2c6c3df..73a87e0575 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/pg11.1.export.mjs @@ -412,6 +412,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs index 715b1d76d7..4b94796bb6 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/pg11.custom.1.export.mjs @@ -412,6 +412,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs index eea3696cfb..e9edbba033 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/pgStrictFunctions.1.export.mjs @@ -2773,6 +2773,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic-auto-add-types.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic-auto-add-types.1.export.mjs index f200168afe..c97b0bd45c 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic-auto-add-types.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic-auto-add-types.1.export.mjs @@ -2837,6 +2837,24 @@ const registryConfig = { } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs index a1bdfe988f..1b3bd4627a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/polymorphic.1.export.mjs @@ -2850,6 +2850,24 @@ const registryConfig = { } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs index 29130eb293..3fbe7944e3 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.1.export.mjs @@ -3601,6 +3601,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs index 3c704cc839..4654ca46b4 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/refs.1.export.mjs @@ -479,6 +479,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs index 3c6ff6b969..bbc995db2f 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay.1.export.mjs @@ -564,6 +564,24 @@ const registryConfig = { } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay.defaultNodeIdCodec.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay.defaultNodeIdCodec.1.export.mjs index 7bc3aedc1a..03ef86a473 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay.defaultNodeIdCodec.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay.defaultNodeIdCodec.1.export.mjs @@ -564,6 +564,24 @@ const registryConfig = { } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay.issue2334.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay.issue2334.1.export.mjs index 93ba9d093a..f08bcb173f 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay.issue2334.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay.issue2334.1.export.mjs @@ -285,6 +285,24 @@ const registryConfig = { } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs index 58882212d6..4bb554c522 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/relay1.1.export.mjs @@ -1895,6 +1895,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs index b96ba6d7b8..d60f018bb5 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.1.export.mjs @@ -1895,6 +1895,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs index ae8ddbf75b..66332081ac 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.omit-pets-simple.1.export.mjs @@ -231,6 +231,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs index ec2efc3050..e133688e7c 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only-people-omit.1.export.mjs @@ -240,6 +240,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs index a9273b6cb1..018c9b0256 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.only.1.export.mjs @@ -1895,6 +1895,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs index 81f2a23142..21de112d77 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simple-collections.pets-simple.1.export.mjs @@ -231,6 +231,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs index dc06bcb225..639f0d2d13 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/simplePrint.export.mjs @@ -2773,6 +2773,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs index 095941d4ee..b10a60ba0a 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.1.export.mjs @@ -2721,6 +2721,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs index 94e4169255..e71162c581 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/skipNodePlugin.polymorphic.1.export.mjs @@ -2837,6 +2837,24 @@ const registryConfig = { } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs index 64573366c1..7e8bae77d1 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.1.export.mjs @@ -656,6 +656,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs index 5c52c8354c..107d590a5c 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post.1.export.mjs @@ -636,6 +636,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs index 3249bcaca6..0756828a9b 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view.1.export.mjs @@ -656,6 +656,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs index 8cd9ddde49..d9da90afb6 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.post_view_no_pk.1.export.mjs @@ -662,6 +662,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs index 41d9fb2d31..853acd21ea 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique.1.export.mjs @@ -654,6 +654,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs index 9d56aa8c74..7c79bf89aa 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/smart_comment_relations.view_fake_unique_pk.1.export.mjs @@ -640,6 +640,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v5/scifi.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v5/scifi.1.export.mjs index b12ad39ffe..df4de3a3aa 100644 --- a/postgraphile/postgraphile/__tests__/schema/v5/scifi.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v5/scifi.1.export.mjs @@ -166,6 +166,24 @@ const resource_AccessoryPgResource = makeRegistry({ } } }), + EnumTablesEmptyEnumEnum: enumCodec({ + name: "EnumTablesEmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EnumTablesEmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs index d3436fc039..3af755a4db 100644 --- a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.1.export.mjs @@ -2709,6 +2709,24 @@ const registry = makeRegistry({ } } }), + EnumTablesEmptyEnumEnum: enumCodec({ + name: "EnumTablesEmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EnumTablesEmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, diff --git a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs index 6c2a2c341c..c5a6a9af89 100644 --- a/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v5/skipNodePlugin.polymorphic.1.export.mjs @@ -2831,6 +2831,24 @@ const registryConfig = { } } }), + EnumTablesEmptyEnumEnum: enumCodec({ + name: "EnumTablesEmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EnumTablesEmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType, From 9c8a99e5e85a0ac011a603f779a52b2d957b6a68 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 3 Aug 2026 21:40:34 +0100 Subject: [PATCH 5/5] Fix test permissions --- .../__tests__/kitchen-sink-permissions.sql | 2 ++ .../schema/v4/rbac.ignore.1.export.mjs | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql b/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql index 94618ef2c0..f03db3c4ad 100644 --- a/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql +++ b/postgraphile/postgraphile/__tests__/kitchen-sink-permissions.sql @@ -35,6 +35,8 @@ grant select on enum_tables.simple_enum to postgraphile_test_authenticator; grant select on enum_tables.abcd to postgraphile_test_authenticator; grant select on enum_tables.abcd_view to postgraphile_test_authenticator; grant select on enum_tables.lots_of_enums to postgraphile_test_authenticator; +grant select on enum_tables.empty_enum to postgraphile_test_authenticator; +grant execute on function enum_tables.empty_enum_query() to postgraphile_test_visitor; grant usage on schema issue_2334 to postgraphile_test_visitor; grant select, insert (id, col), update (col), delete on issue_2334.foo to postgraphile_test_visitor; diff --git a/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs b/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs index dc06bcb225..639f0d2d13 100644 --- a/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs +++ b/postgraphile/postgraphile/__tests__/schema/v4/rbac.ignore.1.export.mjs @@ -2773,6 +2773,24 @@ const registry = makeRegistry({ } } }), + EmptyEnumEnum: enumCodec({ + name: "EmptyEnumEnum", + identifier: TYPES.text.sqlType, + values: [], + extensions: { + isEnumTableEnum: true, + enumTableEnumDetails: { + serviceName: "main", + schemaName: "enum_tables", + tableName: "empty_enum", + constraintType: "p", + constraintName: "empty_enum_pkey" + }, + tags: { + name: "EmptyEnum" + } + } + }), EnumTheFirstEnum: enumCodec({ name: "EnumTheFirstEnum", identifier: TYPES.text.sqlType,