@rvoh/dream 2.37.0 → 2.38.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 (210) hide show
  1. package/dist/cjs/src/dream-app/index.js +5 -0
  2. package/dist/cjs/src/serializer/DreamSerializer.js +23 -0
  3. package/dist/cjs/src/serializer/ObjectSerializer.js +22 -0
  4. package/dist/cjs/src/serializer/SerializerRenderer.js +36 -54
  5. package/dist/cjs/src/serializer/builders/DreamSerializerBuilder.js +32 -10
  6. package/dist/cjs/src/serializer/builders/ObjectSerializerBuilder.js +32 -10
  7. package/dist/cjs/src/serializer/helpers/nullFlattenedSerializerKeys.js +257 -0
  8. package/dist/esm/src/dream-app/index.js +5 -0
  9. package/dist/esm/src/serializer/DreamSerializer.js +23 -0
  10. package/dist/esm/src/serializer/ObjectSerializer.js +22 -0
  11. package/dist/esm/src/serializer/SerializerRenderer.js +36 -54
  12. package/dist/esm/src/serializer/builders/DreamSerializerBuilder.js +32 -10
  13. package/dist/esm/src/serializer/builders/ObjectSerializerBuilder.js +32 -10
  14. package/dist/esm/src/serializer/helpers/nullFlattenedSerializerKeys.js +257 -0
  15. package/dist/types/src/dream-app/index.d.ts +5 -0
  16. package/dist/types/src/serializer/DreamSerializer.d.ts +23 -0
  17. package/dist/types/src/serializer/ObjectSerializer.d.ts +22 -0
  18. package/dist/types/src/serializer/SerializerRenderer.d.ts +1 -13
  19. package/dist/types/src/serializer/builders/DreamSerializerBuilder.d.ts +34 -12
  20. package/dist/types/src/serializer/builders/ObjectSerializerBuilder.d.ts +34 -12
  21. package/dist/types/src/serializer/helpers/nullFlattenedSerializerKeys.d.ts +75 -0
  22. package/docs/classes/db.DreamMigrationHelpers.html +11 -11
  23. package/docs/classes/db.KyselyQueryDriver.html +49 -49
  24. package/docs/classes/db.PostgresQueryDriver.html +49 -49
  25. package/docs/classes/db.QueryDriverBase.html +49 -49
  26. package/docs/classes/errors.CannotSaveMissingDream.html +2 -2
  27. package/docs/classes/errors.CheckConstraintViolation.html +3 -3
  28. package/docs/classes/errors.ColumnOverflow.html +3 -3
  29. package/docs/classes/errors.CreateOrFindByFailedToCreateAndFind.html +3 -3
  30. package/docs/classes/errors.DataIncompatibleWithDatabaseField.html +3 -3
  31. package/docs/classes/errors.DataTypeColumnTypeMismatch.html +3 -3
  32. package/docs/classes/errors.DecryptionError.html +2 -2
  33. package/docs/classes/errors.DecryptionParseError.html +2 -2
  34. package/docs/classes/errors.DecryptionRotationError.html +3 -3
  35. package/docs/classes/errors.GlobalNameNotSet.html +3 -3
  36. package/docs/classes/errors.InvalidCalendarDate.html +2 -2
  37. package/docs/classes/errors.InvalidClockTime.html +2 -2
  38. package/docs/classes/errors.InvalidClockTimeTz.html +2 -2
  39. package/docs/classes/errors.InvalidDateTime.html +2 -2
  40. package/docs/classes/errors.MissingSerializersDefinition.html +3 -3
  41. package/docs/classes/errors.NonLoadedAssociation.html +3 -3
  42. package/docs/classes/errors.NotNullViolation.html +3 -3
  43. package/docs/classes/errors.RecordNotFound.html +3 -3
  44. package/docs/classes/errors.SortableScopeDidNotStabilize.html +3 -3
  45. package/docs/classes/errors.SortableScopeLockWaitTimedOut.html +3 -3
  46. package/docs/classes/errors.ValidationError.html +3 -3
  47. package/docs/classes/index.CalendarDate.html +33 -33
  48. package/docs/classes/index.ClockTime.html +32 -32
  49. package/docs/classes/index.ClockTimeTz.html +35 -35
  50. package/docs/classes/index.DateTime.html +86 -86
  51. package/docs/classes/index.Decorators.html +19 -19
  52. package/docs/classes/index.Dream.html +125 -125
  53. package/docs/classes/index.DreamApp.html +11 -11
  54. package/docs/classes/index.DreamTransaction.html +3 -3
  55. package/docs/classes/index.Env.html +5 -5
  56. package/docs/classes/index.Query.html +65 -65
  57. package/docs/classes/system.CliFileWriter.html +4 -4
  58. package/docs/classes/system.DreamBin.html +3 -3
  59. package/docs/classes/system.DreamCLI.html +7 -7
  60. package/docs/classes/system.DreamImporter.html +2 -2
  61. package/docs/classes/system.DreamLogos.html +2 -2
  62. package/docs/classes/system.DreamSerializerBuilder.html +43 -21
  63. package/docs/classes/system.ObjectSerializerBuilder.html +42 -20
  64. package/docs/classes/system.PathHelpers.html +3 -3
  65. package/docs/classes/utils.Encrypt.html +4 -4
  66. package/docs/classes/utils.Range.html +2 -2
  67. package/docs/functions/db.closeAllDbConnections.html +1 -1
  68. package/docs/functions/db.dreamDbConnections.html +1 -1
  69. package/docs/functions/db.untypedDb.html +1 -1
  70. package/docs/functions/db.validateColumn.html +1 -1
  71. package/docs/functions/db.validateTable.html +1 -1
  72. package/docs/functions/errors.pgErrorType.html +1 -1
  73. package/docs/functions/index.DreamSerializer.html +18 -1
  74. package/docs/functions/index.ObjectSerializer.html +17 -1
  75. package/docs/functions/index.ReplicaSafe.html +1 -1
  76. package/docs/functions/index.STI.html +1 -1
  77. package/docs/functions/index.SoftDelete.html +1 -1
  78. package/docs/functions/utils.camelize.html +1 -1
  79. package/docs/functions/utils.capitalize.html +1 -1
  80. package/docs/functions/utils.cloneDeepSafe.html +1 -1
  81. package/docs/functions/utils.compact.html +1 -1
  82. package/docs/functions/utils.groupBy.html +1 -1
  83. package/docs/functions/utils.hyphenize.html +1 -1
  84. package/docs/functions/utils.intersection.html +1 -1
  85. package/docs/functions/utils.isEmpty.html +1 -1
  86. package/docs/functions/utils.normalizeUnicode.html +1 -1
  87. package/docs/functions/utils.pascalize.html +1 -1
  88. package/docs/functions/utils.percent.html +1 -1
  89. package/docs/functions/utils.range.html +1 -1
  90. package/docs/functions/utils.round.html +1 -1
  91. package/docs/functions/utils.sanitizeString.html +1 -1
  92. package/docs/functions/utils.snakeify.html +1 -1
  93. package/docs/functions/utils.sort.html +1 -1
  94. package/docs/functions/utils.sortBy.html +1 -1
  95. package/docs/functions/utils.sortObjectByKey.html +1 -1
  96. package/docs/functions/utils.sortObjectByValue.html +1 -1
  97. package/docs/functions/utils.uncapitalize.html +1 -1
  98. package/docs/functions/utils.uniq.html +1 -1
  99. package/docs/interfaces/openapi.OpenapiDescription.html +2 -2
  100. package/docs/interfaces/openapi.OpenapiSchemaProperties.html +1 -1
  101. package/docs/interfaces/openapi.OpenapiSchemaPropertiesShorthand.html +1 -1
  102. package/docs/interfaces/openapi.OpenapiTypeFieldObject.html +1 -1
  103. package/docs/interfaces/types.BelongsToStatement.html +2 -2
  104. package/docs/interfaces/types.DecoratorContext.html +2 -2
  105. package/docs/interfaces/types.DecryptCallbacks.html +2 -2
  106. package/docs/interfaces/types.DreamAppInitOptions.html +2 -2
  107. package/docs/interfaces/types.DreamAppOpts.html +2 -2
  108. package/docs/interfaces/types.DreamDbConfig.html +6 -6
  109. package/docs/interfaces/types.DurationObject.html +2 -2
  110. package/docs/interfaces/types.EncryptOptions.html +2 -2
  111. package/docs/interfaces/types.EncryptionLegacyKeyUsedEvent.html +4 -4
  112. package/docs/interfaces/types.InternalAnyTypedSerializerRendersMany.html +2 -2
  113. package/docs/interfaces/types.InternalAnyTypedSerializerRendersOne.html +2 -2
  114. package/docs/interfaces/types.IntrospectedColumn.html +7 -7
  115. package/docs/interfaces/types.IntrospectedDatabase.html +2 -2
  116. package/docs/interfaces/types.IntrospectedEnum.html +2 -2
  117. package/docs/interfaces/types.IntrospectedTable.html +5 -5
  118. package/docs/interfaces/types.SerializerRendererOpts.html +2 -2
  119. package/docs/types/openapi.CommonOpenapiSchemaObjectFields.html +1 -1
  120. package/docs/types/openapi.OpenapiAllTypes.html +1 -1
  121. package/docs/types/openapi.OpenapiFormats.html +1 -1
  122. package/docs/types/openapi.OpenapiNumberFormats.html +1 -1
  123. package/docs/types/openapi.OpenapiPrimitiveBaseTypes.html +1 -1
  124. package/docs/types/openapi.OpenapiPrimitiveTypes.html +1 -1
  125. package/docs/types/openapi.OpenapiSchemaArray.html +1 -1
  126. package/docs/types/openapi.OpenapiSchemaArrayShorthand.html +1 -1
  127. package/docs/types/openapi.OpenapiSchemaBase.html +1 -1
  128. package/docs/types/openapi.OpenapiSchemaBody.html +1 -1
  129. package/docs/types/openapi.OpenapiSchemaBodyShorthand.html +1 -1
  130. package/docs/types/openapi.OpenapiSchemaCombinatorFields.html +1 -1
  131. package/docs/types/openapi.OpenapiSchemaCommonFields.html +1 -1
  132. package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +1 -1
  133. package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +1 -1
  134. package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +1 -1
  135. package/docs/types/openapi.OpenapiSchemaExpressionRef.html +2 -2
  136. package/docs/types/openapi.OpenapiSchemaExpressionRefSchemaShorthand.html +2 -2
  137. package/docs/types/openapi.OpenapiSchemaInteger.html +1 -1
  138. package/docs/types/openapi.OpenapiSchemaNull.html +2 -2
  139. package/docs/types/openapi.OpenapiSchemaNumber.html +1 -1
  140. package/docs/types/openapi.OpenapiSchemaObject.html +1 -1
  141. package/docs/types/openapi.OpenapiSchemaObjectAllOf.html +1 -1
  142. package/docs/types/openapi.OpenapiSchemaObjectAllOfShorthand.html +1 -1
  143. package/docs/types/openapi.OpenapiSchemaObjectBase.html +1 -1
  144. package/docs/types/openapi.OpenapiSchemaObjectBaseShorthand.html +1 -1
  145. package/docs/types/openapi.OpenapiSchemaObjectShorthand.html +1 -1
  146. package/docs/types/openapi.OpenapiSchemaPrimitiveGeneric.html +1 -1
  147. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAllOf.html +1 -1
  148. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
  149. package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +1 -1
  150. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializableRef.html +2 -2
  151. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializerRef.html +2 -2
  152. package/docs/types/openapi.OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
  153. package/docs/types/openapi.OpenapiSchemaString.html +1 -1
  154. package/docs/types/openapi.OpenapiShorthandAllTypes.html +1 -1
  155. package/docs/types/openapi.OpenapiShorthandPrimitiveBaseTypes.html +1 -1
  156. package/docs/types/openapi.OpenapiShorthandPrimitiveTypes.html +1 -1
  157. package/docs/types/openapi.OpenapiTypeField.html +1 -1
  158. package/docs/types/system.DreamAppAllowedPackageManagersEnum.html +1 -1
  159. package/docs/types/types.CalendarDateDurationUnit.html +1 -1
  160. package/docs/types/types.CalendarDateObject.html +1 -1
  161. package/docs/types/types.Camelized.html +1 -1
  162. package/docs/types/types.ClockTimeObject.html +1 -1
  163. package/docs/types/types.DbConnectionType.html +1 -1
  164. package/docs/types/types.DbTypes.html +1 -1
  165. package/docs/types/types.DreamAssociationMetadata.html +1 -1
  166. package/docs/types/types.DreamAttributes.html +1 -1
  167. package/docs/types/types.DreamClassAssociationAndStatement.html +1 -1
  168. package/docs/types/types.DreamClassColumn.html +1 -1
  169. package/docs/types/types.DreamColumn.html +1 -1
  170. package/docs/types/types.DreamColumnNames.html +1 -1
  171. package/docs/types/types.DreamLogLevel.html +1 -1
  172. package/docs/types/types.DreamLogger.html +2 -2
  173. package/docs/types/types.DreamModelSerializerType.html +1 -1
  174. package/docs/types/types.DreamOrViewModelClassSerializerKey.html +1 -1
  175. package/docs/types/types.DreamOrViewModelSerializerKey.html +1 -1
  176. package/docs/types/types.DreamParamSafeAttributes.html +1 -1
  177. package/docs/types/types.DreamParamSafeColumnNames.html +1 -1
  178. package/docs/types/types.DreamSerializable.html +1 -1
  179. package/docs/types/types.DreamSerializableArray.html +1 -1
  180. package/docs/types/types.DreamSerializerKey.html +1 -1
  181. package/docs/types/types.DreamSerializers.html +1 -1
  182. package/docs/types/types.DreamVirtualColumns.html +1 -1
  183. package/docs/types/types.DurationUnit.html +1 -1
  184. package/docs/types/types.EncryptAlgorithm.html +1 -1
  185. package/docs/types/types.HasManyStatement.html +1 -1
  186. package/docs/types/types.HasOneStatement.html +1 -1
  187. package/docs/types/types.Hyphenized.html +1 -1
  188. package/docs/types/types.IntrospectedValueType.html +1 -1
  189. package/docs/types/types.Pascalized.html +1 -1
  190. package/docs/types/types.PrimaryKeyType.html +1 -1
  191. package/docs/types/types.RoundingPrecision.html +1 -1
  192. package/docs/types/types.SerializerCasing.html +1 -1
  193. package/docs/types/types.SimpleObjectSerializerType.html +1 -1
  194. package/docs/types/types.Snakeified.html +1 -1
  195. package/docs/types/types.StrictInterface.html +1 -1
  196. package/docs/types/types.UpdateableAssociationProperties.html +1 -1
  197. package/docs/types/types.UpdateableProperties.html +1 -1
  198. package/docs/types/types.ValidationType.html +1 -1
  199. package/docs/types/types.ViewModel.html +2 -2
  200. package/docs/types/types.ViewModelClass.html +1 -1
  201. package/docs/types/types.WeekdayName.html +1 -1
  202. package/docs/types/types.WhereStatementForDream.html +1 -1
  203. package/docs/types/types.WhereStatementForDreamClass.html +1 -1
  204. package/docs/variables/index.DreamConst.html +1 -1
  205. package/docs/variables/index.ops.html +1 -1
  206. package/docs/variables/openapi.openapiPrimitiveTypes.html +1 -1
  207. package/docs/variables/openapi.openapiShorthandPrimitiveTypes.html +1 -1
  208. package/docs/variables/system.DreamAppAllowedPackageManagersEnumValues.html +1 -1
  209. package/docs/variables/system.primaryKeyTypes.html +1 -1
  210. package/package.json +1 -1
