primary-keys.d.cts 1.1 KB

123456789101112131415161718192021222324252627282930
  1. import { entityKind } from "../entity.cjs";
  2. import type { AnyPgColumn, PgColumn } from "./columns/index.cjs";
  3. import { PgTable } from "./table.cjs";
  4. export declare function primaryKey<TTableName extends string, TColumn extends AnyPgColumn<{
  5. tableName: TTableName;
  6. }>, TColumns extends AnyPgColumn<{
  7. tableName: TTableName;
  8. }>[]>(config: {
  9. name?: string;
  10. columns: [TColumn, ...TColumns];
  11. }): PrimaryKeyBuilder;
  12. /**
  13. * @deprecated: Please use primaryKey({ columns: [] }) instead of this function
  14. * @param columns
  15. */
  16. export declare function primaryKey<TTableName extends string, TColumns extends AnyPgColumn<{
  17. tableName: TTableName;
  18. }>[]>(...columns: TColumns): PrimaryKeyBuilder;
  19. export declare class PrimaryKeyBuilder {
  20. static readonly [entityKind]: string;
  21. constructor(columns: PgColumn[], name?: string);
  22. }
  23. export declare class PrimaryKey {
  24. readonly table: PgTable;
  25. static readonly [entityKind]: string;
  26. readonly columns: AnyPgColumn<{}>[];
  27. readonly name?: string;
  28. constructor(table: PgTable, columns: AnyPgColumn<{}>[], name?: string);
  29. getName(): string;
  30. }