pg-migration-engine 0.1.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.
Files changed (104) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +304 -0
  3. package/package.json +52 -0
  4. package/src/behavioral/behavioral-applier.js +374 -0
  5. package/src/behavioral/behavioral-extractor.js +266 -0
  6. package/src/behavioral/behavioral-puller.js +35 -0
  7. package/src/behavioral/index.js +4 -0
  8. package/src/behavioral/phase-sorter.js +24 -0
  9. package/src/constants.js +97 -0
  10. package/src/ddl-generator/alter-generator.js +1512 -0
  11. package/src/ddl-generator/comment-generator.js +95 -0
  12. package/src/ddl-generator/create-generator.js +1426 -0
  13. package/src/ddl-generator/drop-generator.js +194 -0
  14. package/src/ddl-generator/generator.js +78 -0
  15. package/src/ddl-generator/grant-generator.js +31 -0
  16. package/src/ddl-generator/index.js +3 -0
  17. package/src/ddl-generator/pg-version.js +15 -0
  18. package/src/ddl-generator/rename-generator.js +88 -0
  19. package/src/ddl-generator/safe-patterns.js +241 -0
  20. package/src/differ/change-classifier.js +192 -0
  21. package/src/differ/dependency-resolver.js +523 -0
  22. package/src/differ/index.js +12 -0
  23. package/src/differ/object-matcher.js +510 -0
  24. package/src/differ/property-differ.js +1134 -0
  25. package/src/differ/risk-tagger.js +561 -0
  26. package/src/differ/schema-differ.js +309 -0
  27. package/src/differ/utils/levenshtein.js +210 -0
  28. package/src/differ/utils/path-builder.js +198 -0
  29. package/src/differ/utils/type-compatibility.js +472 -0
  30. package/src/errors.js +147 -0
  31. package/src/executor/drift-detector.js +221 -0
  32. package/src/executor/index.js +7 -0
  33. package/src/executor/lock-manager.js +308 -0
  34. package/src/executor/migration-executor.js +1249 -0
  35. package/src/executor/progress-tracker.js +81 -0
  36. package/src/executor/recovery-manager.js +47 -0
  37. package/src/executor/snapshot-manager.js +22 -0
  38. package/src/executor/sql-splitter.js +120 -0
  39. package/src/executor/transaction-manager.js +288 -0
  40. package/src/index.js +483 -0
  41. package/src/introspection/index.js +4 -0
  42. package/src/introspection/introspector.js +250 -0
  43. package/src/introspection/queries/access-methods.js +29 -0
  44. package/src/introspection/queries/casts.js +38 -0
  45. package/src/introspection/queries/collations.js +51 -0
  46. package/src/introspection/queries/comments.js +66 -0
  47. package/src/introspection/queries/constraints.js +65 -0
  48. package/src/introspection/queries/conversions.js +39 -0
  49. package/src/introspection/queries/databases.js +43 -0
  50. package/src/introspection/queries/default-privileges.js +37 -0
  51. package/src/introspection/queries/event-triggers.js +43 -0
  52. package/src/introspection/queries/extensions.js +21 -0
  53. package/src/introspection/queries/foreign-data.js +136 -0
  54. package/src/introspection/queries/functions.js +75 -0
  55. package/src/introspection/queries/grants.js +38 -0
  56. package/src/introspection/queries/index.js +33 -0
  57. package/src/introspection/queries/indexes.js +99 -0
  58. package/src/introspection/queries/inheritance.js +24 -0
  59. package/src/introspection/queries/multiranges.js +37 -0
  60. package/src/introspection/queries/operators.js +180 -0
  61. package/src/introspection/queries/partitions.js +42 -0
  62. package/src/introspection/queries/pg18-19.js +43 -0
  63. package/src/introspection/queries/policies.js +35 -0
  64. package/src/introspection/queries/procedural-languages.js +36 -0
  65. package/src/introspection/queries/publications.js +114 -0
  66. package/src/introspection/queries/roles.js +66 -0
  67. package/src/introspection/queries/rules.js +49 -0
  68. package/src/introspection/queries/sequences.js +37 -0
  69. package/src/introspection/queries/statistics.js +74 -0
  70. package/src/introspection/queries/subscriptions.js +99 -0
  71. package/src/introspection/queries/tables.js +151 -0
  72. package/src/introspection/queries/tablespaces.js +36 -0
  73. package/src/introspection/queries/text-search.js +146 -0
  74. package/src/introspection/queries/triggers.js +61 -0
  75. package/src/introspection/queries/types.js +106 -0
  76. package/src/introspection/queries/views.js +146 -0
  77. package/src/introspection/translator.js +1283 -0
  78. package/src/introspection/version-detector.js +25 -0
  79. package/src/planner/backfill-planner.js +36 -0
  80. package/src/planner/dry-run.js +21 -0
  81. package/src/planner/index.js +6 -0
  82. package/src/planner/migration-planner.js +356 -0
  83. package/src/planner/smart-migrator.js +82 -0
  84. package/src/planner/step-sequencer.js +61 -0
  85. package/src/planner/type-registry.js +47 -0
  86. package/src/risk/compatibility-checker.js +29 -0
  87. package/src/risk/data-loss-checker.js +32 -0
  88. package/src/risk/destructive-checker.js +38 -0
  89. package/src/risk/index.js +6 -0
  90. package/src/risk/lock-analyzer.js +39 -0
  91. package/src/risk/recommendations.js +44 -0
  92. package/src/risk/risk-engine.js +25 -0
  93. package/src/storage/index.js +5 -0
  94. package/src/storage/memory-storage.js +87 -0
  95. package/src/storage/migration-table.js +423 -0
  96. package/src/storage/rollback-generator.js +344 -0
  97. package/src/types/changes.js +136 -0
  98. package/src/types/connection.js +17 -0
  99. package/src/types/execution.js +107 -0
  100. package/src/types/index.js +1 -0
  101. package/src/types/migration.js +67 -0
  102. package/src/types/risk.js +32 -0
  103. package/src/types/schema.d.ts +1004 -0
  104. package/src/types/schema.js +561 -0