@@ -146,8 +146,21 @@ export default class DreamSerializerBuilder<DataTypeForOpenapi extends typeof Dr
146
146
  * property bodies (`type: 'object'`, `properties`, and `required` listing the keys that
147
147
  * are always present), or `{ $serializer: SomeSerializer }` when the callback returns
148
148
  * what that serializer renders. A serializer ref with `many: true` does not type-check
149
- * here, since a list has no properties to spread. A `null` or `undefined` return adds no
150
- * keys. Attributes render in declaration order, so a key the returned object shares with
149
+ * here, since a list has no properties to spread. A `null` return, a serializer built over
150
+ * `null` or `undefined` data, or an `undefined` return without `required: false` renders as
151
+ * `null` each key the `openapi` requires: a key an object shape lists in its `required`
152
+ * array, a key a `$serializer` or `$serializable` ref's serializer declares without
153
+ * `required: false`, and each such key of an `allOf`, `anyOf` or `oneOf` member. Its
154
+ * optional keys stay absent, and an `undefined` return with `required: false` adds no keys.
155
+ * A returned plain object also renders as `null` each key its shape requires that it
156
+ * leaves out, and its optional keys it leaves out stay absent. When the `openapi` is an
157
+ * `anyOf` or `oneOf`, or a `$serializable` ref to an STI base, a present value also renders
158
+ * as `null` each key another variant requires that the rendered one does not declare, so a
159
+ * client sees the same keys whichever variant is rendered.
160
+ * Every key it adds follows the render's casing like the parent's own keys: a returned
161
+ * plain object's top-level keys and the `openapi`'s `properties` keys are cased (so
162
+ * `casing: 'snake'` renders `phoneNumber` as `phone_number`, present or `null`), while
163
+ * nested values render as returned. Attributes render in declaration order, so a key the returned object shares with
151
164
  * another attribute takes the value of whichever is declared later; under the `allOf`,
