@l-v-yonsama/multi-platform-database-drivers 0.11.14 → 0.13.20

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.
Files changed (71) hide show
  1. package/README.md +5 -0
  2. package/built/schema/log-parse-config.schema.json +406 -0
  3. package/built/src/drivers/RDSBaseDriver.d.ts +2 -1
  4. package/built/src/drivers/RDSBaseDriver.js +9 -0
  5. package/built/src/drivers/RDSBaseDriver.js.map +1 -1
  6. package/built/src/drivers/memcache/helper.js +1 -1
  7. package/built/src/drivers/memcache/helper.js.map +1 -1
  8. package/built/src/helpers/SQLHelper.d.ts +11 -1
  9. package/built/src/helpers/SQLHelper.js +94 -1
  10. package/built/src/helpers/SQLHelper.js.map +1 -1
  11. package/built/src/types/helpers/index.d.ts +9 -1
  12. package/built/src/types/helpers/index.js +3 -1
  13. package/built/src/types/helpers/index.js.map +1 -1
  14. package/built/src/types/index.d.ts +1 -0
  15. package/built/src/types/index.js +1 -0
  16. package/built/src/types/index.js.map +1 -1
  17. package/built/src/types/utils/index.d.ts +186 -0
  18. package/built/src/types/utils/index.js +29 -0
  19. package/built/src/types/utils/index.js.map +1 -0
  20. package/built/src/utils/index.d.ts +1 -0
  21. package/built/src/utils/index.js +1 -0
  22. package/built/src/utils/index.js.map +1 -1
  23. package/built/src/utils/log/LogParser.d.ts +8 -0
  24. package/built/src/utils/log/LogParser.js +162 -0
  25. package/built/src/utils/log/LogParser.js.map +1 -0
  26. package/built/src/utils/log/buildSqlExecutions.d.ts +7 -0
  27. package/built/src/utils/log/buildSqlExecutions.js +267 -0
  28. package/built/src/utils/log/buildSqlExecutions.js.map +1 -0
  29. package/built/src/utils/log/classify/classifyEvent.d.ts +3 -0
  30. package/built/src/utils/log/classify/classifyEvent.js +91 -0
  31. package/built/src/utils/log/classify/classifyEvent.js.map +1 -0
  32. package/built/src/utils/log/constant/base.d.ts +97 -0
  33. package/built/src/utils/log/constant/base.js +136 -0
  34. package/built/src/utils/log/constant/base.js.map +1 -0
  35. package/built/src/utils/log/constant/index.d.ts +3 -0
  36. package/built/src/utils/log/constant/index.js +7 -0
  37. package/built/src/utils/log/constant/index.js.map +1 -0
  38. package/built/src/utils/log/constant/logEventSplitPreset.d.ts +34 -0
  39. package/built/src/utils/log/constant/logEventSplitPreset.js +299 -0
  40. package/built/src/utils/log/constant/logEventSplitPreset.js.map +1 -0
  41. package/built/src/utils/log/constant/sqlLogParsePreset.d.ts +328 -0
  42. package/built/src/utils/log/constant/sqlLogParsePreset.js +383 -0
  43. package/built/src/utils/log/constant/sqlLogParsePreset.js.map +1 -0
  44. package/built/src/utils/log/detect/presetDetector.d.ts +11 -0
  45. package/built/src/utils/log/detect/presetDetector.js +140 -0
  46. package/built/src/utils/log/detect/presetDetector.js.map +1 -0
  47. package/built/src/utils/log/extract/runExtractors.d.ts +2 -0
  48. package/built/src/utils/log/extract/runExtractors.js +105 -0
  49. package/built/src/utils/log/extract/runExtractors.js.map +1 -0
  50. package/built/src/utils/log/index.d.ts +10 -0
  51. package/built/src/utils/log/index.js +14 -0
  52. package/built/src/utils/log/index.js.map +1 -0
  53. package/built/src/utils/log/logSummary.d.ts +6 -0
  54. package/built/src/utils/log/logSummary.js +91 -0
  55. package/built/src/utils/log/logSummary.js.map +1 -0
  56. package/built/src/utils/log/pattern/logEventPattern.d.ts +3 -0
  57. package/built/src/utils/log/pattern/logEventPattern.js +123 -0
  58. package/built/src/utils/log/pattern/logEventPattern.js.map +1 -0
  59. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.d.ts +11 -0
  60. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.js +161 -0
  61. package/built/src/utils/log/rdh/convertExtractedSqlRdhResult.js.map +1 -0
  62. package/built/src/utils/log/split/splitLogEvents.d.ts +2 -0
  63. package/built/src/utils/log/split/splitLogEvents.js +38 -0
  64. package/built/src/utils/log/split/splitLogEvents.js.map +1 -0
  65. package/built/src/utils/log/sql/removeSqlComments.d.ts +1 -0
  66. package/built/src/utils/log/sql/removeSqlComments.js +11 -0
  67. package/built/src/utils/log/sql/removeSqlComments.js.map +1 -0
  68. package/built/src/utils/log/validator.d.ts +6 -0
  69. package/built/src/utils/log/validator.js +272 -0
  70. package/built/src/utils/log/validator.js.map +1 -0
  71. package/package.json +15 -7
