query-builder.d.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { entityKind } from "../../entity.js";
  2. import type { PgDialectConfig } from "../dialect.js";
  3. import { PgDialect } from "../dialect.js";
  4. import type { SQLWrapper } from "../../sql/sql.js";
  5. import { WithSubquery } from "../../subquery.js";
  6. import type { PgColumn } from "../columns/index.js";
  7. import type { WithBuilder } from "../subquery.js";
  8. import { PgSelectBuilder } from "./select.js";
  9. import type { SelectedFields } from "./select.types.js";
  10. export declare class QueryBuilder {
  11. static readonly [entityKind]: string;
  12. private dialect;
  13. private dialectConfig;
  14. constructor(dialect?: PgDialect | PgDialectConfig);
  15. $with: WithBuilder;
  16. with(...queries: WithSubquery[]): {
  17. select: {
  18. (): PgSelectBuilder<undefined, "qb">;
  19. <TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection, "qb">;
  20. };
  21. selectDistinct: {
  22. (): PgSelectBuilder<undefined, "qb">;
  23. <TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection, "qb">;
  24. };
  25. selectDistinctOn: {
  26. (on: (PgColumn | SQLWrapper)[]): PgSelectBuilder<undefined, "qb">;
  27. <TSelection extends SelectedFields>(on: (PgColumn | SQLWrapper)[], fields: TSelection): PgSelectBuilder<TSelection, "qb">;
  28. };
  29. };
  30. select(): PgSelectBuilder<undefined, 'qb'>;
  31. select<TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection, 'qb'>;
  32. selectDistinct(): PgSelectBuilder<undefined>;
  33. selectDistinct<TSelection extends SelectedFields>(fields: TSelection): PgSelectBuilder<TSelection>;
  34. selectDistinctOn(on: (PgColumn | SQLWrapper)[]): PgSelectBuilder<undefined>;
  35. selectDistinctOn<TSelection extends SelectedFields>(on: (PgColumn | SQLWrapper)[], fields: TSelection): PgSelectBuilder<TSelection>;
  36. private getDialect;
  37. }