152
165
  * that value must match both schemas
153
166
  * - `required` - Set to `false` to mark the attribute as optional in the OpenAPI schema;
@@ -191,14 +204,23 @@ export default class DreamSerializerBuilder<DataTypeForOpenapi extends typeof Dr
191
204
  * declaration order, so when the parent and the association share a key (e.g., `id`),
192
205
  * whichever is declared later wins: the association's value replaces an attribute declared
193
206
  * before the `rendersOne`, and an attribute declared after it replaces the association's.
194
- * When the association is `null`, every key its serializer declares renders as `null`
195
- * (for a polymorphic `BelongsTo`, every key the serializer of any of its target classes
196
- * declares, and for an association to an STI base, every key the serializer of any of its
197
- * STI children declares), in the same order (so an `id` declared before the `rendersOne` becomes
198
- * `null`); nothing in that serializer is rendered, so its custom attribute callbacks do
199
- * not run, and a flattened `customAttribute` in it adds no keys. Psychic adds the association's OpenAPI
200
- * schema to the parent's as an `allOf` branch, so a shared key's value must match both
201
- * schemas, whichever declaration wins
207
+ * When the association is `null`, each key its serializer requires renders as `null`: an
208
+ * attribute, delegatedAttribute or customAttribute declared without `required: false`, and
209
+ * every non-flattened `rendersOne` and `rendersMany` (for a polymorphic `BelongsTo`, each
210
+ * key the serializer of any of its target classes requires, and for an association to an
211
+ * STI base, each key the serializer of any of its STI children requires), in the same order
212
+ * (so an `id` declared before the `rendersOne` becomes `null`), while a key declared with
213
+ * `required: false` stays absent. A flattened `customAttribute` in that serializer adds the
214
+ * keys its `openapi` requires: a key an object shape lists in its `required` array, a key a
215
+ * `$serializer` or `$serializable` ref's serializer declares without `required: false`, and
216
+ * each such key of an `allOf`, `anyOf` or `oneOf` member; a ref with `many: true` adds none,
217
+ * and a flattened `customAttribute` declared with `required: false` adds none. Nothing in
218
+ * that serializer is rendered, so its custom attribute callbacks do not run. When the
219
+ * association to an STI base or polymorphic `BelongsTo` is present, each key another STI
220
+ * child's or target's serializer requires that the held one's serializer does not declare
221
+ * also renders as `null`, so a client sees the same keys whichever is held. Psychic adds
222
+ * the association's OpenAPI schema to the parent's as an `allOf` branch, so a shared key's
223
+ * value must match both schemas, whichever declaration wins
202
224
  * - `optional` - When `true`, allows the association to be null/missing without causing