@@ -0,0 +1,561 @@
1
+ /**
2
+ * SchemaSnapshot - Complete representation of a PostgreSQL database schema
3
+ * @typedef {Object} SchemaSnapshot
4
+ * @property {{numeric:number,major:number,string:string}} version
5
+ * @property {string} timestamp
6
+ * @property {string} checksum
7
+ * @property {DatabaseInfo} [database]
8
+ * @property {Record<string, SchemaInfo>} schemas
9
+ * @property {Record<string, TableInfo>} tables
10
+ * @property {Record<string, ViewInfo>} views
11
+ * @property {Record<string, MaterializedViewInfo>} materializedViews
12
+ * @property {Record<string, IndexInfo>} indexes
13
+ * @property {Record<string, FunctionInfo>} functions
14
+ * @property {Record<string, ProcedureInfo>} procedures
15
+ * @property {Record<string, AggregateInfo>} aggregates
16
+ * @property {Record<string, TriggerInfo>} triggers
17
+ * @property {Record<string, EventTriggerInfo>} eventTriggers
18
+ * @property {Record<string, TypeInfo>} types
19
+ * @property {Record<string, SequenceInfo>} sequences
20
+ * @property {Record<string, ExtensionInfo>} extensions
21
+ * @property {Record<string, PolicyInfo>} policies
22
+ * @property {Record<string, ConstraintInfo>} constraints
23
+ * @property {Record<string, string>} comments
24
+ * @property {GrantInfo[]} grants
25
+ * @property {Record<string, StatisticsInfo>} statistics
26
+ * @property {Record<string, CollationInfo>} collations
27
+ * @property {Record<string, ConversionInfo>} conversions
28
+ * @property {Record<string, OperatorInfo>} operators
29
+ * @property {Record<string, OperatorClassInfo>} operatorClasses
30
+ * @property {Record<string, OperatorFamilyInfo>} operatorFamilies
31
+ * @property {Record<string, TextSearchConfigInfo>} textSearchConfigs
32
+ * @property {Record<string, TextSearchDictInfo>} textSearchDictionaries
33
+ * @property {Record<string, TextSearchParserInfo>} textSearchParsers
34
+ * @property {Record<string, TextSearchTemplateInfo>} textSearchTemplates
35
+ * @property {Record<string, ForeignDataWrapperInfo>} foreignDataWrappers
36
+ * @property {Record<string, ForeignServerInfo>} foreignServers
37
+ * @property {Record<string, UserMappingInfo>} userMappings
38
+ * @property {Record<string, CastInfo>} casts
39
+ * @property {Record<string, RuleInfo>} rules
40
+ * @property {Record<string, RoleInfo>} roles
41
+ * @property {Record<string, TablespaceInfo>} tablespaces
42
+ * @property {Record<string, AccessMethodInfo>} accessMethods
43
+ * @property {Record<string, LanguageInfo>} languages
44
+ * @property {Record<string, DefaultPrivilegeInfo>} defaultPrivileges
45
+ * @property {Record<string, DatabaseInfo>} databases
46
+ * @property {Record<string, PublicationInfo>} publications
47
+ * @property {Record<string, SubscriptionInfo>} subscriptions
48
+ */
49
+
50
+ /**
51
+ * @typedef {Object} SchemaInfo
52
+ * @property {string} name
53
+ * @property {string} owner
54
+ */
55
+
56
+ /**
57
+ * @typedef {Object} DatabaseInfo
58
+ * @property {string} name
59
+ * @property {string} owner
60
+ * @property {string} encoding
61
+ * @property {string} collate
62
+ * @property {string} ctype
63
+ * @property {boolean} [isTemplate]
64
+ * @property {boolean} [allowConn]
65
+ */
66
+
67
+ /**
68
+ * @typedef {Object} TableInfo
69
+ * @property {string} schema
70
+ * @property {string} name
71
+ * @property {string} owner
72
+ * @property {boolean} isTemporary
73
+ * @property {boolean} isUnlogged
74
+ * @property {boolean} isPartitioned
75
+ * @property {boolean} isPartition
76
+ * @property {boolean} isForeignTable
77
+ * @property {'RANGE'|'LIST'|'HASH'} [partitionStrategy]
78
+ * @property {string[]} [partitionColumns]
79
+ * @property {string} [partitionParent]
80
+ * @property {string} [partitionBound]
81
+ * @property {string} [partitionKeyDef]
82
+ * @property {string[]} [inheritsFrom]
83
+ * @property {string} [ofType]
84
+ * @property {string} [tablespace]
85
+ * @property {Record<string, string|number>} [storageParameters]
86
+ * @property {'DEFAULT'|'NOTHING'|'FULL'|'INDEX'} [replicaIdentity]
87
+ * @property {boolean} [hasOids]
88
+ * @property {string} [comment]
89
+ * @property {Object[]} [privileges]
90
+ * @property {boolean} rlsEnabled
91
+ * @property {boolean} rlsForced
92
+ * @property {ColumnInfo[]} columns
93
+ * @property {string[]} constraints
94
+ * @property {string[]} indexes
95
+ * @property {string[]} triggers
96
+ * @property {string[]} policies
97
+ * @property {string} [foreignServer]
98
+ * @property {Object} [foreignOptions]
99
+ */
100
+
101
+ /**
102
+ * @typedef {Object} ColumnInfo
103
+ * @property {string} name
104
+ * @property {string} dataType
105
+ * @property {number} ordinalPosition
106
+ * @property {boolean} isNullable
107
+ * @property {string} [defaultValue]
108
+ * @property {boolean} isGenerated
109
+ * @property {string} [generatedExpression]
110
+ * @property {'STORED'|'VIRTUAL'} [generatedStorage]
111
+ * @property {boolean} isIdentity
112
+ * @property {'ALWAYS'|'BY_DEFAULT'} [identityMode]
113
+ * @property {SequenceOptions} [identityOptions]
114
+ * @property {string} [collation]
115
+ * @property {'PLAIN'|'EXTERNAL'|'EXTENDED'|'MAIN'|'DEFAULT'} [storage]
116
+ * @property {number} [statistics]
117
+ * @property {string} [compression]
118
+ * @property {string} [comment]
119
+ * @property {Object} [foreignOptions]
120
+ */
121
+
122
+ /**
123
+ * @typedef {Object} ConstraintInfo
124
+ * @property {string} schema
125
+ * @property {string} name
126
+ * @property {string} table
127
+ * @property {'PRIMARY_KEY'|'UNIQUE'|'FOREIGN_KEY'|'CHECK'|'EXCLUSION'|'NOT_NULL'} type
128
+ * @property {boolean} deferrable
129
+ * @property {boolean} initiallyDeferred
130
+ * @property {boolean} isValidated
131
+ * @property {boolean} enforced
132
+ * @property {boolean} noInherit
133
+ * @property {string} definition
134
+ * @property {string[]} [columns]
135
+ * @property {string} [referencedTable]
136
+ * @property {string[]} [referencedColumns]
137
+ * @property {'FULL'|'PARTIAL'|'SIMPLE'} [matchType]
138
+ * @property {string} [onDelete]
139
+ * @property {string} [onUpdate]
140
+ * @property {string} [periodColumn]
141
+ * @property {string} [withoutOverlaps]
142
+ * @property {boolean} [nullsNotDistinct]
143
+ * @property {string} [checkExpression]
144
+ * @property {Array<{column:string,operator:string}>} [excludeElements]
145
+ * @property {string} [excludeMethod]
146
+ * @property {string} [index]
147
+ */
148
+
149
+ /**
150
+ * @typedef {Object} IndexInfo
151
+ * @property {string} schema
152
+ * @property {string} name
153
+ * @property {string} table
154
+ * @property {boolean} isUnique
155
+ * @property {boolean} isPrimary
156
+ * @property {boolean} isConcurrent
157
+ * @property {string} method
158
+ * @property {IndexColumnInfo[]} columns
159
+ * @property {string[]} [includeColumns]
160
+ * @property {string} [whereClause]
161
+ * @property {Record<string, string|number>} [storageParameters]
162
+ * @property {string} [tablespace]
163
+ * @property {boolean} [nullsNotDistinct]
164
+ * @property {boolean} [isPartitioned]
165
+ * @property {string} [comment]
166
+ */
167
+
168
+ /**
169
+ * @typedef {Object} IndexColumnInfo
170
+ * @property {string} expression
171
+ * @property {string} [collation]
172
+ * @property {string} [opclass]
173
+ * @property {'ASC'|'DESC'} [direction]
174
+ * @property {'FIRST'|'LAST'} [nullsOrder]
175
+ */
176
+
177
+ /**
178
+ * @typedef {Object} FunctionInfo
179
+ * @property {string} schema
180
+ * @property {string} name
181
+ * @property {string[]} argumentTypes
182
+ * @property {string} returnType
183
+ * @property {string} language
184
+ * @property {string} source
185
+ * @property {'IMMUTABLE'|'STABLE'|'VOLATILE'} volatility
186
+ * @property {boolean} isStrict
187
+ * @property {'INVOKER'|'DEFINER'} security
188
+ * @property {'SAFE'|'UNSAFE'|'RESTRICTED'} parallel
189
+ * @property {boolean} isLeakproof
190
+ * @property {number} cost
191
+ * @property {number} rows
192
+ * @property {'FUNCTION'|'PROCEDURE'|'AGGREGATE'|'WINDOW'} kind
193
+ * @property {string} [comment]
194
+ */
195
+
196
+ /**
197
+ * @typedef {Object} ProcedureInfo
198
+ * @property {string} schema
199
+ * @property {string} name
200
+ * @property {string[]} argumentTypes
201
+ * @property {string} language
202
+ * @property {string} source
203
+ * @property {'INVOKER'|'DEFINER'} security
204
+ * @property {'SAFE'|'UNSAFE'|'RESTRICTED'} parallel
205
+ */
206
+
207
+ /**
208
+ * @typedef {Object} AggregateInfo
209
+ * @property {string} schema
210
+ * @property {string} name
211
+ * @property {string[]} argumentTypes
212
+ * @property {string} returnType
213
+ * @property {string} language
214
+ * @property {string} source
215
+ */
216
+
217
+ /**
218
+ * @typedef {Object} ViewInfo
219
+ * @property {string} schema
220
+ * @property {string} name
221
+ * @property {string} definition
222
+ * @property {string} owner
223
+ * @property {'LOCAL'|'CASCADED'} [checkOption]
224
+ * @property {boolean} isRecursive
225
+ * @property {ColumnInfo[]} [columns]
226
+ * @property {string} [comment]
227
+ */
228
+
229
+ /**
230
+ * @typedef {Object} MaterializedViewInfo
231
+ * @property {string} schema
232
+ * @property {string} name
233
+ * @property {string} definition
234
+ * @property {string} owner
235
+ * @property {string} [tablespace]
236
+ * @property {Record<string, string|number>} [storageParameters]
237
+ * @property {boolean} withData
238
+ * @property {string} [comment]
239
+ */
240
+
241
+ /**
242
+ * @typedef {Object} TypeInfo
243
+ * @property {string} schema
244
+ * @property {string} name
245
+ * @property {'ENUM'|'COMPOSITE'|'DOMAIN'|'RANGE'|'BASE'|'SHELL'|'MULTIRANGE'} kind
246
+ * @property {string} [rangeType]
247
+ * @property {string[]} [enumValues]
248
+ * @property {Array<{name:string,type:string}>} [attributes]
249
+ * @property {string} [baseType]
250
+ * @property {boolean} [notNull]
251
+ * @property {string} [defaultValue]
252
+ * @property {string} [checkConstraint]
253
+ * @property {string} [subtype]
254
+ * @property {string} [inputFunction]
255
+ * @property {string} [outputFunction]
256
+ * @property {string} owner
257
+ * @property {string} [comment]
258
+ */
259
+
260
+ /**
261
+ * @typedef {Object} SequenceInfo
262
+ * @property {string} schema
263
+ * @property {string} name
264
+ * @property {string} dataType
265
+ * @property {number} [startValue]
266
+ * @property {number} [increment]
267
+ * @property {number} [minValue]
268
+ * @property {number} [maxValue]
269
+ * @property {number} [cache]
270
+ * @property {boolean} cycle
271
+ * @property {string} [ownedBy]
272
+ * @property {string} owner
273
+ */
274
+
275
+ /**
276
+ * @typedef {Object} TriggerInfo
277
+ * @property {string} schema
278
+ * @property {string} name
279
+ * @property {string} table
280
+ * @property {'BEFORE'|'AFTER'|'INSTEAD OF'} timing
281
+ * @property {Array<'INSERT'|'UPDATE'|'DELETE'|'TRUNCATE'>} events
282
+ * @property {boolean} isForEachRow
283
+ * @property {string} [whenCondition]
284
+ * @property {string} functionCall
285
+ * @property {'ENABLED'|'DISABLED'|'REPLICA'|'ALWAYS'} enabled
286
+ * @property {string} [comment]
287
+ */
288
+
289
+ /**
290
+ * @typedef {Object} EventTriggerInfo
291
+ * @property {string} name
292
+ * @property {string} event
293
+ * @property {string} function
294
+ * @property {'ENABLED'|'DISABLED'|'REPLICA'|'ALWAYS'} enabled
295
+ * @property {string[]} tags
296
+ * @property {string} owner
297
+ */
298
+
299
+ /**
300
+ * @typedef {Object} ExtensionInfo
301
+ * @property {string} name
302
+ * @property {string} schema
303
+ * @property {string} version
304
+ * @property {boolean} isAvailable
305
+ */
306
+
307
+ /**
308
+ * @typedef {Object} PolicyInfo
309
+ * @property {string} schema
310
+ * @property {string} name
311
+ * @property {string} table
312
+ * @property {'ALL'|'SELECT'|'INSERT'|'UPDATE'|'DELETE'} command
313
+ * @property {boolean} isPermissive
314
+ * @property {string[]} roles
315
+ * @property {string} [usingExpression]
316
+ * @property {string} [withCheckExpression]
317
+ */
318
+
319
+ /**
320
+ * @typedef {Object} GrantInfo
321
+ * @property {string} schema
322
+ * @property {string} object
323
+ * @property {string} objectType
324
+ * @property {string} privilege
325
+ * @property {string} grantee
326
+ * @property {string} grantor
327
+ * @property {boolean} isGrantable
328
+ * @property {string} [column]
329
+ */
330
+
331
+ /**
332
+ * @typedef {Object} SequenceOptions
333
+ * @property {number} [startWith]
334
+ * @property {number} [incrementBy]
335
+ * @property {number|'NO_MINVALUE'} [minValue]
336
+ * @property {number|'NO_MAXVALUE'} [maxValue]
337
+ * @property {number} [cache]
338
+ * @property {boolean} [cycle]
339
+ * @property {string} [ownedBy]
340
+ */
341
+
342
+ /**
343
+ * @typedef {Object} StatisticsInfo
344
+ * @property {string} schema
345
+ * @property {string} name
346
+ * @property {string} [table]
347
+ * @property {Array<string>} kinds
348
+ * @property {string[]} columns
349
+ * @property {string} [definition]
350
+ * @property {string} owner
351
+ */
352
+
353
+ /**
354
+ * @typedef {Object} CollationInfo
355
+ * @property {string} schema
356
+ * @property {string} name
357
+ * @property {string} provider
358
+ * @property {string} [locale]
359
+ * @property {number} [encoding]
360
+ * @property {boolean} isDeterministic
361
+ * @property {string} owner
362
+ */
363
+
364
+ /**
365
+ * @typedef {Object} ConversionInfo
366
+ * @property {string} schema
367
+ * @property {string} name
368
+ * @property {string} proc
369
+ * @property {boolean} isDefault
370
+ * @property {string} owner
371
+ */
372
+
373
+ /**
374
+ * @typedef {Object} OperatorInfo
375
+ * @property {string} schema
376
+ * @property {string} name
377
+ * @property {string} [leftType]
378
+ * @property {string} [rightType]
379
+ * @property {string} [resultType]
380
+ * @property {string} proc
381
+ * @property {boolean} canHash
382
+ * @property {boolean} canMerge
383
+ * @property {string} [commutator]
384
+ * @property {string} [negator]
385
+ * @property {string} owner
386
+ */
387
+
388
+ /**
389
+ * @typedef {Object} OperatorClassInfo
390
+ * @property {string} schema
391
+ * @property {string} name
392
+ * @property {string} family
393
+ * @property {string} inputType
394
+ * @property {boolean} isDefault
395
+ * @property {string} accessMethod
396
+ * @property {string} owner
397
+ */
398
+
399
+ /**
400
+ * @typedef {Object} OperatorFamilyInfo
401
+ * @property {string} schema
402
+ * @property {string} name
403
+ * @property {string} accessMethod
404
+ * @property {string} owner
405
+ */
406
+
407
+ /**
408
+ * @typedef {Object} TextSearchConfigInfo
409
+ * @property {string} schema
410
+ * @property {string} name
411
+ * @property {string} parser
412
+ * @property {string} owner
413
+ */
414
+
415
+ /**
416
+ * @typedef {Object} TextSearchDictInfo
417
+ * @property {string} schema
418
+ * @property {string} name
419
+ * @property {string} template
420
+ * @property {Object} [options]
421
+ * @property {string} owner
422
+ */
423
+
424
+ /**
425
+ * @typedef {Object} TextSearchParserInfo
426
+ * @property {string} schema
427
+ * @property {string} name
428
+ * @property {string} start
429
+ * @property {string} getToken
430
+ * @property {string} end
431
+ * @property {string} [headline]
432
+ * @property {string} owner
433
+ */
434
+
435
+ /**
436
+ * @typedef {Object} TextSearchTemplateInfo
437
+ * @property {string} schema
438
+ * @property {string} name
439
+ * @property {string} [init]
440
+ * @property {string} lexize
441
+ * @property {string} owner
442
+ */
443
+
444
+ /**
445
+ * @typedef {Object} ForeignDataWrapperInfo
446
+ * @property {string} name
447
+ * @property {string} [handler]
448
+ * @property {string} [validator]
449
+ * @property {Object} [options]
450
+ * @property {string} owner
451
+ */
452
+
453
+ /**
454
+ * @typedef {Object} ForeignServerInfo
455
+ * @property {string} name
456
+ * @property {string} fdw
457
+ * @property {string} [type]
458
+ * @property {Object} [options]
459
+ * @property {string} owner
460
+ */
461
+
462
+ /**
463
+ * @typedef {Object} UserMappingInfo
464
+ * @property {string} user
465
+ * @property {string} server
466
+ * @property {Object} [options]
467
+ */
468
+
469
+ /**
470
+ * @typedef {Object} CastInfo
471
+ * @property {string} sourceType
472
+ * @property {string} targetType
473
+ * @property {string} [function]
474
+ * @property {'EXPLICIT'|'ASSIGNMENT'|'IMPLICIT'} context
475
+ * @property {'FUNCTION'|'INOUT'|'BINARY'} method
476
+ */
477
+
478
+ /**
479
+ * @typedef {Object} RuleInfo
480
+ * @property {string} schema
481
+ * @property {string} name
482
+ * @property {string} table
483
+ * @property {string} event
484
+ * @property {boolean} isInstead
485
+ * @property {boolean} isEnabled
486
+ * @property {string} [definition]
487
+ * @property {string} [qual]
488
+ */
489
+
490
+ /**
491
+ * @typedef {Object} RoleInfo
492
+ * @property {string} name
493
+ * @property {boolean} isSuperuser
494
+ * @property {boolean} canCreateRole
495
+ * @property {boolean} canCreateDB
496
+ * @property {boolean} canLogin
497
+ * @property {boolean} inherit
498
+ * @property {Array<{member:string,admin_option:boolean}>} memberships
499
+ * @property {string} [comment]
500
+ */
501
+
502
+ /**
503
+ * @typedef {Object} TablespaceInfo
504
+ * @property {string} name
505
+ * @property {string} owner
506
+ * @property {string} [location]
507
+ * @property {boolean} isDefault
508
+ * @property {string} [acl]
509
+ * @property {Object} [options]
510
+ */
511
+
512
+ /**
513
+ * @typedef {Object} AccessMethodInfo
514
+ * @property {string} name
515
+ * @property {'TABLE'|'INDEX'} type
516
+ * @property {string} [handler]
517
+ */
518
+
519
+ /**
520
+ * @typedef {Object} LanguageInfo
521
+ * @property {string} name
522
+ * @property {boolean} isTrusted
523
+ * @property {string} [handler]
524
+ * @property {string} [inline]
525
+ * @property {string} [validator]
526
+ * @property {string} owner
527
+ */
528
+
529
+ /**
530
+ * @typedef {Object} DefaultPrivilegeInfo
531
+ * @property {string} role
532
+ * @property {string} [schema]
533
+ * @property {string} objectType
534
+ * @property {string} acl
535
+ */
536
+
537
+ /**
538
+ * @typedef {Object} PublicationInfo
539
+ * @property {string} name
540
+ * @property {string} owner
541
+ * @property {boolean} allTables
542
+ * @property {boolean} insert
543
+ * @property {boolean} update
544
+ * @property {boolean} delete
545
+ * @property {boolean} truncate
546
+ * @property {string[]} tables
547
+ * @property {string[]} schemas
548
+ */
549
+
550
+ /**
551
+ * @typedef {Object} SubscriptionInfo
552
+ * @property {string} name
553
+ * @property {string} conninfo
554
+ * @property {string} [slotName]
555
+ * @property {string[]} publications
556
+ * @property {boolean} enabled
557
+ * @property {boolean} [syncCommit]
558
+ * @property {string} owner
559
+ */
560
+
561
+ export {};