@dbml/connector 8.4.0-alpha.0 → 8.4.0-custom-metadata.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,3 @@
1
+ import { DatabaseSchema } from '../types';
2
+ declare function fetchSchemaJson(keyFilename: string): Promise<DatabaseSchema>;
3
+ export { fetchSchemaJson };
@@ -0,0 +1,3 @@
1
+ import { DatabaseSchema } from './types';
2
+ declare const fetchSchemaJson: (connection: string, databaseType: string) => Promise<DatabaseSchema>;
3
+ export { fetchSchemaJson, };
@@ -0,0 +1,3 @@
1
+ import { DatabaseSchema } from '../types';
2
+ declare const fetchSchemaJson: (connection: string) => Promise<DatabaseSchema>;
3
+ export { fetchSchemaJson, };
@@ -0,0 +1,3 @@
1
+ import { DatabaseSchema } from '../types';
2
+ declare function fetchSchemaJson(connection: string): Promise<DatabaseSchema>;
3
+ export { fetchSchemaJson, };
@@ -0,0 +1,7 @@
1
+ import { Connection } from 'oracledb';
2
+ import { CheckConstraintDictionary, IndexesDictionary, TableConstraintsDictionary } from '../types';
3
+ export declare function generateConstraints(client: Connection): Promise<{
4
+ indexes: IndexesDictionary;
5
+ tableConstraints: TableConstraintsDictionary;
6
+ checks: CheckConstraintDictionary;
7
+ }>;
@@ -0,0 +1,3 @@
1
+ import { DatabaseSchema } from '../types';
2
+ declare function fetchSchemaJson(connection: string): Promise<DatabaseSchema>;
3
+ export { fetchSchemaJson, };
@@ -0,0 +1,3 @@
1
+ import { Connection } from 'oracledb';
2
+ import { IndexesDictionary } from '../types';
3
+ export declare function generateIndexes(client: Connection): Promise<IndexesDictionary>;
@@ -0,0 +1,3 @@
1
+ import { Connection } from 'oracledb';
2
+ import { Ref } from '../types';
3
+ export declare function generateRawRefs(client: Connection): Promise<Ref[]>;
@@ -0,0 +1,7 @@
1
+ import { Connection } from 'oracledb';
2
+ import { FieldsDictionary, Table } from '../types';
3
+ export declare function generateTablesAndFields(client: Connection): Promise<{
4
+ tables: Table[];
5
+ fields: FieldsDictionary;
6
+ }>;
7
+ export declare function getFieldType(dataType: string, characterMaximumLength: number, numericPrecision: number | null, numericScale: number | null): string;
@@ -0,0 +1,9 @@
1
+ export declare const LIST_SEPARATOR = "@@@@@@@@";
2
+ export declare const EXECUTE_OPTIONS: {
3
+ outFormat: number;
4
+ };
5
+ export declare function processEasyConnectString(connection: string): {
6
+ username: string;
7
+ password: string;
8
+ dbidentifier: string;
9
+ };
@@ -0,0 +1,3 @@
1
+ import { DatabaseSchema } from '../types';
2
+ declare const fetchSchemaJson: (connection: string) => Promise<DatabaseSchema>;
3
+ export { fetchSchemaJson, };
@@ -0,0 +1,3 @@
1
+ import { DatabaseSchema } from '../types';
2
+ declare const fetchSchemaJson: (connection: string) => Promise<DatabaseSchema>;
3
+ export { fetchSchemaJson, };
@@ -0,0 +1,99 @@
1
+ interface NoteInfo {
2
+ value: string;
3
+ }
4
+ interface TypeInfo {
5
+ type_name: string;
6
+ schemaName: string | null;
7
+ }
8
+ type DefaultType = 'string' | 'number' | 'boolean' | 'expression';
9
+ interface DefaultInfo {
10
+ type: DefaultType;
11
+ value: string;
12
+ }
13
+ interface Field {
14
+ name: string;
15
+ type: TypeInfo;
16
+ dbdefault: DefaultInfo | null;
17
+ not_null: boolean;
18
+ increment: boolean;
19
+ pk?: boolean;
20
+ unique?: boolean;
21
+ note: NoteInfo;
22
+ }
23
+ interface Table {
24
+ name: string;
25
+ schemaName: string;
26
+ note: NoteInfo;
27
+ }
28
+ interface FieldsDictionary {
29
+ [key: string]: Field[];
30
+ }
31
+ interface CheckConstraint {
32
+ name?: string;
33
+ expression: string;
34
+ }
35
+ interface CheckConstraintDictionary {
36
+ [tableName: string]: CheckConstraint[];
37
+ }
38
+ interface TableConstraint {
39
+ [fieldName: string]: {
40
+ pk?: boolean;
41
+ unique?: boolean;
42
+ checks: CheckConstraint[];
43
+ };
44
+ }
45
+ interface TableConstraintsDictionary {
46
+ [tableIdentifier: string]: TableConstraint;
47
+ }
48
+ interface RefEndpoint {
49
+ tableName: string;
50
+ schemaName: string;
51
+ fieldNames: string[];
52
+ relation: '*' | '1';
53
+ }
54
+ interface Ref {
55
+ name: string;
56
+ endpoints: RefEndpoint[];
57
+ onDelete: string | null;
58
+ onUpdate: string | null;
59
+ }
60
+ interface EnumValue {
61
+ name: string;
62
+ }
63
+ interface Enum {
64
+ name: string;
65
+ schemaName: string;
66
+ values: EnumValue[];
67
+ }
68
+ interface IndexColumn {
69
+ type: 'column' | 'expression';
70
+ value: string;
71
+ }
72
+ interface Index {
73
+ name: string;
74
+ type: string;
75
+ unique?: boolean;
76
+ pk?: boolean;
77
+ columns: IndexColumn[];
78
+ }
79
+ interface IndexesDictionary {
80
+ [tableIdentifier: string]: Index[];
81
+ }
82
+ interface DatabaseSchema {
83
+ tables: Table[];
84
+ fields: FieldsDictionary;
85
+ enums: Enum[];
86
+ tableConstraints: TableConstraintsDictionary;
87
+ refs: Ref[];
88
+ indexes: IndexesDictionary;
89
+ checks: CheckConstraintDictionary;
90
+ }
91
+ interface BigQueryCredentials {
92
+ projectId?: string;
93
+ credentials?: {
94
+ clientEmail: string;
95
+ privateKey: string;
96
+ };
97
+ datasets: string[];
98
+ }
99
+ export { NoteInfo, TypeInfo, DefaultType, DefaultInfo, Field, Table, FieldsDictionary, TableConstraint, TableConstraintsDictionary, RefEndpoint, Ref, EnumValue, Enum, IndexColumn, Index, IndexesDictionary, DatabaseSchema, BigQueryCredentials, CheckConstraint, CheckConstraintDictionary, };