203
225
  * an `OpenapiResponseValidationFailure` during Psychic controller unit specs. By default,
204
226
  * `rendersOne` expects the association to be present (mirroring the `optional` option on
@@ -254,8 +276,8 @@ export default class DreamSerializerBuilder<DataTypeForOpenapi extends typeof Dr
254
276
  * If `true`, the rendered association's attributes are merged directly into
255
277
  * the parent object instead of being nested under the association key. A key
256
278
  * the parent shares with the association takes the value of whichever is
257
- * declared later, and when the association is `null`, every key its serializer
258
- * declares renders as `null`. See the `flatten` option of `rendersOne`.
279
+ * declared later, and when the association is `null`, each key its serializer
280
+ * requires renders as `null`. See the `flatten` option of `rendersOne`.
259
281
  */
260
282
  flatten?: boolean;
261
283
  /**
@@ -139,8 +139,21 @@ export default class ObjectSerializerBuilder<MaybeNullDataType extends object |
139
139
  * property bodies (`type: 'object'`, `properties`, and `required` listing the keys that
140
140
  * are always present), or `{ $serializer: SomeSerializer }` when the callback returns
141
141
  * what that serializer renders. A serializer ref with `many: true` does not type-check
142
- * here, since a list has no properties to spread. A `null` or `undefined` return adds no
143
- * keys. Attributes render in declaration order, so a key the returned object shares with
142
+ * here, since a list has no properties to spread. A `null` return, a serializer built over
143
+ * `null` or `undefined` data, or an `undefined` return without `required: false` renders as
144
+ * `null` each key the `openapi` requires: a key an object shape lists in its `required`
145
+ * array, a key a `$serializer` or `$serializable` ref's serializer declares without
146
+ * `required: false`, and each such key of an `allOf`, `anyOf` or `oneOf` member. Its
147
+ * optional keys stay absent, and an `undefined` return with `required: false` adds no keys.
148
+ * A returned plain object also renders as `null` each key its shape requires that it
149
+ * leaves out, and its optional keys it leaves out stay absent. When the `openapi` is an
150
+ * `anyOf` or `oneOf`, or a `$serializable` ref to an STI base, a present value also renders
151
+ * as `null` each key another variant requires that the rendered one does not declare, so a
152
+ * client sees the same keys whichever variant is rendered.
153
+ * Every key it adds follows the render's casing like the parent's own keys: a returned
154
+ * plain object's top-level keys and the `openapi`'s `properties` keys are cased (so
155
+ * `casing: 'snake'` renders `phoneNumber` as `phone_number`, present or `null`), while
156
+ * nested values render as returned. Attributes render in declaration order, so a key the returned object shares with
144
157
  * another attribute takes the value of whichever is declared later; under the `allOf`,
145
158
  * that value must match both schemas
146
159
  * - `required` - Set to `false` to mark the attribute as optional in the OpenAPI schema;
@@ -184,14 +197,23 @@ export default class ObjectSerializerBuilder<MaybeNullDataType extends object |
184
197
  * declaration order, so when the parent and the association share a key (e.g., `id`),
185
198
  * whichever is declared later wins: the association's value replaces an attribute declared
186
199
  * before the `rendersOne`, and an attribute declared after it replaces the association's.
187
- * When the association is `null`, every key its serializer declares renders as `null`
188
- * (for a polymorphic `BelongsTo`, every key the serializer of any of its target classes
189
- * declares, and for an association to an STI base, every key the serializer of any of its
190
- * STI children declares), in the same order (so an `id` declared before the `rendersOne` becomes
191
- * `null`); nothing in that serializer is rendered, so its custom attribute callbacks do
192
- * not run, and a flattened `customAttribute` in it adds no keys. Psychic adds the association's OpenAPI
193
- * schema to the parent's as an `allOf` branch, so a shared key's value must match both
194
- * schemas, whichever declaration wins
200
+ * When the association is `null`, each key its serializer requires renders as `null`: an
201
+ * attribute, delegatedAttribute or customAttribute declared without `required: false`, and
202
+ * every non-flattened `rendersOne` and `rendersMany` (for a polymorphic `BelongsTo`, each
203
+ * key the serializer of any of its target classes requires, and for an association to an
204
+ * STI base, each key the serializer of any of its STI children requires), in the same order
205
+ * (so an `id` declared before the `rendersOne` becomes `null`), while a key declared with
206
+ * `required: false` stays absent. A flattened `customAttribute` in that serializer adds the
207
+ * keys its `openapi` requires: a key an object shape lists in its `required` array, a key a
208
+ * `$serializer` or `$serializable` ref's serializer declares without `required: false`, and
209
+ * each such key of an `allOf`, `anyOf` or `oneOf` member; a ref with `many: true` adds none,
210
+ * and a flattened `customAttribute` declared with `required: false` adds none. Nothing in
211
+ * that serializer is rendered, so its custom attribute callbacks do not run. When the
212
+ * association to an STI base or polymorphic `BelongsTo` is present, each key another STI
213
+ * child's or target's serializer requires that the held one's serializer does not declare
214
+ * also renders as `null`, so a client sees the same keys whichever is held. Psychic adds
215
+ * the association's OpenAPI schema to the parent's as an `allOf` branch, so a shared key's
216
+ * value must match both schemas, whichever declaration wins
195
217
  * - `optional` - When `true`, allows the association to be null/missing without causing
196
218
  * an `OpenapiResponseValidationFailure` during Psychic controller unit specs. By default,
197
219
  * `rendersOne` expects the association to be present (mirroring the `optional` option on
@@ -249,8 +271,8 @@ export default class ObjectSerializerBuilder<MaybeNullDataType extends object |
249
271
  * If `true`, the rendered association's attributes are merged directly into
250
272
  * the parent object instead of being nested under the association key. A key
251
273
  * the parent shares with the association takes the value of whichever is
252
- * declared later, and when the association is `null`, every key its serializer
253
- * declares renders as `null`. See the `flatten` option of `rendersOne`.
274
+ * declared later, and when the association is `null`, each key its serializer
275
+ * requires renders as `null`. See the `flatten` option of `rendersOne`.
254
276
  */
255
277
  flatten?: boolean;
256
278
  /**
@@ -0,0 +1,75 @@
1
+ import { OpenapiSchemaBodyShorthand, OpenapiShorthandPrimitiveTypes } from '../../types/openapi.js';
2
+ import { DreamModelSerializerType, SerializerCasing, SimpleObjectSerializerType } from '../../types/serializer.js';
3
+ export interface NullFlattenedSerializerKeysOptions {
4
+ casing?: SerializerCasing;
5
+ passthroughData?: object;
6
+ }
7
+ /**
8
+ * The keys a flattened `rendersOne` adds to the parent's payload when its associated object is
9
+ * null, returned as an object with each key set to `null`, ready to spread into the parent's
10
+ * payload (`Object.keys` of it for the key names alone): each key one of `serializers` requires.
11
+ * As a property read on an empty object is `undefined`, a null value carries no key it may omit:
12
+ * an attribute, delegatedAttribute or customAttribute declared with `required: false` adds no key.
13
+ * Every key is cased per `casing`, as the renderer cases it. There are several serializers when
14
+ * the association is a polymorphic BelongsTo, one for each target class, or when the associated
15
+ * class is an STI base, one for each child, and their required keys are unioned.
16
+ *
17
+ * Each serializer is built with `undefined` data to read its declarations, as Psychic's OpenAPI
18
+ * generation and `preloadFor` build it, and nothing is rendered: no attribute callback runs and
19
+ * no association of the missing object is read. A non-flattened `rendersOne` or a `rendersMany`
20
+ * always adds its key. A flattened `rendersOne` it declares adds its own serializers' required keys
21
+ * the same way. A flattened `customAttribute` adds the keys its `openapi` requires: each key of
22
+ * its `properties` that the shape's `required` array lists, the required keys of the serializer a
23
+ * `$serializer` ref names or of every serializer a `$serializable` ref resolves to (one per child
24
+ * for an STI base), walked the same way, and the union of the keys every member of an `allOf`,
25
+ * `anyOf` or `oneOf` requires, with each key an object shape's own `required` array lists beside
26
+ * its members; one declared with `required: false` adds none. A ref with `many: true` adds none,
27
+ * since a list has no keys to spread. A serializer reached again within its own walk, as when one
28
+ * flattens itself, adds nothing, so the walk always terminates; one reached again along another
29
+ * path is walked again, so each path adds its keys and their requirements.
30
+ *
31
+ * `passthroughData` is handed to each serializer as it is built, as when rendering; outside a
32
+ * render it may be left out.
33
+ */
34
+ export declare function nullFlattenedSerializerKeys(serializers: (DreamModelSerializerType | SimpleObjectSerializerType)[], options?: NullFlattenedSerializerKeysOptions): Record<string, null>;
35
+ /**
36
+ * The keys a flattened `customAttribute` with this `openapi` adds to the parent's payload when
37
+ * its callback returns null (or `undefined` without `required: false`), or a serializer built over
38
+ * null data, each set to `null`: each key `openapi` requires, walked as `nullFlattenedSerializerKeys`
39
+ * walks a flattened `customAttribute` and cased per `casing`.
40
+ */
41
+ export declare function nullFlattenedOpenapiKeys(openapi: OpenapiSchemaBodyShorthand | OpenapiShorthandPrimitiveTypes, options?: NullFlattenedSerializerKeysOptions): Record<string, null>;
42
+ /**
43
+ * The keys a present flattened `rendersOne` adds to the parent's payload, each set to `null`,
44
+ * beside what `renderedSerializer` renders: each key one of `serializers` (every serializer the
45
+ * association may render with) requires that `renderedSerializer` does not declare at all. A key
46
+ * `renderedSerializer` declares is its own to render or, when `required: false`, to omit.
47
+ */
48
+ export declare function nullFlattenedSerializerKeysOfOtherVariants(serializers: (DreamModelSerializerType | SimpleObjectSerializerType)[], renderedSerializer: DreamModelSerializerType | SimpleObjectSerializerType, options?: NullFlattenedSerializerKeysOptions): Record<string, null>;
49
+ /**
50
+ * The keys a flattened `customAttribute` with this `openapi` adds to the parent's payload, each
51
+ * set to `null`, when it renders `renderedVariant`: each key a variant of `openapi` requires that
52
+ * `renderedVariant` does not declare. `renderedVariant` is any `openapi` shorthand: one member of
53
+ * an `anyOf` or `oneOf`, or `{ $serializer: childSerializer }` for one child of a `$serializable`
54
+ * ref to an STI base. A key requires its value when an object shape's `required` array lists it,
55
+ * whether the shape's own `properties` declare it or a member of its `allOf`, `anyOf` or `oneOf`
56
+ * does, or when a serializer declares it without `required: false`.
57
+ */
58
+ export declare function nullFlattenedOpenapiKeysOfOtherVariants(openapi: OpenapiSchemaBodyShorthand | OpenapiShorthandPrimitiveTypes, renderedVariant: OpenapiSchemaBodyShorthand | OpenapiShorthandPrimitiveTypes, options?: NullFlattenedSerializerKeysOptions): Record<string, null>;
59
+ /**
60
+ * The keys a flattened `customAttribute` with this `openapi` adds to the parent's payload, each
61
+ * set to `null`, beside the non-null `value` its callback returned, from which the rendered
62
+ * variant is read. A serializer's declarations are the rendered variant, so a `$serializable` ref
63
+ * to an STI base adds the keys of every other child, as `nullFlattenedOpenapiKeysOfOtherVariants`
64
+ * reads them; the serializer renders each of its own keys. A plain object renders only the keys
65
+ * it has, so it adds each key the rendered variant requires that the object leaves out as well as
66
+ * each key another variant requires that the rendered one does not declare. An `openapi` with one
67
+ * variant is the rendered one. Of several variants (the members of an `anyOf` or `oneOf`, or one
68
+ * `$serializer` per child of a `$serializable` ref to an STI base, a member with several variants
69
+ * of its own contributing each of them, and an `allOf` beside an `anyOf` or `oneOf` joining each
70
+ * of its variants), the rendered one is the variant that declares every key the object has; when
71
+ * several do, the first of them whose required keys the object all has, and when none is found,
72
+ * the object adds each key any variant requires. The object's top-level keys render cased per
73
+ * `casing`, so they are compared cased, and a key it has is never added.
74
+ */
75
+ export declare function nullFlattenedOpenapiKeysForValue(openapi: OpenapiSchemaBodyShorthand | OpenapiShorthandPrimitiveTypes, value: unknown, options?: NullFlattenedSerializerKeysOptions): Record<string, null>;
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DreamMigrationHelpers | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@rvoh/dream</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/db.html">db</a></li><li><a href="" aria-current="page">DreamMigrationHelpers</a></li></ul><h1>Class DreamMigrationHelpers</h1></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L10">src/db/migration-helpers/DreamMigrationHelpers.ts:10</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
1
+ <!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DreamMigrationHelpers | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@rvoh/dream</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/db.html">db</a></li><li><a href="" aria-current="page">DreamMigrationHelpers</a></li></ul><h1>Class DreamMigrationHelpers</h1></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L10">src/db/migration-helpers/DreamMigrationHelpers.ts:10</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
2
2
  </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="#adddeferrableuniqueconstraint" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Deferrable<wbr/>Unique<wbr/>Constraint</span></a>
3
3
  <a href="#addenumvalue" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Enum<wbr/>Value</span></a>
4
4
  <a href="#createextension" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Extension</span></a>
@@ -18,13 +18,13 @@ indexes.</p>
18
18
  </div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">columns</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
19
19
  </div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">columns</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><p>The names of the columns to include in the constraint</p>
20
20
  </div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the table</p>
21
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L58">src/db/migration-helpers/DreamMigrationHelpers.ts:58</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="addenumvalue"><code class="tsd-tag">Static</code><span>add<wbr/>Enum<wbr/>Value</span><a href="#addenumvalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="addenumvalue-1"><span class="tsd-kind-call-signature">addEnumValue</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AddValueToEnumOpts</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#addenumvalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Add a value to an enum.</p>
21
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L58">src/db/migration-helpers/DreamMigrationHelpers.ts:58</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="addenumvalue"><code class="tsd-tag">Static</code><span>add<wbr/>Enum<wbr/>Value</span><a href="#addenumvalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="addenumvalue-1"><span class="tsd-kind-call-signature">addEnumValue</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">AddValueToEnumOpts</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#addenumvalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Add a value to an enum.</p>
22
22
  <p>Note that this always includes &quot;IF NOT EXISTS&quot;, so is safe to re-run multiple times.</p>
23
23
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
24
24
  </div></li><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-type">AddValueToEnumOpts</span></span><div class="tsd-comment tsd-typography"><p>The options for adding the enum value</p>
25
25
  </div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span>enumName</span></h5><div class="tsd-comment tsd-typography"><p>The name of the enum to modify</p>
26
26
  </div></li><li class="tsd-parameter"><h5><span>value</span></h5><div class="tsd-comment tsd-typography"><p>The name of the value to add to the enum</p>
27
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L88">src/db/migration-helpers/DreamMigrationHelpers.ts:88</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="createextension"><code class="tsd-tag">Static</code><span>create<wbr/>Extension</span><a href="#createextension" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="createextension-1"><span class="tsd-kind-call-signature">createExtension</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">extensionName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">ifNotExists</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">publicSchema</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createextension-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a database extension.</p>
27
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L88">src/db/migration-helpers/DreamMigrationHelpers.ts:88</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="createextension"><code class="tsd-tag">Static</code><span>create<wbr/>Extension</span><a href="#createextension" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="createextension-1"><span class="tsd-kind-call-signature">createExtension</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">extensionName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">ifNotExists</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">publicSchema</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createextension-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a database extension.</p>
28
28
  <pre><code><span class="hl-1"> </span><span class="hl-7">// Add the case insensitive extension</span><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">createExtension</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">, </span><span class="hl-6">&#39;citext&#39;</span><span class="hl-1">)</span><br/><br/><span class="hl-1"> </span><span class="hl-7">// Add the pg trigram extension</span><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">createExtension</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">, </span><span class="hl-6">&#39;pg_trgm&#39;</span><span class="hl-1">)</span>
29
29
  </code><button>Copy</button></pre>
30
30
 
@@ -33,13 +33,13 @@ indexes.</p>
33
33
  </div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">ifNotExists</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">publicSchema</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
34
34
  </div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">ifNotExists</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>Only add the extension if it doesn't already exist</p>
35
35
  </div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">publicSchema</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>Create using the public schema</p>
36
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L110">src/db/migration-helpers/DreamMigrationHelpers.ts:110</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="createginindex"><code class="tsd-tag">Static</code><span>create<wbr/>Gin<wbr/>Index</span><a href="#createginindex" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="createginindex-1"><span class="tsd-kind-call-signature">createGinIndex</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">indexName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">column</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createginindex-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a gin index</p>
36
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L110">src/db/migration-helpers/DreamMigrationHelpers.ts:110</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="createginindex"><code class="tsd-tag">Static</code><span>create<wbr/>Gin<wbr/>Index</span><a href="#createginindex" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="createginindex-1"><span class="tsd-kind-call-signature">createGinIndex</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">indexName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">column</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createginindex-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a gin index</p>
37
37
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
38
38
  </div></li><li><span><span class="tsd-kind-parameter">indexName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the constraint to create</p>
39
39
  </div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">column</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span> <span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
40
40
  </div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">column</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the column to index</p>
41
41
  </div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the table</p>
42
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L132">src/db/migration-helpers/DreamMigrationHelpers.ts:132</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="decryptcolumn"><code class="tsd-tag">Static</code><span>decrypt<wbr/>Column</span><a href="#decryptcolumn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="decryptcolumn-1"><span class="tsd-kind-call-signature">decryptColumn</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecryptColumnOpts</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#decryptcolumn-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Inverse of <a href="#encryptcolumn" class="tsd-kind-method">DreamMigrationHelpers.encryptColumn</a>: decrypt an
42
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L132">src/db/migration-helpers/DreamMigrationHelpers.ts:132</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="decryptcolumn"><code class="tsd-tag">Static</code><span>decrypt<wbr/>Column</span><a href="#decryptcolumn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="decryptcolumn-1"><span class="tsd-kind-call-signature">decryptColumn</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DecryptColumnOpts</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#decryptcolumn-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Inverse of <a href="#encryptcolumn" class="tsd-kind-method">DreamMigrationHelpers.encryptColumn</a>: decrypt an
43
43
  <code>encrypted_&lt;column&gt;</code> column back to plaintext and rename it to <code>column</code>.</p>
44
44
  <p>Every non-null value is decrypted with the same path the decorator's getter uses
45
45
  (<code>InternalEncrypt.decryptColumn</code>, which honors both the <code>current</code> and <code>legacy</code>
@@ -60,20 +60,20 @@ recovered from the encrypted state. Pass <code>columnType</code> to restore a sp
60
60
  </div></li><li class="tsd-parameter"><h5><span>primaryKey</span></h5><div class="tsd-comment tsd-typography"><p>The primary key column used to keyset-paginate and target each row's update. Defaults to <code>id</code>.</p>
61
61
  </div></li><li class="tsd-parameter"><h5><span>batchSize</span></h5><div class="tsd-comment tsd-typography"><p>How many rows to read per batch. Defaults to <code>1000</code>.</p>
62
62
  </div></li><li class="tsd-parameter"><h5><span>columnType</span></h5><div class="tsd-comment tsd-typography"><p>When provided, the restored column is converted to this type. When omitted, the column is left as <code>text</code>.</p>
63
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L390">src/db/migration-helpers/DreamMigrationHelpers.ts:390</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dropconstraint"><code class="tsd-tag">Static</code><span>drop<wbr/>Constraint</span><a href="#dropconstraint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="dropconstraint-1"><span class="tsd-kind-call-signature">dropConstraint</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">constraintName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropconstraint-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a constraint</p>
63
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L390">src/db/migration-helpers/DreamMigrationHelpers.ts:390</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dropconstraint"><code class="tsd-tag">Static</code><span>drop<wbr/>Constraint</span><a href="#dropconstraint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="dropconstraint-1"><span class="tsd-kind-call-signature">dropConstraint</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">constraintName</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropconstraint-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a constraint</p>
64
64
  <p>Note that this always includes &quot;IF NOT EXISTS&quot;, so is safe to re-run multiple times.</p>
65
65
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
66
66
  </div></li><li><span><span class="tsd-kind-parameter">constraintName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the constraint to create</p>
67
67
  </div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{</span> <span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span> <span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
68
68
  </div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the table</p>
69
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L153">src/db/migration-helpers/DreamMigrationHelpers.ts:153</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dropenumvalue"><code class="tsd-tag">Static</code><span>drop<wbr/>Enum<wbr/>Value</span><a href="#dropenumvalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="dropenumvalue-1"><span class="tsd-kind-call-signature">dropEnumValue</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DropValueFromEnumOpts</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropenumvalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a value from an enum and replace it with a different enum already
69
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L153">src/db/migration-helpers/DreamMigrationHelpers.ts:153</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="dropenumvalue"><code class="tsd-tag">Static</code><span>drop<wbr/>Enum<wbr/>Value</span><a href="#dropenumvalue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="dropenumvalue-1"><span class="tsd-kind-call-signature">dropEnumValue</span><span class="tsd-signature-symbol">(</span><br/>    <span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span><br/>    <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">DropValueFromEnumOpts</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropenumvalue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a value from an enum and replace it with a different enum already
70
70
  present in the enum type (or optionally remove it from array columns).</p>
71
71
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
72
72
  </div></li><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-type">DropValueFromEnumOpts</span></span><div class="tsd-comment tsd-typography"><p>The options for dropping the enum value</p>
73
73
  </div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span>enumName</span></h5><div class="tsd-comment tsd-typography"><p>The name of the enum to modify</p>
74
74
  </div></li><li class="tsd-parameter"><h5><span>value</span></h5><div class="tsd-comment tsd-typography"><p>The name of the value to drop from the enum</p>
75
75
  </div></li><li class="tsd-parameter"><h5><span>replacements</span></h5><div class="tsd-comment tsd-typography"><p>Details about which table and column to change and which value to replace the dropped value with (or remove it if the column is an array)</p>
76
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L206">src/db/migration-helpers/DreamMigrationHelpers.ts:206</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="encryptcolumn"><code class="tsd-tag">Static</code><span>encrypt<wbr/>Column</span><a href="#encryptcolumn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="encryptcolumn-1"><span class="tsd-kind-call-signature">encryptColumn</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">EncryptColumnOpts</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#encryptcolumn-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Convert an existing plaintext column into the encrypted-backed form expected by
76
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L206">src/db/migration-helpers/DreamMigrationHelpers.ts:206</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="encryptcolumn"><code class="tsd-tag">Static</code><span>encrypt<wbr/>Column</span><a href="#encryptcolumn" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="encryptcolumn-1"><span class="tsd-kind-call-signature">encryptColumn</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">EncryptColumnOpts</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#encryptcolumn-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Convert an existing plaintext column into the encrypted-backed form expected by
77
77
  the <code>@Encrypted</code> decorator.</p>
78
78
  <p>This renames <code>column</code> to <code>encrypted_&lt;column&gt;</code>, widens it to <code>text</code>, and rewrites
79
79
  every non-null value with the AES-GCM ciphertext produced by the exact same code
@@ -106,7 +106,7 @@ queryable). Remove the index before this migration and do not re-add it.</p>
106
106
  </div></li><li class="tsd-parameter"><h5><span>encryptedColumnName</span></h5><div class="tsd-comment tsd-typography"><p>The target encrypted column name. Defaults to the column the <code>@Encrypted</code> decorator reads for a property named after <code>column</code> (<code>encrypted_phone</code> for <code>phone</code>); pass this when the decorator was given a custom encrypted column name.</p>
107
107
  </div></li><li class="tsd-parameter"><h5><span>primaryKey</span></h5><div class="tsd-comment tsd-typography"><p>The primary key column used to keyset-paginate and target each row's update. Defaults to <code>id</code>.</p>
108
108
  </div></li><li class="tsd-parameter"><h5><span>batchSize</span></h5><div class="tsd-comment tsd-typography"><p>How many rows to read per batch. Defaults to <code>1000</code>.</p>
109
- </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L334">src/db/migration-helpers/DreamMigrationHelpers.ts:334</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="newtransaction"><code class="tsd-tag">Static</code><span>new<wbr/>Transaction</span><a href="#newtransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="newtransaction-1"><span class="tsd-kind-call-signature">newTransaction</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#newtransaction-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Forces a new transaction boundary in migration execution.</p>
109
+ </div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L334">src/db/migration-helpers/DreamMigrationHelpers.ts:334</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="newtransaction"><code class="tsd-tag">Static</code><span>new<wbr/>Transaction</span><a href="#newtransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="newtransaction-1"><span class="tsd-kind-call-signature">newTransaction</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">void</span><a href="#newtransaction-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Forces a new transaction boundary in migration execution.</p>
110
110
  <p>When called in a migration file, this method ensures that any existing transaction
111
111
  is committed before this migration runs, and a new transaction is started before the
112
112
  migration in this file. This is essential for migrations that depend on previously
@@ -117,7 +117,7 @@ enum values to be committed to the database first.</p>
117
117
  <pre><code class="ts"><span class="hl-7">// first migration file: Add enum value</span><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-0">async</span><span class="hl-1"> </span><span class="hl-0">function</span><span class="hl-1"> </span><span class="hl-5">up</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">: </span><span class="hl-9">Kysely</span><span class="hl-1">&lt;</span><span class="hl-9">any</span><span class="hl-1">&gt;): </span><span class="hl-9">Promise</span><span class="hl-1">&lt;</span><span class="hl-9">void</span><span class="hl-1">&gt; {</span><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">addEnumValue</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">enumName:</span><span class="hl-1"> </span><span class="hl-6">&#39;user_status&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">value:</span><span class="hl-1"> </span><span class="hl-6">&#39;premium&#39;</span><br/><span class="hl-1"> })</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-7">// second migration file: Add check constraint that depends on the enum value</span><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-0">async</span><span class="hl-1"> </span><span class="hl-0">function</span><span class="hl-1"> </span><span class="hl-5">up</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">: </span><span class="hl-9">Kysely</span><span class="hl-1">&lt;</span><span class="hl-9">any</span><span class="hl-1">&gt;): </span><span class="hl-9">Promise</span><span class="hl-1">&lt;</span><span class="hl-9">void</span><span class="hl-1">&gt; {</span><br/><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">newTransaction</span><span class="hl-1">() </span><span class="hl-7">// Ensure enum value is committed first</span><br/><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">db</span><span class="hl-1">.</span><span class="hl-4">schema</span><br/><span class="hl-1"> .</span><span class="hl-5">alterTable</span><span class="hl-1">(</span><span class="hl-6">&#39;users&#39;</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-5">addCheckConstraint</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-6">&#39;check_premium_users&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">sql</span><span class="hl-6">`status = &#39;premium&#39; OR credits &lt; 100`</span><br/><span class="hl-1"> )</span><br/><span class="hl-1"> .</span><span class="hl-5">execute</span><span class="hl-1">()</span><br/><span class="hl-1">}</span>
118
118
  </code><button type="button">Copy</button></pre>
119
119
 
120
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L194">src/db/migration-helpers/DreamMigrationHelpers.ts:194</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="renametable"><code class="tsd-tag">Static</code><span>rename<wbr/>Table</span><a href="#renametable" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="renametable-1"><span class="tsd-kind-call-signature">renameTable</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">from</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">to</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#renametable-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Rename a table and its associated primary key index and sequence.</p>
120
+ </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L194">src/db/migration-helpers/DreamMigrationHelpers.ts:194</a></li></ul></aside></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="renametable"><code class="tsd-tag">Static</code><span>rename<wbr/>Table</span><a href="#renametable" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="renametable-1"><span class="tsd-kind-call-signature">renameTable</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">from</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">,</span> <span class="tsd-kind-parameter">to</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#renametable-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Rename a table and its associated primary key index and sequence.</p>
121
121
  <p>This method renames the table, its primary key index (<code>{tablename}_pkey</code>),
122
122
  and its primary key sequence (<code>{tablename}_id_seq</code>) to keep them in sync.</p>
123
123
  <p>The sequence rename applies to both legacy <code>serial</code>/<code>bigserial</code> columns and
@@ -129,4 +129,4 @@ automatically rename it when the table is renamed.</p>
129
129
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
130
130
  </div></li><li><span><span class="tsd-kind-parameter">from</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The current name of the table to rename</p>
131
131
  </div></li><li><span><span class="tsd-kind-parameter">to</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The new name for the table</p>
132
- </div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/a4703e2053f5eb7f3b8d842eaed1bb228290ac7d/src/db/migration-helpers/DreamMigrationHelpers.ts#L28">src/db/migration-helpers/DreamMigrationHelpers.ts:28</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#adddeferrableuniqueconstraint"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Deferrable<wbr/>Unique<wbr/>Constraint</span></a><a href="#addenumvalue"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Enum<wbr/>Value</span></a><a href="#createextension"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Extension</span></a><a href="#createginindex"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Gin<wbr/>Index</span></a><a href="#decryptcolumn"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>decrypt<wbr/>Column</span></a><a href="#dropconstraint"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Constraint</span></a><a href="#dropenumvalue"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Enum<wbr/>Value</span></a><a href="#encryptcolumn"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encrypt<wbr/>Column</span></a><a href="#newtransaction"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>new<wbr/>Transaction</span></a><a href="#renametable"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>rename<wbr/>Table</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@rvoh/dream</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
132
+ </div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/efd0a5e5fc37d69e9cc31504500ed40b6f80416d/src/db/migration-helpers/DreamMigrationHelpers.ts#L28">src/db/migration-helpers/DreamMigrationHelpers.ts:28</a></li></ul></aside></div></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#adddeferrableuniqueconstraint"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Deferrable<wbr/>Unique<wbr/>Constraint</span></a><a href="#addenumvalue"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Enum<wbr/>Value</span></a><a href="#createextension"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Extension</span></a><a href="#createginindex"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Gin<wbr/>Index</span></a><a href="#decryptcolumn"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>decrypt<wbr/>Column</span></a><a href="#dropconstraint"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Constraint</span></a><a href="#dropenumvalue"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Enum<wbr/>Value</span></a><a href="#encryptcolumn"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>encrypt<wbr/>Column</span></a><a href="#newtransaction"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>new<wbr/>Transaction</span></a><a href="#renametable"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Method"><use href="../assets/icons.svg#icon-2048"></use></svg><span>rename<wbr/>Table</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@rvoh/dream</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>