@h3ravel/arquebus 0.3.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,83 @@
1
+ import { Knex } from "knex";
2
+
3
+ //#region src/inspector/types/column.d.ts
4
+ interface Column {
5
+ name: string;
6
+ table: string;
7
+ data_type: string;
8
+ default_value: string | null;
9
+ max_length: number | null;
10
+ numeric_precision: number | null;
11
+ numeric_scale: number | null;
12
+ is_nullable: boolean;
13
+ is_unique: boolean;
14
+ is_primary_key: boolean;
15
+ is_generated: boolean;
16
+ generation_expression?: string | null;
17
+ has_auto_increment: boolean;
18
+ foreign_key_table: string | null;
19
+ foreign_key_column: string | null;
20
+ comment?: string | null;
21
+ schema?: string;
22
+ foreign_key_schema?: string | null;
23
+ collation?: string | null;
24
+ }
25
+ //#endregion
26
+ //#region src/inspector/types/foreign-key.d.ts
27
+ type ForeignKey = {
28
+ table: string;
29
+ column: string;
30
+ foreign_key_table: string;
31
+ foreign_key_column: string;
32
+ foreign_key_schema?: string;
33
+ constraint_name: null | string;
34
+ on_update: null | 'NO ACTION' | 'RESTRICT' | 'CASCADE' | 'SET NULL' | 'SET DEFAULT';
35
+ on_delete: null | 'NO ACTION' | 'RESTRICT' | 'CASCADE' | 'SET NULL' | 'SET DEFAULT';
36
+ };
37
+ //#endregion
38
+ //#region src/inspector/types/table.d.ts
39
+ interface Table {
40
+ name: string;
41
+ comment?: string | null;
42
+ schema?: string;
43
+ collation?: string;
44
+ engine?: string;
45
+ owner?: string;
46
+ sql?: string;
47
+ catalog?: string;
48
+ }
49
+ //#endregion
50
+ //#region src/inspector/types/unique-constraint.d.ts
51
+ type UniqueConstraint = {
52
+ table: string;
53
+ constraint_name: null | string;
54
+ columns: string[];
55
+ };
56
+ //#endregion
57
+ //#region src/inspector/types/schema-inspector.d.ts
58
+ interface SchemaInspector$1 {
59
+ knex: Knex;
60
+ tables(): Promise<string[]>;
61
+ tableInfo(): Promise<Table[]>;
62
+ tableInfo(table: string): Promise<Table>;
63
+ hasTable(table: string): Promise<boolean>;
64
+ columns(table?: string): Promise<{
65
+ table: string;
66
+ column: string;
67
+ }[]>;
68
+ columnInfo(): Promise<Column[]>;
69
+ columnInfo(table?: string): Promise<Column[]>;
70
+ columnInfo(table: string, column: string): Promise<Column>;
71
+ hasColumn(table: string, column: string): Promise<boolean>;
72
+ primary(table: string): Promise<string[] | string | null>;
73
+ foreignKeys(table?: string): Promise<ForeignKey[]>;
74
+ uniqueConstraints?(table?: string): Promise<UniqueConstraint[]>;
75
+ withSchema?(schema: string): void;
76
+ }
77
+ //#endregion
78
+ //#region src/inspector/index.d.ts
79
+ declare class SchemaInspector {
80
+ static inspect(knex: Knex): SchemaInspector$1;
81
+ }
82
+ //#endregion
83
+ export { SchemaInspector };
@@ -0,0 +1,83 @@
1
+ import { Knex } from "knex";
2
+
3
+ //#region src/inspector/types/column.d.ts
4
+ interface Column {
5
+ name: string;
6
+ table: string;
7
+ data_type: string;
8
+ default_value: string | null;
9
+ max_length: number | null;
10
+ numeric_precision: number | null;
11
+ numeric_scale: number | null;
12
+ is_nullable: boolean;
13
+ is_unique: boolean;
14
+ is_primary_key: boolean;
15
+ is_generated: boolean;
16
+ generation_expression?: string | null;
17
+ has_auto_increment: boolean;
18
+ foreign_key_table: string | null;
19
+ foreign_key_column: string | null;
20
+ comment?: string | null;
21
+ schema?: string;
22
+ foreign_key_schema?: string | null;
23
+ collation?: string | null;
24
+ }
25
+ //#endregion
26
+ //#region src/inspector/types/foreign-key.d.ts
27
+ type ForeignKey = {
28
+ table: string;
29
+ column: string;
30
+ foreign_key_table: string;
31
+ foreign_key_column: string;
32
+ foreign_key_schema?: string;
33
+ constraint_name: null | string;
34
+ on_update: null | 'NO ACTION' | 'RESTRICT' | 'CASCADE' | 'SET NULL' | 'SET DEFAULT';
35
+ on_delete: null | 'NO ACTION' | 'RESTRICT' | 'CASCADE' | 'SET NULL' | 'SET DEFAULT';
36
+ };
37
+ //#endregion
38
+ //#region src/inspector/types/table.d.ts
39
+ interface Table {
40
+ name: string;
41
+ comment?: string | null;
42
+ schema?: string;
43
+ collation?: string;
44
+ engine?: string;
45
+ owner?: string;
46
+ sql?: string;
47
+ catalog?: string;
48
+ }
49
+ //#endregion
50
+ //#region src/inspector/types/unique-constraint.d.ts
51
+ type UniqueConstraint = {
52
+ table: string;
53
+ constraint_name: null | string;
54
+ columns: string[];
55
+ };
56
+ //#endregion
57
+ //#region src/inspector/types/schema-inspector.d.ts
58
+ interface SchemaInspector$1 {
59
+ knex: Knex;
60
+ tables(): Promise<string[]>;
61
+ tableInfo(): Promise<Table[]>;
62
+ tableInfo(table: string): Promise<Table>;
63
+ hasTable(table: string): Promise<boolean>;
64
+ columns(table?: string): Promise<{
65
+ table: string;
66
+ column: string;
67
+ }[]>;
68
+ columnInfo(): Promise<Column[]>;
69
+ columnInfo(table?: string): Promise<Column[]>;
70
+ columnInfo(table: string, column: string): Promise<Column>;
71
+ hasColumn(table: string, column: string): Promise<boolean>;
72
+ primary(table: string): Promise<string[] | string | null>;
73
+ foreignKeys(table?: string): Promise<ForeignKey[]>;
74
+ uniqueConstraints?(table?: string): Promise<UniqueConstraint[]>;
75
+ withSchema?(schema: string): void;
76
+ }
77
+ //#endregion
78
+ //#region src/inspector/index.d.ts
79
+ declare class SchemaInspector {
80
+ static inspect(knex: Knex): SchemaInspector$1;
81
+ }
82
+ //#endregion
83
+ export { SchemaInspector };