sailfork / t3code-github / .repos/ alchemy-effect/ examples/ cloudflare-neon-prisma/ src/ prisma/ generated/ contract.d.ts

// ⚠️  GENERATED FILE - DO NOT EDIT
// This file is automatically generated by 'prisma contract emit'.
// To regenerate, run: prisma contract emit
import type { QueryOperationTypes as PgAdapterQueryOps } from "@prisma/orm-postgres/adapter/operation-types";
import type {
  Contract as ContractType,
  ExecutionHashBase,
  NamespaceId,
  ProfileHashBase,
  StorageHashBase,
} from "@prisma/orm-postgres/contract/types";
import type {
  ContractWithTypeMaps,
  RelationKeys,
  TypeMaps as TypeMapsType,
} from "@prisma/orm-postgres/family-contract/types";
import type {
  Bit,
  Char,
  CodecTypes as PgTypes,
  Interval,
  JsonValue,
  Numeric,
  Time,
  TimeString,
  Timestamp,
  TimestampString,
  Timestamptz,
  TimestamptzString,
  Timetz,
  VarBit,
  Varchar,
} from "@prisma/orm-postgres/target/codec-types";

export type StorageHash =
  StorageHashBase<"7de60ab4aee8baa42480f8a2d3559ff4027deae801de73c6a93c9eeb4170f558">;
export type ExecutionHash =
  ExecutionHashBase<"3d1e5ef7d0bf68e99ed01f74317c9cb4403c9f0235bcb38e447cfe4595460215">;
export type ProfileHash =
  ProfileHashBase<"3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2">;

