This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Plugin(s) to add typedPgRegistry to the build input. | |
* TypedPgRegistryPlugin adds the typedPgRegistry to the build input, and should always be used. | |
* ExportPgRegistryTypesPlugin exports types for the PgRegistry, and should only be used in development. | |
* The exported .d.ts file should be added to the tsconfig.json `include` array. | |
* The plugin only exports if the `exportPgRegistryTypesPath` option is set in the schema options. | |
*/ | |
import type { PgCodec, PgEnumCodec, PgResource } from '@dataplan/pg' | |
import { mkdir, readFile, writeFile } from 'node:fs/promises' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EXPORTABLE } from 'graphile-utils' | |
export default { | |
name: 'ULIDPlugin', | |
description: 'Adds support for ULID type (specifically https://github.com/pksunkara/pgx_ulid).', | |
version: '0.0.0', | |
gather: { | |
hooks: { | |
pgCodecs_findPgCodec(info, event) { | |
if (event.pgType.typname === 'ulid') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'graphile-config' | |
declare global { | |
// eslint-disable-next-line ts/no-namespace | |
namespace GraphileBuild { | |
interface PgResourceTags { | |
idPrefix?: string | |
} | |
interface PgCodecTags { |