INNER CODE UNIT · TypeScript

createGeneratedSpec

prisma/prisma · packages/1-framework/2-authoring/ids/src/index.ts:91

function createGeneratedSpec<TId extends BuiltinGeneratorId>(
  id: TId,
  options?: IdGeneratorOptionsById[TId],
): GeneratedColumnSpec<typeof GENERATED_CHAR_TYPE.codecId> {
  const params = options as Record<string, unknown> | undefined;
  const storage = builtinGeneratorMetadataById[id].generatedStorage(params);
  return {
    type: storage.type,
    nullable: false,
    typeParams: storage.typeParams,
    generated: {
      kind: 'generator',
      id,
      ...ifDefined('params', params),
    },
  };
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…