@rvoh/dream 0.31.0 → 0.31.2

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 (348) hide show
  1. package/README.md +17 -17
  2. package/dist/cjs/src/Dream.js +17 -18
  3. package/dist/cjs/src/bin/helpers/sync.js +11 -4
  4. package/dist/cjs/src/bin/index.js +18 -19
  5. package/dist/cjs/src/cli/logger/DreamCliLogger.js +12 -46
  6. package/dist/cjs/src/cli/logger/loggable/DreamCliLoggable.js +1 -3
  7. package/dist/cjs/src/cli/logger/loggable/DreamCliLoggableText.js +2 -2
  8. package/dist/cjs/src/decorators/Decorators.js +28 -28
  9. package/dist/cjs/src/decorators/field/association/BelongsTo.js +2 -2
  10. package/dist/cjs/src/decorators/field/association/HasMany.js +2 -2
  11. package/dist/cjs/src/decorators/field/association/HasOne.js +2 -2
  12. package/dist/cjs/src/decorators/field/association/shared.js +8 -8
  13. package/dist/cjs/src/decorators/field/lifecycle/AfterCreateCommit.js +1 -1
  14. package/dist/cjs/src/decorators/field/lifecycle/AfterDestroyCommit.js +1 -1
  15. package/dist/cjs/src/decorators/field/lifecycle/AfterSaveCommit.js +1 -1
  16. package/dist/cjs/src/decorators/field/lifecycle/AfterUpdateCommit.js +1 -1
  17. package/dist/cjs/src/decorators/field/validation/Validates.js +1 -1
  18. package/dist/cjs/src/dream/DreamClassTransactionBuilder.js +2 -2
  19. package/dist/cjs/src/dream/Query.js +7 -7
  20. package/dist/cjs/src/{openapi/types.js → dream/constants.js} +13 -1
  21. package/dist/cjs/src/dream/internal/similarity/SimilarityBuilder.js +3 -3
  22. package/dist/cjs/src/helpers/cli/SchemaBuilder.js +5 -5
  23. package/dist/cjs/src/helpers/cli/generateDream.js +1 -1
  24. package/dist/cjs/src/helpers/cli/generateDreamContent.js +2 -2
  25. package/dist/cjs/src/helpers/db/primaryKeyType.js +2 -2
  26. package/dist/cjs/src/helpers/db/runMigration.js +5 -5
  27. package/dist/cjs/src/helpers/isEmpty.js +2 -0
  28. package/dist/cjs/src/helpers/sort.js +24 -0
  29. package/dist/cjs/src/helpers/sortBy.js +19 -2
  30. package/dist/cjs/src/helpers/sspawn.js +29 -3
  31. package/dist/cjs/src/helpers/uniq.js +6 -5
  32. package/dist/cjs/src/index.js +8 -7
  33. package/dist/cjs/src/ops/ops-statement.js +3 -3
  34. package/dist/cjs/src/serializer/decorators/associations/RendersMany.js +2 -2
  35. package/dist/cjs/src/serializer/decorators/associations/RendersOne.js +2 -2
  36. package/dist/cjs/src/serializer/index.js +2 -2
  37. package/dist/esm/src/Dream.js +18 -19
  38. package/dist/esm/src/bin/helpers/sync.js +11 -4
  39. package/dist/esm/src/bin/index.js +18 -19
  40. package/dist/esm/src/cli/logger/DreamCliLogger.js +12 -46
  41. package/dist/esm/src/cli/logger/loggable/DreamCliLoggable.js +1 -3
  42. package/dist/esm/src/cli/logger/loggable/DreamCliLoggableText.js +2 -2
  43. package/dist/esm/src/decorators/Decorators.js +28 -28
  44. package/dist/esm/src/decorators/field/association/BelongsTo.js +2 -2
  45. package/dist/esm/src/decorators/field/association/HasMany.js +2 -2
  46. package/dist/esm/src/decorators/field/association/HasOne.js +2 -2
  47. package/dist/esm/src/decorators/field/association/shared.js +6 -6
  48. package/dist/esm/src/decorators/field/lifecycle/AfterCreateCommit.js +1 -1
  49. package/dist/esm/src/decorators/field/lifecycle/AfterDestroyCommit.js +1 -1
  50. package/dist/esm/src/decorators/field/lifecycle/AfterSaveCommit.js +1 -1
  51. package/dist/esm/src/decorators/field/lifecycle/AfterUpdateCommit.js +1 -1
  52. package/dist/esm/src/decorators/field/validation/Validates.js +1 -1
  53. package/dist/esm/src/dream/DreamClassTransactionBuilder.js +2 -2
  54. package/dist/esm/src/dream/Query.js +3 -3
  55. package/dist/esm/src/{openapi/types.js → dream/constants.js} +12 -0
  56. package/dist/esm/src/dream/internal/similarity/SimilarityBuilder.js +1 -1
  57. package/dist/esm/src/errors/associations/InvalidComputedForeignKey.js +1 -1
  58. package/dist/esm/src/helpers/cli/SchemaBuilder.js +3 -3
  59. package/dist/esm/src/helpers/cli/generateDream.js +1 -1
  60. package/dist/esm/src/helpers/cli/generateDreamContent.js +2 -2
  61. package/dist/esm/src/helpers/db/primaryKeyType.js +1 -1
  62. package/dist/esm/src/helpers/db/runMigration.js +5 -5
  63. package/dist/esm/src/helpers/isEmpty.js +2 -0
  64. package/dist/esm/src/helpers/sort.js +21 -0
  65. package/dist/esm/src/helpers/sortBy.js +19 -2
  66. package/dist/esm/src/helpers/sspawn.js +29 -3
  67. package/dist/esm/src/helpers/uniq.js +6 -5
  68. package/dist/esm/src/index.js +2 -2
  69. package/dist/esm/src/ops/ops-statement.js +1 -1
  70. package/dist/esm/src/serializer/decorators/associations/RendersMany.js +2 -2
  71. package/dist/esm/src/serializer/decorators/associations/RendersOne.js +2 -2
  72. package/dist/esm/src/serializer/index.js +1 -1
  73. package/dist/types/src/Dream.d.ts +28 -28
  74. package/dist/types/src/cli/logger/DreamCliLogger.d.ts +5 -20
  75. package/dist/types/src/cli/logger/loggable/DreamCliLoggable.d.ts +2 -4
  76. package/dist/types/src/cli/logger/loggable/DreamCliLoggableText.d.ts +2 -3
  77. package/dist/types/src/cli/logger/loggable/colorize.d.ts +1 -1
  78. package/dist/types/src/db/ConnectedToDB.d.ts +2 -2
  79. package/dist/types/src/db/ConnectionConfRetriever.d.ts +1 -1
  80. package/dist/types/src/db/DreamDbConnection.d.ts +1 -1
  81. package/dist/types/src/db/dataTypes.d.ts +0 -3
  82. package/dist/types/src/db/index.d.ts +1 -1
  83. package/dist/types/src/decorators/Decorators.d.ts +28 -28
  84. package/dist/types/src/decorators/field/association/BelongsTo.d.ts +2 -30
  85. package/dist/types/src/decorators/field/association/HasMany.d.ts +2 -15
  86. package/dist/types/src/decorators/field/association/HasOne.d.ts +2 -7
  87. package/dist/types/src/decorators/field/association/associationToGetterSetterProp.d.ts +4 -4
  88. package/dist/types/src/decorators/field/association/shared.d.ts +1 -100
  89. package/dist/types/src/decorators/field/lifecycle/AfterCreate.d.ts +1 -1
  90. package/dist/types/src/decorators/field/lifecycle/AfterCreateCommit.d.ts +2 -2
  91. package/dist/types/src/decorators/field/lifecycle/AfterDestroyCommit.d.ts +1 -1
  92. package/dist/types/src/decorators/field/lifecycle/AfterSave.d.ts +1 -1
  93. package/dist/types/src/decorators/field/lifecycle/AfterSaveCommit.d.ts +2 -2
  94. package/dist/types/src/decorators/field/lifecycle/AfterUpdate.d.ts +1 -1
  95. package/dist/types/src/decorators/field/lifecycle/AfterUpdateCommit.d.ts +2 -2
  96. package/dist/types/src/decorators/field/lifecycle/BeforeCreate.d.ts +1 -1
  97. package/dist/types/src/decorators/field/lifecycle/BeforeSave.d.ts +1 -1
  98. package/dist/types/src/decorators/field/lifecycle/BeforeUpdate.d.ts +1 -1
  99. package/dist/types/src/decorators/field/lifecycle/shared.d.ts +1 -30
  100. package/dist/types/src/decorators/field/validation/Validates.d.ts +1 -1
  101. package/dist/types/src/dream/DreamClassTransactionBuilder.d.ts +8 -6
  102. package/dist/types/src/dream/DreamInstanceTransactionBuilder.d.ts +4 -2
  103. package/dist/types/src/dream/DreamTransaction.d.ts +1 -1
  104. package/dist/types/src/dream/LeftJoinLoadBuilder.d.ts +3 -2
  105. package/dist/types/src/dream/LoadBuilder.d.ts +3 -2
  106. package/dist/types/src/dream/Query.d.ts +7 -49
  107. package/dist/types/src/dream/constants.d.ts +15 -0
  108. package/dist/types/src/dream/internal/applyScopeBypassingSettingsToQuery.d.ts +1 -1
  109. package/dist/types/src/dream/internal/associations/associationQuery.d.ts +1 -1
  110. package/dist/types/src/dream/internal/associations/associationUpdateQuery.d.ts +1 -1
  111. package/dist/types/src/dream/internal/associations/createAssociation.d.ts +1 -1
  112. package/dist/types/src/dream/internal/associations/destroyAssociation.d.ts +1 -1
  113. package/dist/types/src/dream/internal/associations/undestroyAssociation.d.ts +1 -1
  114. package/dist/types/src/dream/internal/checkSingleValidation.d.ts +1 -1
  115. package/dist/types/src/dream/internal/destroyOptions.d.ts +1 -1
  116. package/dist/types/src/dream/internal/orderByDirection.d.ts +1 -1
  117. package/dist/types/src/dream/internal/runHooksFor.d.ts +1 -1
  118. package/dist/types/src/dream/internal/safelyRunCommitHooks.d.ts +1 -1
  119. package/dist/types/src/dream/internal/scopeHelpers.d.ts +1 -1
  120. package/dist/types/src/dream/internal/similarity/SimilarityBuilder.d.ts +3 -3
  121. package/dist/types/src/dream/internal/sqlResultToDreamInstance.d.ts +1 -1
  122. package/dist/types/src/dream-application/index.d.ts +1 -1
  123. package/dist/types/src/errors/ValidationError.d.ts +1 -1
  124. package/dist/types/src/errors/associations/CanOnlyPassBelongsToModelParam.d.ts +2 -2
  125. package/dist/types/src/errors/associations/CannotAssociateThroughPolymorphic.d.ts +2 -2
  126. package/dist/types/src/errors/associations/CannotCreateAssociationWithThroughContext.d.ts +2 -2
  127. package/dist/types/src/errors/associations/CannotJoinPolymorphicBelongsToError.d.ts +1 -1
  128. package/dist/types/src/errors/associations/CannotPassNullOrUndefinedToRequiredBelongsTo.d.ts +1 -1
  129. package/dist/types/src/errors/associations/InvalidComputedForeignKey.d.ts +1 -1
  130. package/dist/types/src/errors/associations/MissingRequiredAssociationOnClause.d.ts +2 -2
  131. package/dist/types/src/errors/associations/MissingThroughAssociation.d.ts +2 -2
  132. package/dist/types/src/errors/associations/MissingThroughAssociationSource.d.ts +2 -2
  133. package/dist/types/src/helpers/cli/generateMigrationContent.d.ts +1 -1
  134. package/dist/types/src/helpers/cli/generateStiMigrationContent.d.ts +1 -1
  135. package/dist/types/src/helpers/db/createDb.d.ts +1 -1
  136. package/dist/types/src/helpers/db/dropDb.d.ts +1 -1
  137. package/dist/types/src/helpers/db/foreignKeyTypeFromPrimaryKey.d.ts +1 -1
  138. package/dist/types/src/helpers/inferSerializerFromDreamOrViewModel.d.ts +1 -1
  139. package/dist/types/src/helpers/isEmpty.d.ts +1 -1
  140. package/dist/types/src/helpers/objectPathsToArrays.d.ts +1 -1
  141. package/dist/types/src/helpers/sort.d.ts +15 -0
  142. package/dist/types/src/helpers/sortBy.d.ts +2 -2
  143. package/dist/types/src/helpers/sspawn.d.ts +6 -2
  144. package/dist/types/src/helpers/stringCasing.d.ts +1 -1
  145. package/dist/types/src/helpers/uniq.d.ts +1 -1
  146. package/dist/types/src/index.d.ts +6 -4
  147. package/dist/types/src/ops/index.d.ts +1 -1
  148. package/dist/types/src/ops/ops-statement.d.ts +1 -1
  149. package/dist/types/src/serializer/decorators/associations/RendersMany.d.ts +3 -3
  150. package/dist/types/src/serializer/decorators/associations/RendersOne.d.ts +3 -3
  151. package/dist/types/src/serializer/decorators/associations/shared.d.ts +2 -1
  152. package/dist/types/src/serializer/decorators/attribute.d.ts +1 -1
  153. package/dist/types/src/serializer/decorators/helpers/dreamAttributeOpenapiShape.d.ts +2 -2
  154. package/dist/types/src/serializer/decorators/helpers/hasSerializersGetter.d.ts +1 -1
  155. package/dist/types/src/serializer/decorators/helpers/maybeSerializableToDreamSerializerCallbackFunction.d.ts +1 -1
  156. package/dist/types/src/types/associations/belongsTo.d.ts +76 -0
  157. package/dist/types/src/types/associations/hasMany.d.ts +80 -0
  158. package/dist/types/src/types/associations/hasOne.d.ts +26 -0
  159. package/dist/types/src/types/associations/shared.d.ts +453 -0
  160. package/dist/types/src/types/db.d.ts +14 -0
  161. package/dist/types/src/types/dream.d.ts +527 -0
  162. package/dist/types/src/types/lifecycle.d.ts +50 -0
  163. package/dist/types/src/types/logger.d.ts +42 -0
  164. package/dist/types/src/types/openapi.d.ts +243 -0
  165. package/dist/types/src/types/query.d.ts +127 -0
  166. package/dist/types/src/types/utils.d.ts +173 -0
  167. package/dist/types/src/types/validation.d.ts +20 -0
  168. package/dist/types/src/types/variadic.d.ts +447 -0
  169. package/docs/assets/navigation.js +1 -1
  170. package/docs/assets/search.js +1 -1
  171. package/docs/classes/Benchmark.html +2 -2
  172. package/docs/classes/CalendarDate.html +2 -2
  173. package/docs/classes/CreateOrFindByFailedToCreateAndFind.html +3 -3
  174. package/docs/classes/Decorators.html +38 -38
  175. package/docs/classes/Dream.html +140 -139
  176. package/docs/classes/DreamApplication.html +4 -4
  177. package/docs/classes/DreamBin.html +2 -2
  178. package/docs/classes/DreamCLI.html +4 -4
  179. package/docs/classes/DreamDbConnection.html +2 -2
  180. package/docs/classes/DreamGlam.html +2 -2
  181. package/docs/classes/DreamImporter.html +2 -2
  182. package/docs/classes/DreamMigrationHelpers.html +7 -7
  183. package/docs/classes/DreamSerializer.html +2 -2
  184. package/docs/classes/DreamTransaction.html +2 -2
  185. package/docs/classes/Encrypt.html +2 -2
  186. package/docs/classes/Env.html +2 -2
  187. package/docs/classes/GlobalNameNotSet.html +3 -3
  188. package/docs/classes/NonLoadedAssociation.html +3 -3
  189. package/docs/classes/Query.html +51 -51
  190. package/docs/classes/Range.html +2 -2
  191. package/docs/classes/RecordNotFound.html +3 -3
  192. package/docs/classes/ValidationError.html +3 -3
  193. package/docs/functions/Attribute.html +1 -1
  194. package/docs/functions/RendersMany.html +2 -2
  195. package/docs/functions/RendersOne.html +2 -2
  196. package/docs/functions/ReplicaSafe.html +1 -1
  197. package/docs/functions/STI.html +1 -1
  198. package/docs/functions/SoftDelete.html +1 -1
  199. package/docs/functions/camelize.html +1 -1
  200. package/docs/functions/capitalize.html +1 -1
  201. package/docs/functions/closeAllDbConnections.html +1 -1
  202. package/docs/functions/compact.html +1 -1
  203. package/docs/functions/db.html +1 -1
  204. package/docs/functions/debug.html +1 -1
  205. package/docs/functions/dreamDbConnections.html +1 -1
  206. package/docs/functions/dreamPath.html +1 -1
  207. package/docs/functions/generateDream.html +1 -1
  208. package/docs/functions/globalClassNameFromFullyQualifiedModelName.html +1 -1
  209. package/docs/functions/hyphenize.html +1 -1
  210. package/docs/functions/inferSerializerFromDreamClassOrViewModelClass.html +1 -1
  211. package/docs/functions/inferSerializerFromDreamOrViewModel.html +1 -1
  212. package/docs/functions/isEmpty.html +1 -1
  213. package/docs/functions/loadRepl.html +1 -1
  214. package/docs/functions/lookupClassByGlobalName.html +1 -1
  215. package/docs/functions/pascalize.html +1 -1
  216. package/docs/functions/pgErrorType.html +1 -1
  217. package/docs/functions/range-1.html +1 -1
  218. package/docs/functions/relativeDreamPath.html +1 -1
  219. package/docs/functions/round.html +1 -1
  220. package/docs/functions/serializerNameFromFullyQualifiedModelName.html +1 -1
  221. package/docs/functions/sharedPathPrefix.html +1 -1
  222. package/docs/functions/snakeify.html +1 -1
  223. package/docs/functions/sort.html +6 -0
  224. package/docs/functions/sortBy.html +6 -1
  225. package/docs/functions/standardizeFullyQualifiedModelName.html +1 -1
  226. package/docs/functions/uncapitalize.html +1 -1
  227. package/docs/functions/uniq.html +1 -1
  228. package/docs/functions/validateColumn.html +1 -1
  229. package/docs/functions/validateTable.html +1 -1
  230. package/docs/index.html +5 -5
  231. package/docs/interfaces/AttributeStatement.html +2 -2
  232. package/docs/interfaces/DecoratorContext.html +2 -2
  233. package/docs/interfaces/DreamApplicationInitOptions.html +2 -2
  234. package/docs/interfaces/DreamApplicationOpts.html +2 -2
  235. package/docs/interfaces/DreamSerializerAssociationStatement.html +2 -2
  236. package/docs/interfaces/EncryptOptions.html +2 -2
  237. package/docs/interfaces/OpenapiSchemaProperties.html +1 -1
  238. package/docs/interfaces/OpenapiSchemaPropertiesShorthand.html +1 -1
  239. package/docs/interfaces/OpenapiTypeFieldObject.html +1 -1
  240. package/docs/modules.html +1 -0
  241. package/docs/types/Camelized.html +1 -1
  242. package/docs/types/CommonOpenapiSchemaObjectFields.html +1 -1
  243. package/docs/types/DateTime.html +1 -1
  244. package/docs/types/DreamAssociationMetadata.html +1 -1
  245. package/docs/types/DreamAttributes.html +1 -1
  246. package/docs/types/DreamClassColumn.html +1 -1
  247. package/docs/types/DreamColumn.html +1 -1
  248. package/docs/types/DreamColumnNames.html +1 -1
  249. package/docs/types/DreamLogLevel.html +1 -1
  250. package/docs/types/DreamLogger.html +1 -1
  251. package/docs/types/DreamOrViewModelSerializerKey.html +1 -1
  252. package/docs/types/DreamParamSafeAttributes.html +1 -1
  253. package/docs/types/DreamParamSafeColumnNames.html +1 -1
  254. package/docs/types/DreamSerializerKey.html +1 -1
  255. package/docs/types/DreamSerializers.html +1 -1
  256. package/docs/types/DreamTableSchema.html +1 -1
  257. package/docs/types/DreamVirtualColumns.html +1 -1
  258. package/docs/types/EncryptAlgorithm.html +1 -1
  259. package/docs/types/Hyphenized.html +1 -1
  260. package/docs/types/IdType.html +1 -1
  261. package/docs/types/OpenapiAllTypes.html +1 -1
  262. package/docs/types/OpenapiFormats.html +1 -1
  263. package/docs/types/OpenapiNumberFormats.html +1 -1
  264. package/docs/types/OpenapiPrimitiveTypes.html +1 -1
  265. package/docs/types/OpenapiSchemaArray.html +1 -1
  266. package/docs/types/OpenapiSchemaArrayShorthand.html +1 -1
  267. package/docs/types/OpenapiSchemaBase.html +1 -1
  268. package/docs/types/OpenapiSchemaBody.html +1 -1
  269. package/docs/types/OpenapiSchemaBodyShorthand.html +1 -1
  270. package/docs/types/OpenapiSchemaCommonFields.html +1 -1
  271. package/docs/types/OpenapiSchemaExpressionAllOf.html +1 -1
  272. package/docs/types/OpenapiSchemaExpressionAnyOf.html +1 -1
  273. package/docs/types/OpenapiSchemaExpressionOneOf.html +1 -1
  274. package/docs/types/OpenapiSchemaExpressionRef.html +1 -1
  275. package/docs/types/OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
  276. package/docs/types/OpenapiSchemaInteger.html +1 -1
  277. package/docs/types/OpenapiSchemaNull.html +1 -1
  278. package/docs/types/OpenapiSchemaNumber.html +1 -1
  279. package/docs/types/OpenapiSchemaObject.html +1 -1
  280. package/docs/types/OpenapiSchemaObjectAllOf.html +1 -1
  281. package/docs/types/OpenapiSchemaObjectAllOfShorthand.html +1 -1
  282. package/docs/types/OpenapiSchemaObjectAnyOf.html +1 -1
  283. package/docs/types/OpenapiSchemaObjectAnyOfShorthand.html +1 -1
  284. package/docs/types/OpenapiSchemaObjectBase.html +1 -1
  285. package/docs/types/OpenapiSchemaObjectBaseShorthand.html +1 -1
  286. package/docs/types/OpenapiSchemaObjectOneOf.html +1 -1
  287. package/docs/types/OpenapiSchemaObjectOneOfShorthand.html +1 -1
  288. package/docs/types/OpenapiSchemaObjectShorthand.html +1 -1
  289. package/docs/types/OpenapiSchemaPartialSegment.html +1 -1
  290. package/docs/types/OpenapiSchemaPrimitiveGeneric.html +1 -1
  291. package/docs/types/OpenapiSchemaShorthandExpressionAllOf.html +1 -1
  292. package/docs/types/OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
  293. package/docs/types/OpenapiSchemaShorthandExpressionOneOf.html +1 -1
  294. package/docs/types/OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
  295. package/docs/types/OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
  296. package/docs/types/OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
  297. package/docs/types/OpenapiSchemaString.html +1 -1
  298. package/docs/types/OpenapiShorthandAllTypes.html +1 -1
  299. package/docs/types/OpenapiShorthandPrimitiveTypes.html +1 -1
  300. package/docs/types/OpenapiTypeField.html +1 -1
  301. package/docs/types/Pascalized.html +1 -1
  302. package/docs/types/PrimaryKeyType.html +1 -1
  303. package/docs/types/RoundingPrecision.html +1 -1
  304. package/docs/types/SerializableClassOrSerializerCallback.html +1 -1
  305. package/docs/types/SerializableDreamClassOrViewModelClass.html +1 -1
  306. package/docs/types/SerializableDreamOrViewModel.html +1 -1
  307. package/docs/types/SerializableTypes.html +1 -1
  308. package/docs/types/Snakeified.html +1 -1
  309. package/docs/types/Timestamp.html +1 -1
  310. package/docs/types/UpdateableAssociationProperties.html +1 -1
  311. package/docs/types/UpdateableProperties.html +1 -1
  312. package/docs/types/ValidationType.html +1 -1
  313. package/docs/types/ViewModelSerializerKey.html +1 -1
  314. package/docs/types/WhereStatementForDream.html +1 -1
  315. package/docs/types/WhereStatementForDreamClass.html +1 -1
  316. package/docs/variables/DateTime-1.html +1 -1
  317. package/docs/variables/DreamConst.html +1 -1
  318. package/docs/variables/TRIGRAM_OPERATORS.html +1 -1
  319. package/docs/variables/openapiPrimitiveTypes-1.html +1 -1
  320. package/docs/variables/openapiShorthandPrimitiveTypes-1.html +1 -1
  321. package/docs/variables/ops.html +1 -1
  322. package/docs/variables/primaryKeyTypes.html +1 -1
  323. package/package.json +2 -3
  324. package/dist/cjs/src/cli/logger/helpers/createSpinner.js +0 -14
  325. package/dist/cjs/src/cli/logger/loggable/DreamCliLoggableSpinner.js +0 -31
  326. package/dist/cjs/src/cli/logger/loggable/spinners.js +0 -1185
  327. package/dist/cjs/src/db/reflections.js +0 -2
  328. package/dist/cjs/src/db/types.js +0 -2
  329. package/dist/cjs/src/decorators/field/validation/shared.js +0 -2
  330. package/dist/cjs/src/dream/types.js +0 -98
  331. package/dist/cjs/src/helpers/typeutils.js +0 -2
  332. package/dist/esm/src/cli/logger/helpers/createSpinner.js +0 -11
  333. package/dist/esm/src/cli/logger/loggable/DreamCliLoggableSpinner.js +0 -28
  334. package/dist/esm/src/cli/logger/loggable/spinners.js +0 -1183
  335. package/dist/esm/src/db/reflections.js +0 -1
  336. package/dist/esm/src/db/types.js +0 -1
  337. package/dist/esm/src/decorators/field/validation/shared.js +0 -1
  338. package/dist/esm/src/dream/types.js +0 -95
  339. package/dist/esm/src/helpers/typeutils.js +0 -1
  340. package/dist/types/src/cli/logger/helpers/createSpinner.d.ts +0 -2
  341. package/dist/types/src/cli/logger/loggable/DreamCliLoggableSpinner.d.ts +0 -21
  342. package/dist/types/src/cli/logger/loggable/spinners.d.ts +0 -355
  343. package/dist/types/src/db/reflections.d.ts +0 -5
  344. package/dist/types/src/db/types.d.ts +0 -1
  345. package/dist/types/src/decorators/field/validation/shared.d.ts +0 -19
  346. package/dist/types/src/dream/types.d.ts +0 -184
  347. package/dist/types/src/helpers/typeutils.d.ts +0 -115
  348. package/dist/types/src/openapi/types.d.ts +0 -139
