utils.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930
  1. import { SQL } from "../sql/sql.js";
  2. import { Subquery } from "../subquery.js";
  3. import type { Check } from "./checks.js";
  4. import type { ForeignKey } from "./foreign-keys.js";
  5. import type { Index } from "./indexes.js";
  6. import type { PrimaryKey } from "./primary-keys.js";
  7. import { SQLiteTable } from "./table.js";
  8. import { type UniqueConstraint } from "./unique-constraint.js";
  9. import type { SQLiteViewBase } from "./view-base.js";
  10. import type { SQLiteView } from "./view.js";
  11. export declare function getTableConfig<TTable extends SQLiteTable>(table: TTable): {
  12. columns: import("./index.js").SQLiteColumn<any, {}, {}>[];
  13. indexes: Index[];
  14. foreignKeys: ForeignKey[];
  15. checks: Check[];
  16. primaryKeys: PrimaryKey[];
  17. uniqueConstraints: UniqueConstraint[];
  18. name: string;
  19. };
  20. export declare function extractUsedTable(table: SQLiteTable | Subquery | SQLiteViewBase | SQL): string[];
  21. export type OnConflict = 'rollback' | 'abort' | 'fail' | 'ignore' | 'replace';
  22. export declare function getViewConfig<TName extends string = string, TExisting extends boolean = boolean>(view: SQLiteView<TName, TExisting>): {
  23. name: TName;
  24. originalName: TName;
  25. schema: string | undefined;
  26. selectedFields: import("../sql/sql.js").ColumnsSelection;
  27. isExisting: TExisting;
  28. query: TExisting extends true ? undefined : SQL<unknown>;
  29. isAlias: boolean;
  30. };