@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.
- package/bin/index.cjs +4272 -2738
- package/bin/index.js +4367 -2833
- package/dist/browser/index.cjs +2 -0
- package/dist/browser/index.d.cts +94 -7
- package/dist/browser/index.d.ts +94 -7
- package/dist/browser/index.js +2 -1
- package/dist/index.cjs +1502 -17
- package/dist/index.d.cts +130 -10
- package/dist/index.d.ts +130 -10
- package/dist/index.js +1502 -18
- package/dist/inspector/index.cjs +4885 -0
- package/dist/inspector/index.d.cts +83 -0
- package/dist/inspector/index.d.ts +83 -0
- package/dist/inspector/index.js +4859 -0
- package/dist/migrations/index.cjs +4426 -2958
- package/dist/migrations/index.d.cts +134 -17
- package/dist/migrations/index.d.ts +135 -18
- package/dist/migrations/index.js +4354 -2876
- package/package.json +12 -3
- package/types/query-builder.ts +37 -1
- package/src/migrations/stubs/migration-js.stub +0 -21
- package/src/migrations/stubs/migration-ts.stub +0 -18
- package/src/migrations/stubs/migration.create-js.stub +0 -24
- package/src/migrations/stubs/migration.create-ts.stub +0 -21
- package/src/migrations/stubs/migration.update-js.stub +0 -25
- package/src/migrations/stubs/migration.update-ts.stub +0 -22
- package/src/stubs/arquebus.config-js.stub +0 -25
- package/src/stubs/arquebus.config-ts.stub +0 -24
- package/src/stubs/model-js.stub +0 -5
- package/src/stubs/model-ts.stub +0 -5
|
@@ -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 };
|