@@ -0,0 +1,328 @@
1
+ export declare const SQL_LOG_PARSE_PRESETS: {
2
+ readonly Hibernate: {
3
+ readonly classify: readonly [{
4
+ readonly type: "DATA_SOURCE";
5
+ readonly pattern: "^Fetching JDBC Connection from DataSource";
6
+ }, {
7
+ readonly type: "TX_BEGIN";
8
+ readonly pattern: "^Creating new transaction with name ";
9
+ }, {
10
+ readonly type: "TX_COMMIT";
11
+ readonly pattern: "^Initiating transaction commit";
12
+ }, {
13
+ readonly type: "TX_ROLLBACK";
14
+ readonly pattern: "^Initiating transaction rollback";
15
+ }, {
16
+ readonly type: "TX_METHOD_ENTER";
17
+ readonly pattern: "^Getting transaction for ";
18
+ }, {
19
+ readonly type: "TX_METHOD_EXIT";
20
+ readonly pattern: "^Completing transaction for ";
21
+ }, {
22
+ readonly type: "SQL_START";
23
+ readonly field: "logger";
24
+ readonly pattern: "^org\\.hibernate\\.SQL$";
25
+ }, {
26
+ readonly type: "SQL_PARAMS";
27
+ readonly field: "logger";
28
+ readonly pattern: "^org\\.hibernate\\.orm\\.jdbc\\.bind$";
29
+ readonly transforms: readonly [{
30
+ readonly pattern: "^binding parameter (.*)";
31
+ readonly replace: "$1";
32
+ }];
33
+ }, {
34
+ readonly type: "SQL_ERROR";
35
+ readonly pattern: "^SQL Error: \\w+, SQLState: \\w+";
36
+ }, {
37
+ readonly type: "SQL_ERROR_DETAIL";
38
+ readonly field: "logger";
39
+ readonly pattern: ".+SqlExceptionHelper$";
40
+ }, {
41
+ readonly type: "FW_ERROR";
42
+ readonly pattern: "(ConstraintViolationException|EntityExistsException|PersistentObjectException)";
43
+ }];
44
+ readonly extractors: readonly [{
45
+ readonly name: "hibernate";
46
+ readonly framework: "Hibernate";
47
+ readonly start: "SQL_START";
48
+ readonly steps: readonly [{
49
+ readonly type: "SQL_START";
50
+ readonly action: "captureSql";
51
+ }, {
52
+ readonly type: "SQL_PARAMS";
53
+ readonly action: "captureParams";
54
+ readonly optional: true;
55
+ }];
56
+ }, {
57
+ readonly name: "hibernate-sql-error";
58
+ readonly framework: "Hibernate";
59
+ readonly start: "SQL_ERROR";
60
+ readonly steps: readonly [{
61
+ readonly type: "SQL_ERROR";
62
+ readonly action: "captureError";
63
+ }, {
64
+ readonly type: "SQL_ERROR_DETAIL";
65
+ readonly action: "captureErrorDetail";
66
+ readonly optional: true;
67
+ }];
68
+ }, {
69
+ readonly name: "hibernate-orm-error";
70
+ readonly framework: "Hibernate";
71
+ readonly start: "FW_ERROR";
72
+ readonly steps: readonly [{
73
+ readonly type: "FW_ERROR";
74
+ readonly action: "captureError";
75
+ }];
76
+ }];
77
+ };
78
+ readonly MyBatis: {
79
+ readonly classify: readonly [{
80
+ readonly type: "CONN_AUTOCOMMIT";
81
+ readonly pattern: "will not be managed by Spring";
82
+ }, {
83
+ readonly type: "CONN_TRANSACTIONAL";
84
+ readonly pattern: "Registering transaction synchronization for SqlSession";
85
+ }, {
86
+ readonly type: "DATA_SOURCE";
87
+ readonly pattern: "^Fetching JDBC Connection from DataSource";
88
+ readonly expandMessage: true;
89
+ }, {
90
+ readonly type: "TX_BEGIN";
91
+ readonly pattern: "^Creating new transaction with name ";
92
+ }, {
93
+ readonly type: "TX_COMMIT";
94
+ readonly pattern: "^Initiating transaction commit";
95
+ }, {
96
+ readonly type: "TX_ROLLBACK";
97
+ readonly pattern: "^Initiating transaction rollback";
98
+ }, {
99
+ readonly type: "TX_METHOD_ENTER";
100
+ readonly pattern: "^Getting transaction for ";
101
+ readonly expandMessage: true;
102
+ }, {
103
+ readonly type: "TX_METHOD_EXIT";
104
+ readonly pattern: "^Completing transaction for ";
105
+ }, {
106
+ readonly type: "SQL_START";
107
+ readonly pattern: "^==>\\s+Preparing:";
108
+ readonly transforms: readonly [{
109
+ readonly pattern: "^==>\\s+Preparing:\\s*";
110
+ readonly replace: "";
111
+ }];
112
+ readonly context: readonly [{
113
+ readonly contextName: "daoClass";
114
+ readonly eventFieldName: "logger";
115
+ readonly pattern: "^(.+)\\.([^.]+)$";
116
+ readonly replace: "$1";
117
+ }, {
118
+ readonly contextName: "daoMethod";
119
+ readonly eventFieldName: "logger";
120
+ readonly pattern: "^(.+)\\.([^.]+)$";
121
+ readonly replace: "$2";
122
+ }];
123
+ }, {
124
+ readonly type: "SQL_PARAMS";
125
+ readonly pattern: "^==>\\s+Parameters:";
126
+ readonly transforms: readonly [{
127
+ readonly pattern: "^==>\\s+Parameters:\\s*";
128
+ readonly replace: "";
129
+ }];
130
+ }, {
131
+ readonly type: "SQL_COLUMNS";
132
+ readonly pattern: "^<==\\s+Columns:";
133
+ readonly transforms: readonly [{
134
+ readonly pattern: "^<==\\s+Columns:";
135
+ readonly replace: "";
136
+ }];
137
+ }, {
138
+ readonly type: "SQL_ROW";
139
+ readonly pattern: "^<==\\s+Row:";
140
+ readonly transforms: readonly [{
141
+ readonly pattern: "^<==\\s+Row:";
142
+ readonly replace: "";
143
+ }];
144
+ }, {
145
+ readonly type: "SQL_RESULT";
146
+ readonly pattern: "^<==\\s+(Total|Updates):";
147
+ readonly transforms: readonly [{
148
+ readonly pattern: "^<==\\s+(?:Total|Updates):\\s*";
149
+ readonly replace: "";
150
+ }];
151
+ }, {
152
+ readonly type: "SQL_ERROR";
153
+ readonly field: "logger";
154
+ readonly pattern: ".+SQLErrorCodeSQLExceptionTranslator$";
155
+ }];
156
+ readonly extractors: readonly [{
157
+ readonly name: "mybatis";
158
+ readonly framework: "MyBatis";
159
+ readonly start: "SQL_START";
160
+ readonly steps: readonly [{
161
+ readonly type: "SQL_START";
162
+ readonly action: "captureSql";
163
+ }, {
164
+ readonly type: "SQL_PARAMS";
165
+ readonly action: "captureParams";
166
+ readonly optional: true;
167
+ }, {
168
+ readonly type: "SQL_COLUMNS";
169
+ readonly action: "captureColumns";
170
+ readonly optional: true;
171
+ }, {
172
+ readonly type: "SQL_ROW";
173
+ readonly action: "captureRow";
174
+ readonly optional: true;
175
+ }, {
176
+ readonly type: "SQL_RESULT";
177
+ readonly action: "captureResult";
178
+ readonly optional: true;
179
+ }];
180
+ }, {
181
+ readonly name: "mybatis-sql-error";
182
+ readonly framework: "MyBatis";
183
+ readonly start: "SQL_ERROR";
184
+ readonly steps: readonly [{
185
+ readonly type: "SQL_ERROR";
186
+ readonly action: "captureError";
187
+ }];
188
+ }];
189
+ };
190
+ readonly S2Jdbc: {
191
+ readonly classify: readonly [{
192
+ readonly type: "SQL_SINGLE";
193
+ readonly field: "logger";
194
+ readonly pattern: "^query\\.(Auto|SqlFile)(Batch)?(Select|Insert|Update|Delete)Impl$";
195
+ }, {
196
+ readonly type: "ERROR";
197
+ readonly field: "level";
198
+ readonly pattern: "^ERROR$";
199
+ readonly expandMessage: true;
200
+ }];
201
+ readonly extractors: readonly [{
202
+ readonly name: "s2jdbc";
203
+ readonly framework: "S2Jdbc";
204
+ readonly start: "SQL_SINGLE";
205
+ readonly steps: readonly [{
206
+ readonly type: "SQL_SINGLE";
207
+ readonly action: "captureSql";
208
+ }];
209
+ }];
210
+ };
211
+ readonly Doma: {
212
+ readonly classify: readonly [{
213
+ readonly type: "TX_METHOD_ENTER";
214
+ readonly pattern: "^\\[DOMA2220\\] ENTER";
215
+ readonly context: readonly [{
216
+ readonly contextName: "daoClass";
217
+ readonly pattern: "^.*CLASS=([^\\s]+).*";
218
+ readonly replace: "$1";
219
+ }, {
220
+ readonly contextName: "daoMethod";
221
+ readonly pattern: "^.*METHOD=([^\\s]+).*";
222
+ readonly replace: "$1";
223
+ }];
224
+ }, {
225
+ readonly type: "TX_METHOD_EXIT";
226
+ readonly pattern: "^\\[DOMA2221\\] EXIT";
227
+ }, {
228
+ readonly type: "SQL_SINGLE";
229
+ readonly pattern: "^\\[DOMA2076\\] SQL LOG( : PATH=\\[[^\\]]+\\],)?";
230
+ readonly transforms: readonly [{
231
+ readonly pattern: "^\\[DOMA2076\\] SQL LOG( : PATH=\\[[^\\]]+\\],)?";
232
+ readonly replace: "";
233
+ }];
234
+ }, {
235
+ readonly type: "SQL_ERROR";
236
+ readonly pattern: "^\\[DOMA2222\\] THROW .+EXCEPTION=.+";
237
+ readonly transforms: readonly [{
238
+ readonly pattern: "^\\[DOMA2222\\] THROW .+EXCEPTION=(.+)";
239
+ readonly replace: "$1";
240
+ }];
241
+ }, {
242
+ readonly type: "SQL_ERROR_DETAIL";
243
+ readonly pattern: "The( detailed)? cause is as follows:";
244
+ readonly transforms: readonly [{
245
+ readonly pattern: "[\\s\\S]+The( detailed)? cause is as follows: (.+)";
246
+ readonly replace: "$2";
247
+ }];
248
+ }];
249
+ readonly extractors: readonly [{
250
+ readonly name: "doma";
251
+ readonly framework: "Doma";
252
+ readonly start: "SQL_SINGLE";
253
+ readonly steps: readonly [{
254
+ readonly type: "SQL_SINGLE";
255
+ readonly action: "captureSql";
256
+ }];
257
+ }, {
258
+ readonly name: "doma-error";
259
+ readonly framework: "Doma";
260
+ readonly start: "SQL_ERROR";
261
+ readonly steps: readonly [{
262
+ readonly type: "SQL_ERROR";
263
+ readonly action: "captureError";
264
+ }, {
265
+ readonly type: "SQL_ERROR_DETAIL";
266
+ readonly action: "captureErrorDetail";
267
+ readonly optional: true;
268
+ }];
269
+ }];
270
+ };
271
+ readonly SpringJdbc: {
272
+ readonly classify: readonly [{
273
+ readonly type: "TX_BEGIN";
274
+ readonly pattern: "^Creating new transaction with name ";
275
+ }, {
276
+ readonly type: "TX_COMMIT";
277
+ readonly pattern: "^Initiating transaction commit";
278
+ }, {
279
+ readonly type: "TX_ROLLBACK";
280
+ readonly pattern: "^Initiating transaction rollback";
281
+ }, {
282
+ readonly type: "TX_METHOD_ENTER";
283
+ readonly pattern: "^Getting transaction for ";
284
+ }, {
285
+ readonly type: "TX_METHOD_EXIT";
286
+ readonly pattern: "^Completing transaction for ";
287
+ }, {
288
+ readonly type: "SQL_START";
289
+ readonly pattern: "Executing prepared SQL statement";
290
+ readonly transforms: readonly [{
291
+ readonly pattern: "^.*\\[(.*)\\]$";
292
+ readonly replace: "$1";
293
+ }];
294
+ }, {
295
+ readonly type: "SQL_PARAMS";
296
+ readonly pattern: "^Setting SQL statement parameter value:";
297
+ readonly transforms: readonly [{
298
+ readonly pattern: "^Setting SQL statement parameter value: (.*)";
299
+ readonly replace: "$1";
300
+ }];
301
+ }, {
302
+ readonly type: "SQL_ERROR";
303
+ readonly pattern: "org.springframework.(jdbc|dao).[a-zA-Z0-9]+Exception: ";
304
+ }];
305
+ readonly extractors: readonly [{
306
+ readonly name: "spring-jdbc";
307
+ readonly framework: "SpringJdbc";
308
+ readonly start: "SQL_START";
309
+ readonly steps: readonly [{
310
+ readonly type: "SQL_START";
311
+ readonly action: "captureSql";
312
+ }, {
313
+ readonly type: "SQL_PARAMS";
314
+ readonly action: "captureParams";
315
+ readonly optional: true;
316
+ }];
317
+ }, {
318
+ readonly name: "spring-jdbc-error";
319
+ readonly framework: "SpringJdbc";
320
+ readonly start: "SQL_ERROR";
321
+ readonly steps: readonly [{
322
+ readonly type: "SQL_ERROR";
323
+ readonly action: "captureError";
324
+ }];
325
+ }];
326
+ };
327
+ };
328
+ export type SqlLogParsePresetName = keyof typeof SQL_LOG_PARSE_PRESETS;