@@ -0,0 +1,453 @@
1
+ import {
2
+ ComparisonOperatorExpression as KyselyComparisonOperatorExpression,
3
+ SelectQueryBuilder,
4
+ Updateable,
5
+ } from 'kysely'
6
+ import Dream from '../../Dream.ts'
7
+ import { DreamConst } from '../../dream/constants.ts'
8
+ import CalendarDate from '../../helpers/CalendarDate.ts'
9
+ import { DateTime } from '../../helpers/DateTime.ts'
10
+ import { Range } from '../../helpers/range.ts'
11
+ import CurriedOpsStatement from '../../ops/curried-ops-statement.ts'
12
+ import OpsStatement, { ExtraSimilarityArgs } from '../../ops/ops-statement.ts'
13
+ import { AssociationTableNames } from '../db.js'
14
+ import {
15
+ DefaultScopeName,
16
+ DefaultScopeNameForTable,
17
+ DreamBelongsToAssociationMetadata,
18
+ DreamColumnNames,
19
+ GlobalModelNameTableMap,
20
+ IdType,
21
+ OrderDir,
22
+ TableColumnEnumTypeArray,
23
+ TableColumnNames,
24
+ TableColumnType,
25
+ TableNameForGlobalModelName,
26
+ TrigramOperator,
27
+ } from '../dream.js'
28
+ import { Inc, MergeUnionOfRecordTypes, ReadonlyTail, UnionToIntersection } from '../utils.ts'
29
+ import { JoinedAssociation } from '../variadic.js'
30
+ import { BelongsToStatement } from './belongsTo.ts'
31
+ import { HasManyStatement } from './hasMany.ts'
32
+ import { HasOneStatement } from './hasOne.ts'
33
+
34
+ export type MAX_JOINED_TABLES_DEPTH = 25
35
+
36
+ export type AssociationMetadataMap = Record<
37
+ string,
38
+ | BelongsToStatement<any, any, any, any>
39
+ | HasManyStatement<any, any, any, any>
40
+ | HasOneStatement<any, any, any, any>
41
+ >
42
+
43
+ export type AssociatedBelongsToModelType<
44
+ I extends Dream,
45
+ AssociationName extends keyof DreamBelongsToAssociationMetadata<I>,
46
+ PossibleArrayAssociationType extends I[AssociationName & keyof I] = I[AssociationName & keyof I],
47
+ AssociationType extends PossibleArrayAssociationType extends (infer ElementType)[]
48
+ ? ElementType
49
+ : PossibleArrayAssociationType = PossibleArrayAssociationType extends (infer ElementType)[]
50
+ ? ElementType
51
+ : PossibleArrayAssociationType,
52
+ > = AssociationType
53
+
54
+ // For sending a BelongsTo model into a statement such as `await Post.create({ user })`
55
+
56
+ export type AssociatedModelParam<
57
+ I extends Dream,
58
+ AssociationExists = keyof DreamBelongsToAssociationMetadata<I> extends never ? false : true,
59
+ AssociationName = AssociationExists extends false
60
+ ? never
61
+ : keyof DreamBelongsToAssociationMetadata<I> & string,
62
+ RetObj = AssociationExists extends false
63
+ ? never
64
+ : AssociationName extends never
65
+ ? never
66
+ : {
67
+ [K in AssociationName &
68
+ keyof DreamBelongsToAssociationMetadata<I> &
69
+ string]: AssociatedBelongsToModelType<I, K> | null
70
+ },
71
+ > = Partial<UnionToIntersection<RetObj>>
72
+
73
+ export type PassthroughOnClause<PassthroughColumns extends string[]> = Partial<
74
+ Record<PassthroughColumns[number], any>
75
+ >
76
+ type DreamSelectable<DB, Schema, TableName extends AssociationTableNames<DB, Schema> & keyof DB> = Partial<{
77
+ [ColumnName in keyof DB[TableName]]: NonKyselySupportedSupplementalWhereClauseValues<
78
+ DB,
79
+ Schema,
80
+ TableName,
81
+ ColumnName
82
+ >
83
+ }>
84
+ type NonKyselySupportedSupplementalWhereClauseValues<
85
+ DB,
86
+ Schema,
87
+ TableName,
88
+ Column,
89
+ ColumnType = TableColumnType<Schema, TableName, Column>,
90
+ EnumTypeArray extends string[] | null = TableColumnEnumTypeArray<Schema, TableName, Column>,
91
+ PermanentOpsValTypes = null | readonly [],
92
+ OpsValType = EnumTypeArray extends string[]
93
+ ? EnumTypeArray[number] | PermanentOpsValTypes
94
+ : ColumnType | PermanentOpsValTypes,
95
+ PartialTypes = EnumTypeArray extends null
96
+ ? ColumnType extends DateTime
97
+ ?
98
+ | DateTime[]
99
+ | Range<DateTime>
100
+ | (() => Range<DateTime>)
101
+ | Range<CalendarDate>
102
+ | (() => Range<CalendarDate>)
103
+ | OpsStatement<KyselyComparisonOperatorExpression, OpsValType, any>
104
+ : ColumnType extends CalendarDate
105
+ ?
106
+ | CalendarDate[]
107
+ | Range<CalendarDate>
108
+ | (() => Range<CalendarDate>)
109
+ | Range<DateTime>
110
+ | (() => Range<DateTime>)
111
+ | OpsStatement<KyselyComparisonOperatorExpression, OpsValType>
112
+ : ColumnType extends number
113
+ ?
114
+ | (number | bigint)[]
115
+ | Range<number>
116
+ | OpsStatement<KyselyComparisonOperatorExpression, OpsValType, any>
117
+ : ColumnType extends string
118
+ ?
119
+ | string[]
120
+ | OpsStatement<KyselyComparisonOperatorExpression, string, any>
121
+ | OpsStatement<TrigramOperator, OpsValType, ExtraSimilarityArgs>
122
+ : ColumnType extends IdType
123
+ ? IdType[] | OpsStatement<KyselyComparisonOperatorExpression, OpsValType, any>
124
+ : never
125
+ : EnumTypeArray extends string[]
126
+ ? EnumTypeArray | OpsStatement<KyselyComparisonOperatorExpression, OpsValType, any>
127
+ : never,
128
+ > = PartialTypes extends never
129
+ ?
130
+ | OpsStatement<KyselyComparisonOperatorExpression, OpsValType, any>
131
+ | CurriedOpsStatement<any, any, any, OpsValType>
132
+ | SelectQueryBuilder<DB, keyof DB, any>
133
+ : PartialTypes | CurriedOpsStatement<any, any, any, OpsValType> | SelectQueryBuilder<DB, keyof DB, any>
134
+
135
+ export type WhereStatementForDreamClass<DreamClass extends typeof Dream> = WhereStatement<
136
+ InstanceType<DreamClass>['DB'],
137
+ InstanceType<DreamClass>['schema'],
138
+ InstanceType<DreamClass>['table']
139
+ >
140
+
141
+ export type WhereStatementForDream<DreamInstance extends Dream> = WhereStatement<
142
+ DreamInstance['DB'],
143
+ DreamInstance['schema'],
144
+ DreamInstance['table']
145
+ >
146
+ type AssociationNameToDotReferencedColumns<
147
+ DB,
148
+ TableName extends keyof DB,
149
+ AssociationName,
150
+ > = `${AssociationName & string}.${TableColumnNames<DB, TableName>}`
151
+
152
+ export type ColumnNamesAccountingForJoinedAssociations<
153
+ JoinedAssociations extends Readonly<JoinedAssociation[]>,
154
+ DB,
155
+ RootTableName extends keyof DB,
156
+ RootTableAlias extends string,
157
+ > = JoinedAssociations['length'] extends 0
158
+ ? TableColumnNames<DB, RootTableName> // no associations; simply return the un-namespaced columns for the root table
159
+ : JoinedAssociationColumnNames<
160
+ JoinedAssociations,
161
+ DB,
162
+ // namespace columns for the root table
163
+ AssociationNameToDotReferencedColumns<DB, RootTableName & keyof DB, RootTableAlias>
164
+ >
165
+ type JoinedAssociationColumnNames<
166
+ JoinedAssociations extends Readonly<JoinedAssociation[]>,
167
+ DB,
168
+ AllColumnNames,
169
+ Depth extends number = 0,
170
+ CurrentJoinedAssociation = Readonly<JoinedAssociations[0]>,
171
+ NextTableName = CurrentJoinedAssociation extends Readonly<JoinedAssociation>
172
+ ? CurrentJoinedAssociation['table']
173
+ : never,
174
+ NextAssociationName = CurrentJoinedAssociation extends Readonly<JoinedAssociation>
175
+ ? CurrentJoinedAssociation['alias']
176
+ : never,
177
+ > = JoinedAssociations['length'] extends 0
178
+ ? AllColumnNames
179
+ : Depth extends MAX_JOINED_TABLES_DEPTH
180
+ ? AllColumnNames
181
+ : JoinedAssociationColumnNames<
182
+ ReadonlyTail<JoinedAssociations>,
183
+ DB,
184
+ | AllColumnNames
185
+ | AssociationNameToDotReferencedColumns<DB, NextTableName & keyof DB, NextAssociationName>,
186
+ Inc<Depth>
187
+ >
188
+
189
+ export type WhereStatement<
190
+ DB,
191
+ Schema,
192
+ TableName extends AssociationTableNames<DB, Schema> & keyof DB,
193
+ > = Partial<MergeUnionOfRecordTypes<Updateable<DB[TableName]> | DreamSelectable<DB, Schema, TableName>>>
194
+
195
+ export type OnStatementForAssociation<
196
+ DB,
197
+ Schema,
198
+ TableName extends AssociationTableNames<DB, Schema> & keyof DB,
199
+ RequiredOnClauseKeysForThisAssociation,
200
+ OnStatement extends WhereStatement<DB, Schema, TableName> = WhereStatement<DB, Schema, TableName>,
201
+ > = RequiredOnClauseKeysForThisAssociation extends null
202
+ ? WhereStatement<DB, Schema, TableName>
203
+ : RequiredOnClauseKeysForThisAssociation extends string[]
204
+ ? Required<Pick<OnStatement, RequiredOnClauseKeysForThisAssociation[number] & keyof OnStatement>> &
205
+ Partial<Omit<OnStatement, RequiredOnClauseKeysForThisAssociation[number] & keyof OnStatement>>
206
+ : never
207
+ // on statement on an association definition
208
+ type OnStatementForAssociationDefinition<
209
+ DB,
210
+ Schema,
211
+ TableName extends AssociationTableNames<DB, Schema> & keyof DB,
212
+ > = Partial<
213
+ MergeUnionOfRecordTypes<
214
+ | Updateable<DB[TableName]>
215
+ | Partial<{
216
+ [ColumnName in keyof DB[TableName]]:
217
+ | NonKyselySupportedSupplementalWhereClauseValues<DB, Schema, TableName, ColumnName>
218
+ | typeof DreamConst.passthrough
219
+ | typeof DreamConst.required
220
+ }>
221
+ >
222
+ >
223
+
224
+ export type SelfOnStatement<
225
+ BaseInstance extends Dream,
226
+ DB,
227
+ Schema,
228
+ TableName extends AssociationTableNames<DB, Schema> & keyof DB,
229
+ > = Partial<Record<keyof DB[TableName], DreamColumnNames<BaseInstance>>>
230
+
231
+ export type WhereStatementForJoinedAssociation<
232
+ JoinedAssociations extends Readonly<JoinedAssociation[]>,
233
+ DB,
234
+ Schema,
235
+ TableName extends AssociationTableNames<DB, Schema> & keyof DB,
236
+ > = RecursiveWhereStatementForJoinedAssociation<
237
+ JoinedAssociations,
238
+ DB,
239
+ Schema,
240
+ WhereStatement<DB, Schema, TableName>
241
+ >
242
+ type RecursiveWhereStatementForJoinedAssociation<
243
+ JoinedAssociations extends Readonly<JoinedAssociation[]>,
244
+ DB,
245
+ Schema,
246
+ OriginalOnStatement,
247
+ Depth extends number = 0,
248
+ CurrentJoinedAssociation = JoinedAssociations[0],
249
+ TableName = CurrentJoinedAssociation extends JoinedAssociation ? CurrentJoinedAssociation['table'] : never,
250
+ AssociationName = CurrentJoinedAssociation extends JoinedAssociation
251
+ ? CurrentJoinedAssociation['alias']
252
+ : never,
253
+ NonNamespacedAssociationOnStatement = TableName extends never
254
+ ? never
255
+ : AssociationName extends never
256
+ ? never
257
+ : WhereStatement<DB, Schema, TableName & AssociationTableNames<DB, Schema> & keyof DB>,
258
+ NextOnStatement = NonNamespacedAssociationOnStatement extends never
259
+ ? OriginalOnStatement
260
+ : OriginalOnStatement & {
261
+ [K in keyof NonNamespacedAssociationOnStatement as `${AssociationName & string}.${K & string}`]: NonNamespacedAssociationOnStatement[K &
262
+ keyof NonNamespacedAssociationOnStatement]
263
+ },
264
+ > = JoinedAssociations['length'] extends 0
265
+ ? OriginalOnStatement
266
+ : Depth extends MAX_JOINED_TABLES_DEPTH
267
+ ? OriginalOnStatement
268
+ : TableName extends never
269
+ ? OriginalOnStatement
270
+ : RecursiveWhereStatementForJoinedAssociation<
271
+ ReadonlyTail<JoinedAssociations>,
272
+ DB,
273
+ Schema,
274
+ NextOnStatement,
275
+ Inc<Depth>
276
+ >
277
+
278
+ export type OrderStatement<DB, Schema, TableName extends AssociationTableNames<DB, Schema> & keyof DB> =
279
+ | TableColumnNames<DB, TableName>
280
+ | Partial<Record<TableColumnNames<DB, TableName>, OrderDir>>
281
+
282
+ export type LimitStatement = number
283
+ export type OffsetStatement = number
284
+
285
+ export type OrderQueryStatement<ColumnType> = {
286
+ column: ColumnType & string
287
+ direction: OrderDir
288
+ }
289
+
290
+ export interface HasStatement<
291
+ BaseInstance extends Dream,
292
+ DB,
293
+ Schema,
294
+ ForeignTableName extends AssociationTableNames<DB, Schema> & keyof DB,
295
+ HasType extends 'HasOne' | 'HasMany',
296
+ > {
297
+ modelCB: () => typeof Dream
298
+ as: string
299
+ dependent?: DependentOptions
300
+ foreignKey: () => keyof DB[ForeignTableName] & string
301
+ foreignKeyTypeField: () => keyof DB[ForeignTableName] & string
302
+ globalAssociationNameOrNames: string[]
303
+ on?: OnStatementForAssociationDefinition<DB, Schema, ForeignTableName>
304
+ notOn?: WhereStatement<DB, Schema, ForeignTableName>
305
+ onAny?: WhereStatement<DB, Schema, ForeignTableName>[]
306
+ // ATTENTION
307
+ //
308
+ // Using `order` with HasOne is tempting as an elegant API
309
+ // (e.g. a `currentXyz` variant of a `currentXyzs` HasMany
310
+ // association by ordering on `createdAt`); however, it
311
+ // creates a fundamental problem when querying through the
312
+ // HasMany association: we can't `limit(1)` as part of the
313
+ // query because multiple records may match the HasMany
314
+ // association, each of which may HaveOne of the subsequent
315
+ // association
316
+ polymorphic: boolean
317
+ preloadThroughColumns?: string[] | Record<string, string>
318
+ primaryKey: (associationInstance?: Dream) => DreamColumnNames<BaseInstance>
319
+ primaryKeyOverride?: DreamColumnNames<BaseInstance> | null
320
+ primaryKeyValue: (associationInstance: Dream) => any
321
+ selfOn?: SelfOnStatement<BaseInstance, DB, Schema, ForeignTableName>
322
+ selfNotOn?: SelfOnStatement<BaseInstance, DB, Schema, ForeignTableName>
323
+ source: string
324
+ through?: string
325
+ type: HasType
326
+ withoutDefaultScopes?: DefaultScopeName<BaseInstance>[]
327
+ }
328
+ interface HasOptionsBase<
329
+ BaseInstance extends Dream,
330
+ AssociationGlobalName extends keyof GlobalModelNameTableMap<BaseInstance>,
331
+ AssociationTableName = TableNameForGlobalModelName<
332
+ BaseInstance,
333
+ AssociationGlobalName & keyof GlobalModelNameTableMap<BaseInstance>
334
+ >,
335
+ > {
336
+ dependent?: DependentOptions
337
+ foreignKey?: TableColumnNames<BaseInstance['DB'], AssociationTableName & keyof BaseInstance['DB']>
338
+
339
+ on?: OnStatementForAssociationDefinition<
340
+ BaseInstance['DB'],
341
+ BaseInstance['schema'],
342
+ AssociationTableName &
343
+ AssociationTableNames<BaseInstance['DB'], BaseInstance['schema']> &
344
+ keyof BaseInstance['DB']
345
+ >
346
+
347
+ notOn?: WhereStatement<
348
+ BaseInstance['DB'],
349
+ BaseInstance['schema'],
350
+ AssociationTableName &
351
+ AssociationTableNames<BaseInstance['DB'], BaseInstance['schema']> &
352
+ keyof BaseInstance['DB']
353
+ >
354
+
355
+ onAny?: WhereStatement<
356
+ BaseInstance['DB'],
357
+ BaseInstance['schema'],
358
+ AssociationTableName &
359
+ AssociationTableNames<BaseInstance['DB'], BaseInstance['schema']> &
360
+ keyof BaseInstance['DB']
361
+ >[]
362
+
363
+ polymorphic?: boolean
364
+ preloadThroughColumns?: string[] | Record<string, string>
365
+ primaryKeyOverride?: DreamColumnNames<BaseInstance> | null
366
+
367
+ selfOn?: SelfOnStatement<
368
+ BaseInstance,
369
+ BaseInstance['DB'],
370
+ BaseInstance['schema'],
371
+ AssociationTableName &
372
+ AssociationTableNames<BaseInstance['DB'], BaseInstance['schema']> &
373
+ keyof BaseInstance['DB']
374
+ >
375
+
376
+ selfNotOn?: SelfOnStatement<
377
+ BaseInstance,
378
+ BaseInstance['DB'],
379
+ BaseInstance['schema'],
380
+ AssociationTableName &
381
+ AssociationTableNames<BaseInstance['DB'], BaseInstance['schema']> &
382
+ keyof BaseInstance['DB']
383
+ >
384
+
385
+ source?: string
386
+ through?: keyof BaseInstance['schema'][BaseInstance['table']]['associations']
387
+
388
+ withoutDefaultScopes?: DefaultScopeNameForTable<
389
+ BaseInstance['schema'],
390
+ AssociationTableName & keyof BaseInstance['DB']
391
+ >[]
392
+ }
393
+
394
+ export type PolymorphicOption = 'polymorphic'
395
+ export type ForeignKeyOption = 'foreignKey'
396
+ type ThroughIncompatibleOptions =
397
+ | 'dependent'
398
+ | 'primaryKeyOverride'
399
+ | 'withoutDefaultScopes'
400
+ | ForeignKeyOption
401
+ | PolymorphicOption
402
+ type ThroughOnlyOptions = 'through' | 'source' | 'preloadThroughColumns'
403
+
404
+ export type HasOptions<
405
+ BaseInstance extends Dream,
406
+ AssociationGlobalName extends keyof GlobalModelNameTableMap<BaseInstance>,
407
+ > = Omit<HasOptionsBase<BaseInstance, AssociationGlobalName>, ThroughOnlyOptions | PolymorphicOption>
408
+
409
+ export type PolymorphicHasOptions<
410
+ BaseInstance extends Dream,
411
+ AssociationGlobalName extends keyof GlobalModelNameTableMap<BaseInstance>,
412
+ > = HasOptionsBase<BaseInstance, AssociationGlobalName> &
413
+ Required<Pick<HasOptionsBase<BaseInstance, AssociationGlobalName>, PolymorphicOption | ForeignKeyOption>>
414
+
415
+ export type HasThroughOptions<
416
+ BaseInstance extends Dream,
417
+ AssociationGlobalName extends keyof GlobalModelNameTableMap<BaseInstance>,
418
+ > = Omit<HasOptionsBase<BaseInstance, AssociationGlobalName>, ThroughIncompatibleOptions>
419
+
420
+ export interface AssociationStatementsMap {
421
+ belongsTo: readonly BelongsToStatement<any, any, any, any>[] | BelongsToStatement<any, any, any, any>[]
422
+ hasMany: readonly HasManyStatement<any, any, any, any>[] | HasManyStatement<any, any, any, any>[]
423
+ hasOne: readonly HasOneStatement<any, any, any, any>[] | HasOneStatement<any, any, any, any>[]
424
+ }
425
+
426
+ export type DependentOptions = 'destroy'
427
+ type partialTypeFields =
428
+ | 'modelCB'
429
+ | 'type'
430
+ | 'polymorphic'
431
+ | 'as'
432
+ | 'primaryKey'
433
+ | 'primaryKeyValue'
434
+ | 'primaryKeyOverride'
435
+ type hasOneManySpecificFields =
436
+ | 'source'
437
+ | 'through'
438
+ | 'preloadThroughColumns'
439
+ | 'on'
440
+ | 'notOn'
441
+ | 'selfOn'
442
+ | 'selfNotOn'
443
+ type belongsToSpecificFields = 'optional'
444
+
445
+ export type PartialAssociationStatement =
446
+ | Pick<HasManyStatement<any, any, any, any>, partialTypeFields | hasOneManySpecificFields>
447
+ | Pick<HasOneStatement<any, any, any, any>, partialTypeFields | hasOneManySpecificFields>
448
+ | Pick<BelongsToStatement<any, any, any, any>, partialTypeFields | belongsToSpecificFields>
449
+
450
+ export type AssociationStatement =
451
+ | HasManyStatement<any, any, any, any>
452
+ | HasOneStatement<any, any, any, any>
453
+ | BelongsToStatement<any, any, any, any>
@@ -0,0 +1,14 @@
1
+ import { postgresDatatypes } from '../db/dataTypes.ts'
2
+
3
+ export type DbConnectionType = 'primary' | 'replica'
4
+
5
+ export type AssociationTableNames<DB, Schema> = keyof DB & keyof Schema extends never
6
+ ? unknown
7
+ : keyof DB & keyof Schema & string
8
+ export type Tables<DB> = keyof DB
9
+ export type TableInterfaces<DB> = valueof<DB>
10
+
11
+ type valueof<T> = T[keyof T]
12
+
13
+ export type NonArrayDbTypes = (typeof postgresDatatypes)[number]
14
+ export type DbTypes = NonArrayDbTypes | `${NonArrayDbTypes}[]`