MCPcopy
hub / github.com/directus/directus / SchemaInspector

Interface SchemaInspector

packages/schema/src/types/schema-inspector.ts:7–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import type { Table } from './table.js';
6
7export 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
34export interface SchemaInspectorConstructor {
35 new (knex: Knex): SchemaInspector;

Callers 16

readByQueryMethod · 0.65
crud.test.tsFile · 0.65
isInstalledFunction · 0.65
runSeedFunction · 0.65
upFunction · 0.65
upFunction · 0.65
crud.test.tsFile · 0.65
crud.test.tsFile · 0.65
translationsMethod · 0.65
upFunction · 0.65
upFunction · 0.65

Implementers 6

MSSQLpackages/schema/src/dialects/mssql.ts
CockroachDBpackages/schema/src/dialects/cockroach
Postgrespackages/schema/src/dialects/postgres.
MySQLpackages/schema/src/dialects/mysql.ts
SQLitepackages/schema/src/dialects/sqlite.ts
oracleDBpackages/schema/src/dialects/oracledb.

Calls

no outgoing calls

Tested by

no test coverage detected