export type CodecTypes = PgTypes;
export type LaneCodecTypes = CodecTypes;
export type QueryOperationTypes = PgAdapterQueryOps<CodecTypes>;
export type AggregateTypes = {
  readonly avg: {
    readonly byCodec: {
      readonly "pg/float@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/float4@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/float8@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/int@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/int2@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/int4@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/int8@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/int8number@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/interval@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/numeric@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/time-string@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/time-temporal@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/unboundedint@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "sql/float@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "sql/int@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
    };
  };
  readonly avgDecimal: {
    readonly byCodec: {
      readonly "pg/int@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/int2@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/int4@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/int8@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/int8number@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/numeric@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/unboundedint@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "sql/int@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
    };
  };
  readonly count: {
    readonly byCodec: {};
    readonly withoutInput: {
      readonly output: "pg/int8number@1";
      readonly nullable: false;
    };
    readonly anyInput: {
      readonly output: "pg/int8number@1";
      readonly nullable: false;
    };
  };
  readonly countBigInt: {
    readonly byCodec: {};
    readonly withoutInput: {
      readonly output: "pg/int8@1";
      readonly nullable: false;
    };
    readonly anyInput: {
      readonly output: "pg/int8@1";
      readonly nullable: false;
    };
  };
  readonly max: {
    readonly byCodec: {
      readonly "pg/char@1": {
        readonly output: "pg/char@1";
        readonly nullable: true;
      };
      readonly "pg/date-string@1": {
        readonly output: "pg/date-string@1";
        readonly nullable: true;
      };
      readonly "pg/date-temporal@1": {
        readonly output: "pg/date-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/enum@1": {
        readonly output: "pg/enum@1";
        readonly nullable: true;
      };
      readonly "pg/float@1": {
        readonly output: "pg/float@1";
        readonly nullable: true;
      };
      readonly "pg/float4@1": {
        readonly output: "pg/float4@1";
        readonly nullable: true;
      };
      readonly "pg/float8@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/inet@1": {
        readonly output: "pg/inet@1";
        readonly nullable: true;
      };
      readonly "pg/int@1": {
        readonly output: "pg/int@1";
        readonly nullable: true;
      };
      readonly "pg/int2@1": {
        readonly output: "pg/int2@1";
        readonly nullable: true;
      };
      readonly "pg/int4@1": {
        readonly output: "pg/int4@1";
        readonly nullable: true;
      };
      readonly "pg/int8@1": {
        readonly output: "pg/int8@1";
        readonly nullable: true;
      };
      readonly "pg/int8number@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
      readonly "pg/interval@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/numeric@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/text-array@1": {
        readonly output: "pg/text-array@1";
        readonly nullable: true;
      };
      readonly "pg/text@1": {
        readonly output: "pg/text@1";
        readonly nullable: true;
      };
      readonly "pg/time-string@1": {
        readonly output: "pg/time-string@1";
        readonly nullable: true;
      };
      readonly "pg/time-temporal@1": {
        readonly output: "pg/time-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/timestamp-string@1": {
        readonly output: "pg/timestamp-string@1";
        readonly nullable: true;
      };
      readonly "pg/timestamp-temporal@1": {
        readonly output: "pg/timestamp-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/timestamptz-string@1": {
        readonly output: "pg/timestamptz-string@1";
        readonly nullable: true;
      };
      readonly "pg/timestamptz-temporal@1": {
        readonly output: "pg/timestamptz-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/timetz@1": {
        readonly output: "pg/timetz@1";
        readonly nullable: true;
      };
      readonly "pg/unboundedint@1": {
        readonly output: "pg/unboundedint@1";
        readonly nullable: true;
      };
      readonly "pg/varchar@1": {
        readonly output: "pg/text@1";
        readonly nullable: true;
      };
      readonly "sql/char@1": {
        readonly output: "sql/char@1";
        readonly nullable: true;
      };
      readonly "sql/float@1": {
        readonly output: "sql/float@1";
        readonly nullable: true;
      };
      readonly "sql/int@1": {
        readonly output: "sql/int@1";
        readonly nullable: true;
      };
      readonly "sql/text@1": {
        readonly output: "sql/text@1";
        readonly nullable: true;
      };
      readonly "sql/varchar@1": {
        readonly output: "pg/text@1";
        readonly nullable: true;
      };
    };
  };
  readonly min: {
    readonly byCodec: {
      readonly "pg/char@1": {
        readonly output: "pg/char@1";
        readonly nullable: true;
      };
      readonly "pg/date-string@1": {
        readonly output: "pg/date-string@1";
        readonly nullable: true;
      };
      readonly "pg/date-temporal@1": {
        readonly output: "pg/date-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/enum@1": {
        readonly output: "pg/enum@1";
        readonly nullable: true;
      };
      readonly "pg/float@1": {
        readonly output: "pg/float@1";
        readonly nullable: true;
      };
      readonly "pg/float4@1": {
        readonly output: "pg/float4@1";
        readonly nullable: true;
      };
      readonly "pg/float8@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/inet@1": {
        readonly output: "pg/inet@1";
        readonly nullable: true;
      };
      readonly "pg/int@1": {
        readonly output: "pg/int@1";
        readonly nullable: true;
      };
      readonly "pg/int2@1": {
        readonly output: "pg/int2@1";
        readonly nullable: true;
      };
      readonly "pg/int4@1": {
        readonly output: "pg/int4@1";
        readonly nullable: true;
      };
      readonly "pg/int8@1": {
        readonly output: "pg/int8@1";
        readonly nullable: true;
      };
      readonly "pg/int8number@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
      readonly "pg/interval@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/numeric@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/text-array@1": {
        readonly output: "pg/text-array@1";
        readonly nullable: true;
      };
      readonly "pg/text@1": {
        readonly output: "pg/text@1";
        readonly nullable: true;
      };
      readonly "pg/time-string@1": {
        readonly output: "pg/time-string@1";
        readonly nullable: true;
      };
      readonly "pg/time-temporal@1": {
        readonly output: "pg/time-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/timestamp-string@1": {
        readonly output: "pg/timestamp-string@1";
        readonly nullable: true;
      };
      readonly "pg/timestamp-temporal@1": {
        readonly output: "pg/timestamp-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/timestamptz-string@1": {
        readonly output: "pg/timestamptz-string@1";
        readonly nullable: true;
      };
      readonly "pg/timestamptz-temporal@1": {
        readonly output: "pg/timestamptz-temporal@1";
        readonly nullable: true;
      };
      readonly "pg/timetz@1": {
        readonly output: "pg/timetz@1";
        readonly nullable: true;
      };
      readonly "pg/unboundedint@1": {
        readonly output: "pg/unboundedint@1";
        readonly nullable: true;
      };
      readonly "pg/varchar@1": {
        readonly output: "pg/text@1";
        readonly nullable: true;
      };
      readonly "sql/char@1": {
        readonly output: "sql/char@1";
        readonly nullable: true;
      };
      readonly "sql/float@1": {
        readonly output: "sql/float@1";
        readonly nullable: true;
      };
      readonly "sql/int@1": {
        readonly output: "sql/int@1";
        readonly nullable: true;
      };
      readonly "sql/text@1": {
        readonly output: "sql/text@1";
        readonly nullable: true;
      };
      readonly "sql/varchar@1": {
        readonly output: "pg/text@1";
        readonly nullable: true;
      };
    };
  };
  readonly sum: {
    readonly byCodec: {
      readonly "pg/float@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/float4@1": {
        readonly output: "pg/float4@1";
        readonly nullable: true;
      };
      readonly "pg/float8@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "pg/int@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
      readonly "pg/int2@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
      readonly "pg/int4@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
      readonly "pg/int8@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
      readonly "pg/int8number@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
      readonly "pg/interval@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/numeric@1": {
        readonly output: "pg/numeric@1";
        readonly nullable: true;
      };
      readonly "pg/time-string@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/time-temporal@1": {
        readonly output: "pg/interval@1";
        readonly nullable: true;
      };
      readonly "pg/unboundedint@1": {
        readonly output: "pg/unboundedint@1";
        readonly nullable: true;
      };
      readonly "sql/float@1": {
        readonly output: "pg/float8@1";
        readonly nullable: true;
      };
      readonly "sql/int@1": {
        readonly output: "pg/int8number@1";
        readonly nullable: true;
      };
    };
  };
  readonly sumBigInt: {
    readonly byCodec: {
      readonly "pg/int@1": {
        readonly output: "pg/int8@1";
        readonly nullable: true;
      };
      readonly "pg/int2@1": {
        readonly output: "pg/int8@1";
        readonly nullable: true;
      };
      readonly "pg/int4@1": {
        readonly output: "pg/int8@1";
        readonly nullable: true;
      };
      readonly "pg/int8@1": {
        readonly output: "pg/unboundedint@1";
        readonly nullable: true;
      };
      readonly "pg/int8number@1": {
        readonly output: "pg/unboundedint@1";
        readonly nullable: true;
      };
      readonly "pg/unboundedint@1": {
        readonly output: "pg/unboundedint@1";
        readonly nullable: true;
      };
      readonly "sql/int@1": {
        readonly output: "pg/int8@1";
        readonly nullable: true;
      };
    };
  };
};
type DefaultLiteralValue<CodecId extends string, Encoded> = CodecId extends keyof CodecTypes
  ? Encoded extends CodecTypes[CodecId]["json"]
    ? Encoded
    : CodecTypes[CodecId]["json"]
  : Encoded;

export type FieldOutputTypes = {
  readonly public: {
    readonly Post: {
      readonly id: CodecTypes["pg/uuid@1"]["output"];
      readonly title: CodecTypes["pg/text@1"]["output"];
      readonly authorId: CodecTypes["pg/uuid@1"]["output"];
    };
    readonly User: {
      readonly id: CodecTypes["pg/uuid@1"]["output"];
      readonly email: CodecTypes["pg/text@1"]["output"];
      readonly name: CodecTypes["pg/text@1"]["output"];
      readonly createdAt: CodecTypes["pg/timestamptz-string@1"]["output"];
    };
  };
};
export type FieldInputTypes = {
  readonly public: {
    readonly Post: {
      readonly id: CodecTypes["pg/uuid@1"]["input"];
      readonly title: CodecTypes["pg/text@1"]["input"];
      readonly authorId: CodecTypes["pg/uuid@1"]["input"];
    };
    readonly User: {
      readonly id: CodecTypes["pg/uuid@1"]["input"];
      readonly email: CodecTypes["pg/text@1"]["input"];
      readonly name: CodecTypes["pg/text@1"]["input"];
      readonly createdAt: CodecTypes["pg/timestamptz-string@1"]["input"];
    };
  };
};
export type StorageColumnTypes = {
  readonly public: {
    readonly Post: {
      readonly authorId: CodecTypes["pg/uuid@1"]["output"];
      readonly id: CodecTypes["pg/uuid@1"]["output"];
      readonly title: CodecTypes["pg/text@1"]["output"];
    };
    readonly User: {
      readonly createdAt: CodecTypes["pg/timestamptz-string@1"]["output"];
      readonly email: CodecTypes["pg/text@1"]["output"];
      readonly id: CodecTypes["pg/uuid@1"]["output"];
      readonly name: CodecTypes["pg/text@1"]["output"];
    };
  };
};
export type StorageColumnInputTypes = {
  readonly public: {
    readonly Post: {
      readonly authorId: CodecTypes["pg/uuid@1"]["input"];
      readonly id: CodecTypes["pg/uuid@1"]["input"];
      readonly title: CodecTypes["pg/text@1"]["input"];
    };
    readonly User: {
      readonly createdAt: CodecTypes["pg/timestamptz-string@1"]["input"];
      readonly email: CodecTypes["pg/text@1"]["input"];
      readonly id: CodecTypes["pg/uuid@1"]["input"];
      readonly name: CodecTypes["pg/text@1"]["input"];
    };
  };
};

export namespace Models {
  export type public_User = {
    id: CodecTypes["pg/uuid@1"]["output"];
    email: CodecTypes["pg/text@1"]["output"];
    name: CodecTypes["pg/text@1"]["output"];
    createdAt: CodecTypes["pg/timestamptz-string@1"]["output"];
    posts: public_Post[];
    readonly [RelationKeys]?: "posts";
  };
  export type public_Post = {
    id: CodecTypes["pg/uuid@1"]["output"];
    title: CodecTypes["pg/text@1"]["output"];
    authorId: CodecTypes["pg/uuid@1"]["output"];
    author: public_User;
    readonly [RelationKeys]?: "author";
  };
}

export declare const models: {
  public: {
    User: Models.public_User;
    Post: Models.public_Post;
  };
};

export type TypeMaps = TypeMapsType<
  CodecTypes,
  QueryOperationTypes,
  FieldOutputTypes,
  FieldInputTypes,
  StorageColumnTypes,
  StorageColumnInputTypes,
  AggregateTypes
>;

type ContractBase = Omit<
  ContractType<{
    readonly namespaces: {
      readonly public: {
        readonly id: "public";
        readonly kind: "postgres-schema";
        readonly entries: {
          readonly table: {
            readonly Post: {
              columns: {
                readonly id: {
                  readonly nativeType: "uuid";
                  readonly codecId: "pg/uuid@1";
                  readonly nullable: false;
                };
                readonly title: {
                  readonly nativeType: "text";
                  readonly codecId: "pg/text@1";
                  readonly nullable: false;
                };
                readonly authorId: {
                  readonly nativeType: "uuid";
                  readonly codecId: "pg/uuid@1";
                  readonly nullable: false;
                };
              };
              primaryKey: { readonly columns: readonly ["id"] };
              uniques: readonly [];
              indexes: readonly [];
              foreignKeys: readonly [];
            };
            readonly User: {
              columns: {
                readonly id: {
                  readonly nativeType: "uuid";
                  readonly codecId: "pg/uuid@1";
                  readonly nullable: false;
                };
                readonly email: {
                  readonly nativeType: "text";
                  readonly codecId: "pg/text@1";
                  readonly nullable: false;
                };
                readonly name: {
                  readonly nativeType: "text";
                  readonly codecId: "pg/text@1";
                  readonly nullable: false;
                };
                readonly createdAt: {
                  readonly nativeType: "timestamptz";
                  readonly codecId: "pg/timestamptz-string@1";
                  readonly nullable: false;
                  readonly default: {
                    readonly kind: "function";
                    readonly expression: "now()";
                  };
                };
              };
              primaryKey: { readonly columns: readonly ["id"] };
              uniques: readonly [{ readonly columns: readonly ["email"] }];
              indexes: readonly [];
              foreignKeys: readonly [];
            };
          };
        };
      };
    };
    readonly storageHash: StorageHash;
  }>,
  "roots" | "domain"
> & {
  readonly target: "postgres";
  readonly targetFamily: "sql";
  readonly roots: {
    readonly User: {
      readonly namespace: "public" & NamespaceId;
      readonly model: "User";
    };
    readonly Post: {
      readonly namespace: "public" & NamespaceId;
      readonly model: "Post";
    };
  };
  readonly domain: {
    readonly namespaces: {
      readonly public: {
        readonly models: {
          readonly Post: {
            readonly fields: {
              readonly id: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: "scalar";
                  readonly codecId: "pg/uuid@1";
                };
              };
              readonly title: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: "scalar";
                  readonly codecId: "pg/text@1";
                };
              };
              readonly authorId: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: "scalar";
                  readonly codecId: "pg/uuid@1";
                };
              };
            };
            readonly relations: {
              readonly author: {
                readonly to: {
                  readonly namespace: "public" & NamespaceId;
                  readonly model: "User";
                };
                readonly cardinality: "N:1";
                readonly nullable: false;
                readonly on: {
                  readonly localFields: readonly ["authorId"];
                  readonly targetFields: readonly ["id"];
                };
              };
            };
            readonly storage: {
              readonly table: "Post";
              readonly namespaceId: "public";
              readonly fields: {
                readonly id: { readonly column: "id" };
                readonly title: { readonly column: "title" };
                readonly authorId: { readonly column: "authorId" };
              };
            };
          };
          readonly User: {
            readonly fields: {
              readonly id: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: "scalar";
                  readonly codecId: "pg/uuid@1";
                };
              };
              readonly email: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: "scalar";
                  readonly codecId: "pg/text@1";
                };
              };
              readonly name: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: "scalar";
                  readonly codecId: "pg/text@1";
                };
              };
              readonly createdAt: {
                readonly nullable: false;
                readonly type: {
                  readonly kind: "scalar";
                  readonly codecId: "pg/timestamptz-string@1";
                };
              };
            };
            readonly relations: {
              readonly posts: {
                readonly to: {
                  readonly namespace: "public" & NamespaceId;
                  readonly model: "Post";
                };
                readonly cardinality: "1:N";
                readonly on: {
                  readonly localFields: readonly ["id"];
                  readonly targetFields: readonly ["authorId"];
                };
              };
            };
            readonly storage: {
              readonly table: "User";
              readonly namespaceId: "public";
              readonly fields: {
                readonly id: { readonly column: "id" };
                readonly email: { readonly column: "email" };
                readonly name: { readonly column: "name" };
                readonly createdAt: { readonly column: "createdAt" };
              };
            };
          };
        };
      };
    };
  };
  readonly capabilities: {
    readonly postgres: {
      readonly distinctOn: true;
      readonly jsonAgg: true;
      readonly lateral: true;
      readonly limit: true;
      readonly orderBy: true;
      readonly returning: true;
    };
    readonly sql: {
      readonly checkConstraint: true;
      readonly defaultInInsert: true;
      readonly enums: true;
      readonly lateral: true;
      readonly returning: true;
      readonly scalarList: true;
    };
  };
  readonly extensions: {};
  readonly execution: {
    readonly executionHash: ExecutionHash;
    readonly mutations: {
      readonly defaults: readonly [
        {
          readonly ref: {
            readonly namespace: "public";
            readonly table: "Post";
            readonly column: "id";
          };
          readonly onCreate: {
            readonly kind: "generator";
            readonly id: "uuidv7";
          };
        },
        {
          readonly ref: {
            readonly namespace: "public";
            readonly table: "User";
            readonly column: "id";
          };
          readonly onCreate: {
            readonly kind: "generator";
            readonly id: "uuidv7";
          };
        },
      ];
    };
  };
  readonly meta: {};

  readonly profileHash: ProfileHash;
};

export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;

export type Namespaces = Contract["storage"]["namespaces"];