@@ -31,6 +31,8 @@ export async function getGeneratorMetadata(
31
31
excludedSchemas : [ ] ,
32
32
}
33
33
) : Promise < PostgresMetaResult < GeneratorMetadata > > {
34
+ const start = Date . now ( )
35
+ console . log ( 'getGeneratorMetadata start: ' )
34
36
const includedSchemas = filters . includedSchemas ?? [ ]
35
37
const excludedSchemas = filters . excludedSchemas ?? [ ]
36
38
@@ -48,6 +50,8 @@ export async function getGeneratorMetadata(
48
50
return { data : null , error : tablesError }
49
51
}
50
52
53
+ const startForeignTables = Date . now ( )
54
+ console . log ( 'getGeneratorMetadata foreignTables start: ' , startForeignTables )
51
55
const { data : foreignTables , error : foreignTablesError } = await pgMeta . foreignTables . list ( {
52
56
includedSchemas : includedSchemas . length > 0 ? includedSchemas : undefined ,
53
57
excludedSchemas,
@@ -56,7 +60,12 @@ export async function getGeneratorMetadata(
56
60
if ( foreignTablesError ) {
57
61
return { data : null , error : foreignTablesError }
58
62
}
63
+ const endForeignTables = Date . now ( )
64
+ console . log ( 'getGeneratorMetadata foreignTables end: ' , endForeignTables )
65
+ console . log ( 'elapsedForeignTables: ' , endForeignTables - startForeignTables )
59
66
67
+ const startViews = Date . now ( )
68
+ console . log ( 'getGeneratorMetadata views start: ' , startViews )
60
69
const { data : views , error : viewsError } = await pgMeta . views . list ( {
61
70
includedSchemas : includedSchemas . length > 0 ? includedSchemas : undefined ,
62
71
excludedSchemas,
@@ -75,28 +84,48 @@ export async function getGeneratorMetadata(
75
84
if ( materializedViewsError ) {
76
85
return { data : null , error : materializedViewsError }
77
86
}
87
+ const endViews = Date . now ( )
88
+ console . log ( 'getGeneratorMetadata views end: ' , endViews )
89
+ console . log ( 'elapsedViews: ' , endViews - startViews )
78
90
91
+ const startColumns = Date . now ( )
92
+ console . log ( 'getGeneratorMetadata columns start: ' , startColumns )
79
93
const { data : columns , error : columnsError } = await pgMeta . columns . list ( {
80
94
includedSchemas : includedSchemas . length > 0 ? includedSchemas : undefined ,
81
95
excludedSchemas,
82
96
} )
83
97
if ( columnsError ) {
84
98
return { data : null , error : columnsError }
85
99
}
100
+ const endColumns = Date . now ( )
101
+ console . log ( 'getGeneratorMetadata columns end: ' , endColumns )
102
+ console . log ( 'elapsedColumns: ' , endColumns - startColumns )
86
103
104
+ const startRelationships = Date . now ( )
105
+ console . log ( 'getGeneratorMetadata relationships start: ' , startRelationships )
87
106
const { data : relationships , error : relationshipsError } = await pgMeta . relationships . list ( )
88
107
if ( relationshipsError ) {
89
108
return { data : null , error : relationshipsError }
90
109
}
110
+ const endRelationships = Date . now ( )
111
+ console . log ( 'getGeneratorMetadata relationships end: ' , endRelationships )
112
+ console . log ( 'elapsedRelationships: ' , endRelationships - startRelationships )
91
113
114
+ const startFunctions = Date . now ( )
115
+ console . log ( 'getGeneratorMetadata functions start: ' , startFunctions )
92
116
const { data : functions , error : functionsError } = await pgMeta . functions . list ( {
93
117
includedSchemas : includedSchemas . length > 0 ? includedSchemas : undefined ,
94
118
excludedSchemas,
95
119
} )
96
120
if ( functionsError ) {
97
121
return { data : null , error : functionsError }
98
122
}
123
+ const endFunctions = Date . now ( )
124
+ console . log ( 'getGeneratorMetadata functions end: ' , endFunctions )
125
+ console . log ( 'elapsedFunctions: ' , endFunctions - startFunctions )
99
126
127
+ const startTypes = Date . now ( )
128
+ console . log ( 'getGeneratorMetadata types start: ' , startTypes )
100
129
const { data : types , error : typesError } = await pgMeta . types . list ( {
101
130
includeTableTypes : true ,
102
131
includeArrayTypes : true ,
@@ -105,9 +134,16 @@ export async function getGeneratorMetadata(
105
134
if ( typesError ) {
106
135
return { data : null , error : typesError }
107
136
}
137
+ const endTypes = Date . now ( )
138
+ console . log ( 'getGeneratorMetadata types end: ' , endTypes )
139
+ console . log ( 'elapsedTypes: ' , endTypes - startTypes )
108
140
109
141
await pgMeta . end ( )
110
142
143
+ const end = Date . now ( )
144
+ console . log ( 'getGeneratorMetadata end: ' , end )
145
+ console . log ( 'elapsed: ' , end - start )
146
+
111
147
return {
112
148
data : {
113
149
schemas : schemas . filter (
0 commit comments