| 5 | import type { Table } from './table.js'; |
| 6 | |
| 7 | export interface SchemaInspector { |
| 8 | knex: Knex; |
| 9 | |
| 10 | overview: () => Promise<SchemaOverview>; |
| 11 | |
| 12 | tables(): Promise<string[]>; |
| 13 | |
| 14 | tableInfo(): Promise<Table[]>; |
| 15 | tableInfo(table: string): Promise<Table>; |
| 16 | |
| 17 | hasTable(table: string): Promise<boolean>; |
| 18 | |
| 19 | columns(table?: string): Promise<{ table: string; column: string }[]>; |
| 20 | |
| 21 | columnInfo(): Promise<Column[]>; |
| 22 | columnInfo(table?: string): Promise<Column[]>; |
| 23 | columnInfo(table: string, column: string): Promise<Column>; |
| 24 | |
| 25 | hasColumn(table: string, column: string): Promise<boolean>; |
| 26 | primary(table: string): Promise<string | null>; |
| 27 | |
| 28 | foreignKeys(table?: string): Promise<ForeignKey[]>; |
| 29 | |
| 30 | // Not in MySQL |
| 31 | withSchema?(schema: string): void; |
| 32 | } |
| 33 | |
| 34 | export interface SchemaInspectorConstructor { |
| 35 | new (knex: Knex): SchemaInspector; |
no outgoing calls
no test coverage detected