@lakutata/orm 0.0.0-stage → 3.0.0-beta.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 (209) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +463 -2
  3. package/THIRD_PARTY_NOTICES.md +36 -0
  4. package/dist/cjs/components/Database.d.ts +333 -0
  5. package/dist/cjs/components/Database.js +381 -0
  6. package/dist/cjs/decorators/orm/AfterInsert.d.ts +1 -0
  7. package/dist/cjs/decorators/orm/AfterInsert.js +5 -0
  8. package/dist/cjs/decorators/orm/AfterLoad.d.ts +1 -0
  9. package/dist/cjs/decorators/orm/AfterLoad.js +5 -0
  10. package/dist/cjs/decorators/orm/AfterRecover.d.ts +1 -0
  11. package/dist/cjs/decorators/orm/AfterRecover.js +5 -0
  12. package/dist/cjs/decorators/orm/AfterRemove.d.ts +1 -0
  13. package/dist/cjs/decorators/orm/AfterRemove.js +5 -0
  14. package/dist/cjs/decorators/orm/AfterSoftRemove.d.ts +1 -0
  15. package/dist/cjs/decorators/orm/AfterSoftRemove.js +5 -0
  16. package/dist/cjs/decorators/orm/AfterUpdate.d.ts +1 -0
  17. package/dist/cjs/decorators/orm/AfterUpdate.js +5 -0
  18. package/dist/cjs/decorators/orm/BeforeInsert.d.ts +1 -0
  19. package/dist/cjs/decorators/orm/BeforeInsert.js +5 -0
  20. package/dist/cjs/decorators/orm/BeforeRecover.d.ts +1 -0
  21. package/dist/cjs/decorators/orm/BeforeRecover.js +5 -0
  22. package/dist/cjs/decorators/orm/BeforeRemove.d.ts +1 -0
  23. package/dist/cjs/decorators/orm/BeforeRemove.js +5 -0
  24. package/dist/cjs/decorators/orm/BeforeSoftRemove.d.ts +1 -0
  25. package/dist/cjs/decorators/orm/BeforeSoftRemove.js +5 -0
  26. package/dist/cjs/decorators/orm/BeforeUpdate.d.ts +1 -0
  27. package/dist/cjs/decorators/orm/BeforeUpdate.js +5 -0
  28. package/dist/cjs/decorators/orm/Check.d.ts +1 -0
  29. package/dist/cjs/decorators/orm/Check.js +5 -0
  30. package/dist/cjs/decorators/orm/ChildEntity.d.ts +1 -0
  31. package/dist/cjs/decorators/orm/ChildEntity.js +5 -0
  32. package/dist/cjs/decorators/orm/Column.d.ts +1 -0
  33. package/dist/cjs/decorators/orm/Column.js +5 -0
  34. package/dist/cjs/decorators/orm/CreateDateColumn.d.ts +1 -0
  35. package/dist/cjs/decorators/orm/CreateDateColumn.js +5 -0
  36. package/dist/cjs/decorators/orm/DeleteDateColumn.d.ts +1 -0
  37. package/dist/cjs/decorators/orm/DeleteDateColumn.js +5 -0
  38. package/dist/cjs/decorators/orm/Entity.d.ts +1 -0
  39. package/dist/cjs/decorators/orm/Entity.js +5 -0
  40. package/dist/cjs/decorators/orm/EventSubscriber.d.ts +1 -0
  41. package/dist/cjs/decorators/orm/EventSubscriber.js +5 -0
  42. package/dist/cjs/decorators/orm/Exclusion.d.ts +1 -0
  43. package/dist/cjs/decorators/orm/Exclusion.js +5 -0
  44. package/dist/cjs/decorators/orm/Generated.d.ts +1 -0
  45. package/dist/cjs/decorators/orm/Generated.js +5 -0
  46. package/dist/cjs/decorators/orm/Index.d.ts +1 -0
  47. package/dist/cjs/decorators/orm/Index.js +5 -0
  48. package/dist/cjs/decorators/orm/JoinColumn.d.ts +1 -0
  49. package/dist/cjs/decorators/orm/JoinColumn.js +5 -0
  50. package/dist/cjs/decorators/orm/JoinTable.d.ts +1 -0
  51. package/dist/cjs/decorators/orm/JoinTable.js +5 -0
  52. package/dist/cjs/decorators/orm/ManyToMany.d.ts +1 -0
  53. package/dist/cjs/decorators/orm/ManyToMany.js +5 -0
  54. package/dist/cjs/decorators/orm/ManyToOne.d.ts +1 -0
  55. package/dist/cjs/decorators/orm/ManyToOne.js +5 -0
  56. package/dist/cjs/decorators/orm/ObjectIdColumn.d.ts +1 -0
  57. package/dist/cjs/decorators/orm/ObjectIdColumn.js +5 -0
  58. package/dist/cjs/decorators/orm/OneToMany.d.ts +1 -0
  59. package/dist/cjs/decorators/orm/OneToMany.js +5 -0
  60. package/dist/cjs/decorators/orm/OneToOne.d.ts +1 -0
  61. package/dist/cjs/decorators/orm/OneToOne.js +5 -0
  62. package/dist/cjs/decorators/orm/PrimaryColumn.d.ts +1 -0
  63. package/dist/cjs/decorators/orm/PrimaryColumn.js +5 -0
  64. package/dist/cjs/decorators/orm/PrimaryGeneratedColumn.d.ts +1 -0
  65. package/dist/cjs/decorators/orm/PrimaryGeneratedColumn.js +5 -0
  66. package/dist/cjs/decorators/orm/RelationId.d.ts +1 -0
  67. package/dist/cjs/decorators/orm/RelationId.js +5 -0
  68. package/dist/cjs/decorators/orm/TableInheritance.d.ts +1 -0
  69. package/dist/cjs/decorators/orm/TableInheritance.js +5 -0
  70. package/dist/cjs/decorators/orm/Tree.d.ts +1 -0
  71. package/dist/cjs/decorators/orm/Tree.js +5 -0
  72. package/dist/cjs/decorators/orm/TreeChildren.d.ts +1 -0
  73. package/dist/cjs/decorators/orm/TreeChildren.js +5 -0
  74. package/dist/cjs/decorators/orm/TreeLevelColumn.d.ts +1 -0
  75. package/dist/cjs/decorators/orm/TreeLevelColumn.js +5 -0
  76. package/dist/cjs/decorators/orm/TreeParent.d.ts +1 -0
  77. package/dist/cjs/decorators/orm/TreeParent.js +5 -0
  78. package/dist/cjs/decorators/orm/Unique.d.ts +1 -0
  79. package/dist/cjs/decorators/orm/Unique.js +5 -0
  80. package/dist/cjs/decorators/orm/UpdateDateColumn.d.ts +1 -0
  81. package/dist/cjs/decorators/orm/UpdateDateColumn.js +5 -0
  82. package/dist/cjs/decorators/orm/VersionColumn.d.ts +1 -0
  83. package/dist/cjs/decorators/orm/VersionColumn.js +5 -0
  84. package/dist/cjs/decorators/orm/ViewColumn.d.ts +1 -0
  85. package/dist/cjs/decorators/orm/ViewColumn.js +5 -0
  86. package/dist/cjs/decorators/orm/ViewEntity.d.ts +1 -0
  87. package/dist/cjs/decorators/orm/ViewEntity.js +5 -0
  88. package/dist/cjs/decorators/orm/VirtualColumn.d.ts +1 -0
  89. package/dist/cjs/decorators/orm/VirtualColumn.js +5 -0
  90. package/dist/cjs/exports/DatabaseComponent.d.ts +3 -0
  91. package/dist/cjs/exports/DatabaseComponent.js +21 -0
  92. package/dist/cjs/exports/DatabaseProvider.d.ts +3 -0
  93. package/dist/cjs/exports/DatabaseProvider.js +21 -0
  94. package/dist/cjs/exports/ORM.d.ts +193 -0
  95. package/dist/cjs/exports/ORM.js +166 -0
  96. package/dist/cjs/exports/ORMDecorators.d.ts +43 -0
  97. package/dist/cjs/exports/ORMDecorators.js +91 -0
  98. package/dist/cjs/package.json +1 -0
  99. package/dist/cjs/providers/Database.d.ts +326 -0
  100. package/dist/cjs/providers/Database.js +376 -0
  101. package/dist/cjs/providers/migration/ExecuteMigration.d.ts +40 -0
  102. package/dist/cjs/providers/migration/ExecuteMigration.js +143 -0
  103. package/dist/cjs/providers/migration/GenerateMigration.d.ts +59 -0
  104. package/dist/cjs/providers/migration/GenerateMigration.js +303 -0
  105. package/dist/cjs/types/MigrationRunOptions.d.ts +19 -0
  106. package/dist/cjs/types/MigrationRunOptions.js +2 -0
  107. package/dist/esm/components/Database.js +344 -0
  108. package/dist/esm/decorators/orm/AfterInsert.js +1 -0
  109. package/dist/esm/decorators/orm/AfterLoad.js +1 -0
  110. package/dist/esm/decorators/orm/AfterRecover.js +1 -0
  111. package/dist/esm/decorators/orm/AfterRemove.js +1 -0
  112. package/dist/esm/decorators/orm/AfterSoftRemove.js +1 -0
  113. package/dist/esm/decorators/orm/AfterUpdate.js +1 -0
  114. package/dist/esm/decorators/orm/BeforeInsert.js +1 -0
  115. package/dist/esm/decorators/orm/BeforeRecover.js +1 -0
  116. package/dist/esm/decorators/orm/BeforeRemove.js +1 -0
  117. package/dist/esm/decorators/orm/BeforeSoftRemove.js +1 -0
  118. package/dist/esm/decorators/orm/BeforeUpdate.js +1 -0
  119. package/dist/esm/decorators/orm/Check.js +1 -0
  120. package/dist/esm/decorators/orm/ChildEntity.js +1 -0
  121. package/dist/esm/decorators/orm/Column.js +1 -0
  122. package/dist/esm/decorators/orm/CreateDateColumn.js +1 -0
  123. package/dist/esm/decorators/orm/DeleteDateColumn.js +1 -0
  124. package/dist/esm/decorators/orm/Entity.js +1 -0
  125. package/dist/esm/decorators/orm/EventSubscriber.js +1 -0
  126. package/dist/esm/decorators/orm/Exclusion.js +1 -0
  127. package/dist/esm/decorators/orm/Generated.js +1 -0
  128. package/dist/esm/decorators/orm/Index.js +1 -0
  129. package/dist/esm/decorators/orm/JoinColumn.js +1 -0
  130. package/dist/esm/decorators/orm/JoinTable.js +1 -0
  131. package/dist/esm/decorators/orm/ManyToMany.js +1 -0
  132. package/dist/esm/decorators/orm/ManyToOne.js +1 -0
  133. package/dist/esm/decorators/orm/ObjectIdColumn.js +1 -0
  134. package/dist/esm/decorators/orm/OneToMany.js +1 -0
  135. package/dist/esm/decorators/orm/OneToOne.js +1 -0
  136. package/dist/esm/decorators/orm/PrimaryColumn.js +1 -0
  137. package/dist/esm/decorators/orm/PrimaryGeneratedColumn.js +1 -0
  138. package/dist/esm/decorators/orm/RelationId.js +1 -0
  139. package/dist/esm/decorators/orm/TableInheritance.js +1 -0
  140. package/dist/esm/decorators/orm/Tree.js +1 -0
  141. package/dist/esm/decorators/orm/TreeChildren.js +1 -0
  142. package/dist/esm/decorators/orm/TreeLevelColumn.js +1 -0
  143. package/dist/esm/decorators/orm/TreeParent.js +1 -0
  144. package/dist/esm/decorators/orm/Unique.js +1 -0
  145. package/dist/esm/decorators/orm/UpdateDateColumn.js +1 -0
  146. package/dist/esm/decorators/orm/VersionColumn.js +1 -0
  147. package/dist/esm/decorators/orm/ViewColumn.js +1 -0
  148. package/dist/esm/decorators/orm/ViewEntity.js +1 -0
  149. package/dist/esm/decorators/orm/VirtualColumn.js +1 -0
  150. package/dist/esm/exports/DatabaseComponent.js +2 -0
  151. package/dist/esm/exports/DatabaseProvider.js +2 -0
  152. package/dist/esm/exports/ORM.js +120 -0
  153. package/dist/esm/exports/ORMDecorators.js +43 -0
  154. package/dist/esm/providers/Database.js +339 -0
  155. package/dist/esm/providers/migration/ExecuteMigration.js +137 -0
  156. package/dist/esm/providers/migration/GenerateMigration.js +297 -0
  157. package/dist/esm/types/MigrationRunOptions.js +1 -0
  158. package/dist/types/components/Database.d.ts +333 -0
  159. package/dist/types/decorators/orm/AfterInsert.d.ts +1 -0
  160. package/dist/types/decorators/orm/AfterLoad.d.ts +1 -0
  161. package/dist/types/decorators/orm/AfterRecover.d.ts +1 -0
  162. package/dist/types/decorators/orm/AfterRemove.d.ts +1 -0
  163. package/dist/types/decorators/orm/AfterSoftRemove.d.ts +1 -0
  164. package/dist/types/decorators/orm/AfterUpdate.d.ts +1 -0
  165. package/dist/types/decorators/orm/BeforeInsert.d.ts +1 -0
  166. package/dist/types/decorators/orm/BeforeRecover.d.ts +1 -0
  167. package/dist/types/decorators/orm/BeforeRemove.d.ts +1 -0
  168. package/dist/types/decorators/orm/BeforeSoftRemove.d.ts +1 -0
  169. package/dist/types/decorators/orm/BeforeUpdate.d.ts +1 -0
  170. package/dist/types/decorators/orm/Check.d.ts +1 -0
  171. package/dist/types/decorators/orm/ChildEntity.d.ts +1 -0
  172. package/dist/types/decorators/orm/Column.d.ts +1 -0
  173. package/dist/types/decorators/orm/CreateDateColumn.d.ts +1 -0
  174. package/dist/types/decorators/orm/DeleteDateColumn.d.ts +1 -0
  175. package/dist/types/decorators/orm/Entity.d.ts +1 -0
  176. package/dist/types/decorators/orm/EventSubscriber.d.ts +1 -0
  177. package/dist/types/decorators/orm/Exclusion.d.ts +1 -0
  178. package/dist/types/decorators/orm/Generated.d.ts +1 -0
  179. package/dist/types/decorators/orm/Index.d.ts +1 -0
  180. package/dist/types/decorators/orm/JoinColumn.d.ts +1 -0
  181. package/dist/types/decorators/orm/JoinTable.d.ts +1 -0
  182. package/dist/types/decorators/orm/ManyToMany.d.ts +1 -0
  183. package/dist/types/decorators/orm/ManyToOne.d.ts +1 -0
  184. package/dist/types/decorators/orm/ObjectIdColumn.d.ts +1 -0
  185. package/dist/types/decorators/orm/OneToMany.d.ts +1 -0
  186. package/dist/types/decorators/orm/OneToOne.d.ts +1 -0
  187. package/dist/types/decorators/orm/PrimaryColumn.d.ts +1 -0
  188. package/dist/types/decorators/orm/PrimaryGeneratedColumn.d.ts +1 -0
  189. package/dist/types/decorators/orm/RelationId.d.ts +1 -0
  190. package/dist/types/decorators/orm/TableInheritance.d.ts +1 -0
  191. package/dist/types/decorators/orm/Tree.d.ts +1 -0
  192. package/dist/types/decorators/orm/TreeChildren.d.ts +1 -0
  193. package/dist/types/decorators/orm/TreeLevelColumn.d.ts +1 -0
  194. package/dist/types/decorators/orm/TreeParent.d.ts +1 -0
  195. package/dist/types/decorators/orm/Unique.d.ts +1 -0
  196. package/dist/types/decorators/orm/UpdateDateColumn.d.ts +1 -0
  197. package/dist/types/decorators/orm/VersionColumn.d.ts +1 -0
  198. package/dist/types/decorators/orm/ViewColumn.d.ts +1 -0
  199. package/dist/types/decorators/orm/ViewEntity.d.ts +1 -0
  200. package/dist/types/decorators/orm/VirtualColumn.d.ts +1 -0
  201. package/dist/types/exports/DatabaseComponent.d.ts +3 -0
  202. package/dist/types/exports/DatabaseProvider.d.ts +3 -0
  203. package/dist/types/exports/ORM.d.ts +193 -0
  204. package/dist/types/exports/ORMDecorators.d.ts +43 -0
  205. package/dist/types/providers/Database.d.ts +326 -0
  206. package/dist/types/providers/migration/ExecuteMigration.d.ts +40 -0
  207. package/dist/types/providers/migration/GenerateMigration.d.ts +59 -0
  208. package/dist/types/types/MigrationRunOptions.d.ts +19 -0
  209. package/package.json +81 -4
@@ -0,0 +1 @@
1
+ export { AfterUpdate } from 'typeorm/decorator/listeners/AfterUpdate.js';
@@ -0,0 +1 @@
1
+ export { BeforeInsert } from 'typeorm/decorator/listeners/BeforeInsert.js';
@@ -0,0 +1 @@
1
+ export { BeforeRecover } from 'typeorm/decorator/listeners/BeforeRecover.js';
@@ -0,0 +1 @@
1
+ export { BeforeRemove } from 'typeorm/decorator/listeners/BeforeRemove.js';
@@ -0,0 +1 @@
1
+ export { BeforeSoftRemove } from 'typeorm/decorator/listeners/BeforeSoftRemove.js';
@@ -0,0 +1 @@
1
+ export { BeforeUpdate } from 'typeorm/decorator/listeners/BeforeUpdate.js';
@@ -0,0 +1 @@
1
+ export { Check } from 'typeorm/decorator/Check.js';
@@ -0,0 +1 @@
1
+ export { ChildEntity } from 'typeorm/decorator/entity/ChildEntity.js';
@@ -0,0 +1 @@
1
+ export { Column } from 'typeorm/decorator/columns/Column.js';
@@ -0,0 +1 @@
1
+ export { CreateDateColumn } from 'typeorm/decorator/columns/CreateDateColumn.js';
@@ -0,0 +1 @@
1
+ export { DeleteDateColumn } from 'typeorm/decorator/columns/DeleteDateColumn.js';
@@ -0,0 +1 @@
1
+ export { Entity } from 'typeorm/decorator/entity/Entity.js';
@@ -0,0 +1 @@
1
+ export { EventSubscriber } from 'typeorm/decorator/listeners/EventSubscriber.js';
@@ -0,0 +1 @@
1
+ export { Exclusion } from 'typeorm/decorator/Exclusion.js';
@@ -0,0 +1 @@
1
+ export { Generated } from 'typeorm/decorator/Generated.js';
@@ -0,0 +1 @@
1
+ export { Index } from 'typeorm/decorator/Index.js';
@@ -0,0 +1 @@
1
+ export { JoinColumn } from 'typeorm/decorator/relations/JoinColumn.js';
@@ -0,0 +1 @@
1
+ export { JoinTable } from 'typeorm/decorator/relations/JoinTable.js';
@@ -0,0 +1 @@
1
+ export { ManyToMany } from 'typeorm/decorator/relations/ManyToMany.js';
@@ -0,0 +1 @@
1
+ export { ManyToOne } from 'typeorm/decorator/relations/ManyToOne.js';
@@ -0,0 +1 @@
1
+ export { ObjectIdColumn } from 'typeorm/decorator/columns/ObjectIdColumn.js';
@@ -0,0 +1 @@
1
+ export { OneToMany } from 'typeorm/decorator/relations/OneToMany.js';
@@ -0,0 +1 @@
1
+ export { OneToOne } from 'typeorm/decorator/relations/OneToOne.js';
@@ -0,0 +1 @@
1
+ export { PrimaryColumn } from 'typeorm/decorator/columns/PrimaryColumn.js';
@@ -0,0 +1 @@
1
+ export { PrimaryGeneratedColumn } from 'typeorm/decorator/columns/PrimaryGeneratedColumn.js';
@@ -0,0 +1 @@
1
+ export { RelationId } from 'typeorm/decorator/relations/RelationId.js';
@@ -0,0 +1 @@
1
+ export { TableInheritance } from 'typeorm/decorator/entity/TableInheritance.js';
@@ -0,0 +1 @@
1
+ export { Tree } from 'typeorm/decorator/tree/Tree.js';
@@ -0,0 +1 @@
1
+ export { TreeChildren } from 'typeorm/decorator/tree/TreeChildren.js';
@@ -0,0 +1 @@
1
+ export { TreeLevelColumn } from 'typeorm/decorator/tree/TreeLevelColumn.js';
@@ -0,0 +1 @@
1
+ export { TreeParent } from 'typeorm/decorator/tree/TreeParent.js';
@@ -0,0 +1 @@
1
+ export { Unique } from 'typeorm/decorator/Unique.js';
@@ -0,0 +1 @@
1
+ export { UpdateDateColumn } from 'typeorm/decorator/columns/UpdateDateColumn.js';
@@ -0,0 +1 @@
1
+ export { VersionColumn } from 'typeorm/decorator/columns/VersionColumn.js';
@@ -0,0 +1 @@
1
+ export { ViewColumn } from 'typeorm/decorator/columns/ViewColumn.js';
@@ -0,0 +1 @@
1
+ export { ViewEntity } from 'typeorm/decorator/entity-view/ViewEntity.js';
@@ -0,0 +1 @@
1
+ export { VirtualColumn } from 'typeorm/decorator/columns/VirtualColumn.js';
@@ -0,0 +1,2 @@
1
+ import 'reflect-metadata';
2
+ export * from '../components/Database.js';
@@ -0,0 +1,2 @@
1
+ import 'reflect-metadata';
2
+ export * from '../providers/Database.js';
@@ -0,0 +1,120 @@
1
+ import 'reflect-metadata';
2
+ export * from 'typeorm/globals.js';
3
+ export * from 'typeorm/container.js';
4
+ export * from 'typeorm/common/EntityTarget.js';
5
+ export * from 'typeorm/common/ObjectType.js';
6
+ export * from 'typeorm/common/ObjectLiteral.js';
7
+ export * from 'typeorm/common/MixedList.js';
8
+ export * from 'typeorm/common/DeepPartial.js';
9
+ export * from 'typeorm/common/RelationType.js';
10
+ export * from 'typeorm/error/index.js';
11
+ export * from 'typeorm/decorator/options/ColumnOptions.js';
12
+ export * from 'typeorm/decorator/options/IndexOptions.js';
13
+ export * from 'typeorm/decorator/options/JoinColumnOptions.js';
14
+ export * from 'typeorm/decorator/options/JoinTableOptions.js';
15
+ export * from 'typeorm/decorator/options/RelationOptions.js';
16
+ export * from 'typeorm/decorator/options/EntityOptions.js';
17
+ export * from 'typeorm/decorator/options/ValueTransformer.js';
18
+ export * from 'typeorm/find-options/operator/And.js';
19
+ export * from 'typeorm/find-options/operator/Or.js';
20
+ export * from 'typeorm/find-options/operator/Any.js';
21
+ export * from 'typeorm/find-options/operator/ArrayContainedBy.js';
22
+ export * from 'typeorm/find-options/operator/ArrayContains.js';
23
+ export * from 'typeorm/find-options/operator/ArrayOverlap.js';
24
+ export * from 'typeorm/find-options/operator/Between.js';
25
+ export * from 'typeorm/find-options/operator/Equal.js';
26
+ export * from 'typeorm/find-options/operator/In.js';
27
+ export * from 'typeorm/find-options/operator/IsNull.js';
28
+ export * from 'typeorm/find-options/operator/LessThan.js';
29
+ export * from 'typeorm/find-options/operator/LessThanOrEqual.js';
30
+ export * from 'typeorm/find-options/operator/ILike.js';
31
+ export * from 'typeorm/find-options/operator/Like.js';
32
+ export * from 'typeorm/find-options/operator/MoreThan.js';
33
+ export * from 'typeorm/find-options/operator/MoreThanOrEqual.js';
34
+ export * from 'typeorm/find-options/operator/Not.js';
35
+ export * from 'typeorm/find-options/operator/Raw.js';
36
+ export * from 'typeorm/find-options/operator/JsonContains.js';
37
+ export * from 'typeorm/find-options/EqualOperator.js';
38
+ export * from 'typeorm/find-options/FindManyOptions.js';
39
+ export * from 'typeorm/find-options/FindOneOptions.js';
40
+ export * from 'typeorm/find-options/FindOperator.js';
41
+ export * from 'typeorm/find-options/FindOperatorType.js';
42
+ export * from 'typeorm/find-options/FindOptionsOrder.js';
43
+ export * from 'typeorm/find-options/FindOptionsRelations.js';
44
+ export * from 'typeorm/find-options/FindOptionsSelect.js';
45
+ export * from 'typeorm/find-options/FindOptionsUtils.js';
46
+ export * from 'typeorm/find-options/FindOptionsWhere.js';
47
+ export * from 'typeorm/find-options/FindTreeOptions.js';
48
+ export * from 'typeorm/find-options/JoinOptions.js';
49
+ export * from 'typeorm/find-options/OrderByCondition.js';
50
+ export * from 'typeorm/logger/AbstractLogger.js';
51
+ export * from 'typeorm/logger/Logger.js';
52
+ export * from 'typeorm/logger/LoggerOptions.js';
53
+ export * from 'typeorm/logger/AdvancedConsoleLogger.js';
54
+ export * from 'typeorm/logger/SimpleConsoleLogger.js';
55
+ export * from 'typeorm/logger/FileLogger.js';
56
+ export * from 'typeorm/metadata/EntityMetadata.js';
57
+ export * from 'typeorm/metadata/CheckMetadata.js';
58
+ export * from 'typeorm/metadata/ColumnMetadata.js';
59
+ export * from 'typeorm/metadata/EmbeddedMetadata.js';
60
+ export * from 'typeorm/metadata/EntityListenerMetadata.js';
61
+ export * from 'typeorm/metadata/ExclusionMetadata.js';
62
+ export * from 'typeorm/metadata/ForeignKeyMetadata.js';
63
+ export * from 'typeorm/metadata/IndexMetadata.js';
64
+ export * from 'typeorm/metadata/RelationMetadata.js';
65
+ export * from 'typeorm/metadata/RelationCountMetadata.js';
66
+ export * from 'typeorm/metadata/UniqueMetadata.js';
67
+ export * from 'typeorm/entity-manager/EntityManager.js';
68
+ export * from 'typeorm/repository/AbstractRepository.js';
69
+ export * from 'typeorm/repository/Repository.js';
70
+ export * from 'typeorm/repository/BaseEntity.js';
71
+ export * from 'typeorm/repository/TreeRepository.js';
72
+ export * from 'typeorm/repository/MongoRepository.js';
73
+ export * from 'typeorm/repository/RemoveOptions.js';
74
+ export * from 'typeorm/repository/SaveOptions.js';
75
+ export * from 'typeorm/schema-builder/table/TableCheck.js';
76
+ export * from 'typeorm/schema-builder/table/TableColumn.js';
77
+ export * from 'typeorm/schema-builder/table/TableExclusion.js';
78
+ export * from 'typeorm/schema-builder/table/TableForeignKey.js';
79
+ export * from 'typeorm/schema-builder/table/TableIndex.js';
80
+ export * from 'typeorm/schema-builder/table/TableUnique.js';
81
+ export * from 'typeorm/schema-builder/table/Table.js';
82
+ export * from 'typeorm/schema-builder/options/TableCheckOptions.js';
83
+ export * from 'typeorm/schema-builder/options/TableColumnOptions.js';
84
+ export * from 'typeorm/schema-builder/options/TableExclusionOptions.js';
85
+ export * from 'typeorm/schema-builder/options/TableForeignKeyOptions.js';
86
+ export * from 'typeorm/schema-builder/options/TableIndexOptions.js';
87
+ export * from 'typeorm/schema-builder/options/TableOptions.js';
88
+ export * from 'typeorm/schema-builder/options/TableUniqueOptions.js';
89
+ export * from 'typeorm/schema-builder/options/ViewOptions.js';
90
+ export * from 'typeorm/driver/mongodb/typings.js';
91
+ export * from 'typeorm/driver/types/DatabaseType.js';
92
+ export * from 'typeorm/driver/types/GeoJsonTypes.js';
93
+ export * from 'typeorm/driver/types/ReplicationMode.js';
94
+ export * from 'typeorm/driver/sqlserver/MssqlParameter.js';
95
+ export { ConnectionOptionsReader } from 'typeorm/connection/ConnectionOptionsReader.js';
96
+ export { DataSource } from 'typeorm/data-source/DataSource.js';
97
+ export { QueryBuilder } from 'typeorm/query-builder/QueryBuilder.js';
98
+ export { SelectQueryBuilder } from 'typeorm/query-builder/SelectQueryBuilder.js';
99
+ export { DeleteQueryBuilder } from 'typeorm/query-builder/DeleteQueryBuilder.js';
100
+ export { InsertQueryBuilder } from 'typeorm/query-builder/InsertQueryBuilder.js';
101
+ export { UpdateQueryBuilder } from 'typeorm/query-builder/UpdateQueryBuilder.js';
102
+ export { RelationQueryBuilder } from 'typeorm/query-builder/RelationQueryBuilder.js';
103
+ export { Brackets } from 'typeorm/query-builder/Brackets.js';
104
+ export { NotBrackets } from 'typeorm/query-builder/NotBrackets.js';
105
+ export { InsertResult } from 'typeorm/query-builder/result/InsertResult.js';
106
+ export { UpdateResult } from 'typeorm/query-builder/result/UpdateResult.js';
107
+ export { DeleteResult } from 'typeorm/query-builder/result/DeleteResult.js';
108
+ export { QueryResult } from 'typeorm/query-runner/QueryResult.js';
109
+ export { MongoEntityManager } from 'typeorm/entity-manager/MongoEntityManager.js';
110
+ export { Migration } from 'typeorm/migration/Migration.js';
111
+ export { MigrationExecutor } from 'typeorm/migration/MigrationExecutor.js';
112
+ export { DefaultNamingStrategy } from 'typeorm/naming-strategy/DefaultNamingStrategy.js';
113
+ export { LegacyOracleNamingStrategy } from 'typeorm/naming-strategy/LegacyOracleNamingStrategy.js';
114
+ export { EntitySchema } from 'typeorm/entity-schema/EntitySchema.js';
115
+ export { EntitySchemaEmbeddedColumnOptions } from 'typeorm/entity-schema/EntitySchemaEmbeddedColumnOptions.js';
116
+ export { EntitySchemaOptions } from 'typeorm/entity-schema/EntitySchemaOptions.js';
117
+ export { InstanceChecker } from 'typeorm/util/InstanceChecker.js';
118
+ export { TreeRepositoryUtils } from 'typeorm/util/TreeRepositoryUtils.js';
119
+ export { getMetadataArgsStorage } from 'typeorm/globals.js';
120
+ export { MetadataArgsStorage } from 'typeorm/metadata-args/MetadataArgsStorage.js';
@@ -0,0 +1,43 @@
1
+ import 'reflect-metadata';
2
+ export { AfterRecover } from '../decorators/orm/AfterRecover.js';
3
+ export { AfterRemove } from '../decorators/orm/AfterRemove.js';
4
+ export { AfterInsert } from '../decorators/orm/AfterInsert.js';
5
+ export { AfterLoad } from '../decorators/orm/AfterLoad.js';
6
+ export { AfterSoftRemove } from '../decorators/orm/AfterSoftRemove.js';
7
+ export { AfterUpdate } from '../decorators/orm/AfterUpdate.js';
8
+ export { BeforeInsert } from '../decorators/orm/BeforeInsert.js';
9
+ export { BeforeRecover } from '../decorators/orm/BeforeRecover.js';
10
+ export { BeforeRemove } from '../decorators/orm/BeforeRemove.js';
11
+ export { BeforeSoftRemove } from '../decorators/orm/BeforeSoftRemove.js';
12
+ export { BeforeUpdate } from '../decorators/orm/BeforeUpdate.js';
13
+ export { Check } from '../decorators/orm/Check.js';
14
+ export { ChildEntity } from '../decorators/orm/ChildEntity.js';
15
+ export { Column } from '../decorators/orm/Column.js';
16
+ export { CreateDateColumn } from '../decorators/orm/CreateDateColumn.js';
17
+ export { DeleteDateColumn } from '../decorators/orm/DeleteDateColumn.js';
18
+ export { Entity } from '../decorators/orm/Entity.js';
19
+ export { EventSubscriber } from '../decorators/orm/EventSubscriber.js';
20
+ export { Exclusion } from '../decorators/orm/Exclusion.js';
21
+ export { Generated } from '../decorators/orm/Generated.js';
22
+ export { Index } from '../decorators/orm/Index.js';
23
+ export { JoinColumn } from '../decorators/orm/JoinColumn.js';
24
+ export { JoinTable } from '../decorators/orm/JoinTable.js';
25
+ export { ManyToMany } from '../decorators/orm/ManyToMany.js';
26
+ export { ManyToOne } from '../decorators/orm/ManyToOne.js';
27
+ export { ObjectIdColumn } from '../decorators/orm/ObjectIdColumn.js';
28
+ export { OneToMany } from '../decorators/orm/OneToMany.js';
29
+ export { OneToOne } from '../decorators/orm/OneToOne.js';
30
+ export { PrimaryColumn } from '../decorators/orm/PrimaryColumn.js';
31
+ export { PrimaryGeneratedColumn } from '../decorators/orm/PrimaryGeneratedColumn.js';
32
+ export { RelationId } from '../decorators/orm/RelationId.js';
33
+ export { TableInheritance } from '../decorators/orm/TableInheritance.js';
34
+ export { Tree } from '../decorators/orm/Tree.js';
35
+ export { TreeChildren } from '../decorators/orm/TreeChildren.js';
36
+ export { TreeLevelColumn } from '../decorators/orm/TreeLevelColumn.js';
37
+ export { TreeParent } from '../decorators/orm/TreeParent.js';
38
+ export { Unique } from '../decorators/orm/Unique.js';
39
+ export { UpdateDateColumn } from '../decorators/orm/UpdateDateColumn.js';
40
+ export { VersionColumn } from '../decorators/orm/VersionColumn.js';
41
+ export { ViewColumn } from '../decorators/orm/ViewColumn.js';
42
+ export { ViewEntity } from '../decorators/orm/ViewEntity.js';
43
+ export { VirtualColumn } from '../decorators/orm/VirtualColumn.js';
@@ -0,0 +1,339 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Configurable, Transient } from '@lakutata/core/decorator/di';
11
+ import { DataSource } from 'typeorm/data-source/DataSource.js';
12
+ import { Provider } from '@lakutata/core';
13
+ import { As } from '@lakutata/utils';
14
+ /**
15
+ * Build the registration of a {@link Database} provider, for the `providers` of the application options: the provider
16
+ * class with its TypeORM connection options. Its `entities` option, added to the entities of the connection options,
17
+ * is set by spreading the registration: `{...buildDatabaseOptions(options), entities: [User]}`.
18
+ * @param options The TypeORM connection options (`DataSourceOptions`): the driver `type`, the connection settings, the
19
+ * `entities`, the `migrations`, `synchronize`, `migrationsRun`, `logging`… Passed to TypeORM as they are.
20
+ * @returns The registration `{class: Database, options}`.
21
+ * @example
22
+ * ```typescript
23
+ * import {Application} from 'lakutata'
24
+ * import {buildDatabaseOptions} from 'lakutata/provider/database'
25
+ * import {Column, Entity, PrimaryGeneratedColumn} from 'lakutata/decorator/orm'
26
+ *
27
+ * @Entity()
28
+ * class Report {
29
+ * @PrimaryGeneratedColumn()
30
+ * public id: number
31
+ *
32
+ * @Column('text')
33
+ * public content: string
34
+ * }
35
+ *
36
+ * Application.run(() => ({
37
+ * id: 'com.example.reports',
38
+ * name: 'Reports',
39
+ * providers: {
40
+ * //A new PostgreSQL connection each time reports is resolved, closed with its owner
41
+ * reports: {
42
+ * ...buildDatabaseOptions({type: 'postgres', url: 'postgres://postgres:secret@localhost:5432/reports'}),
43
+ * entities: [Report]
44
+ * }
45
+ * }
46
+ * }))
47
+ * ```
48
+ */
49
+ export const buildDatabaseOptions = (options) => ({
50
+ class: Database,
51
+ options: options
52
+ });
53
+ /**
54
+ * A database connection of its own: a transient provider wrapping a TypeORM `DataSource`, with the API of the
55
+ * `Database` component of `lakutata/com/database`.
56
+ *
57
+ * Register it in the `providers` of the application options with {@link buildDatabaseOptions}. Each resolution
58
+ * (`@Inject('reports')`, `getObject('reports')`) creates a new instance, even within one scope: it opens its own
59
+ * connection (its own pool) while it is created, and closes it when it is destroyed with the object or the container
60
+ * which created it. It suits a short use (a job, a script, a tenant database); the requests of a busy application
61
+ * share the `Database` component instead. A connection failure rejects its creation with the driver error.
62
+ *
63
+ * The entities of its `entities` option are added to the entities of its connection options.
64
+ * @example
65
+ * ```typescript
66
+ * import {Application} from 'lakutata'
67
+ * import {buildDatabaseOptions, Database} from 'lakutata/provider/database'
68
+ * import {Column, Entity, PrimaryGeneratedColumn} from 'lakutata/decorator/orm'
69
+ *
70
+ * @Entity()
71
+ * class Report {
72
+ * @PrimaryGeneratedColumn()
73
+ * public id: number
74
+ *
75
+ * @Column('text')
76
+ * public content: string
77
+ * }
78
+ *
79
+ * Application
80
+ * .run(() => ({
81
+ * id: 'com.example.reports',
82
+ * name: 'Reports',
83
+ * providers: {
84
+ * reports: {
85
+ * ...buildDatabaseOptions({type: 'postgres', url: 'postgres://postgres:secret@localhost:5432/reports', synchronize: true}),
86
+ * entities: [Report]
87
+ * }
88
+ * }
89
+ * }))
90
+ * .onLaunched(async (app: Application): Promise<void> => {
91
+ * //A connection opened for this use, closed with the application
92
+ * const database: Database = await app.getObject('reports')
93
+ * await database.transaction(async (manager): Promise<void> => {
94
+ * await manager.save(Report, {content: 'Daily report'})
95
+ * })
96
+ * console.log(await database.getRepository(Report).count())
97
+ * })
98
+ * ```
99
+ */
100
+ let Database = class Database extends Provider {
101
+ /**
102
+ * Load the provider generating the migrations of the database. The application calls it when it is started with
103
+ * `MIGRATION_GENERATE`: the applications do not call it.
104
+ * @returns The migration generator provider class.
105
+ */
106
+ static { this.migrationGenerator = async () => (await import('./migration/GenerateMigration.js')).GenerateMigration; }
107
+ /**
108
+ * Load the provider running, reverting or showing the migrations of the database. The application calls it when it
109
+ * is started with `MIGRATION_RUN`, `MIGRATION_REVERT` or `MIGRATION_SHOW`: the applications do not call it.
110
+ * @returns The migration executor provider class.
111
+ */
112
+ static { this.migrationExecutor = async () => (await import('./migration/ExecuteMigration.js')).ExecuteMigration; }
113
+ #datasource;
114
+ /**
115
+ * The TypeORM `DataSource` of the connection, for the subclasses needing what this class does not expose.
116
+ */
117
+ get datasource() {
118
+ return this.#datasource;
119
+ }
120
+ /**
121
+ * The TypeORM driver of the connection (PostgreSQL, MySQL, SQLite…).
122
+ */
123
+ get driver() {
124
+ return this.datasource.driver;
125
+ }
126
+ /**
127
+ * The entity manager of the connection: the TypeORM operations on any entity (`find`, `save`, `delete`…) outside a
128
+ * transaction.
129
+ */
130
+ get manager() {
131
+ return this.datasource.manager;
132
+ }
133
+ /**
134
+ * Replace the naming strategy of the connection, which names the tables, the columns and the constraints of the
135
+ * entities. Set it before the metadata is used: the names already built are not renamed.
136
+ * @param instance The naming strategy.
137
+ */
138
+ set namingStrategy(instance) {
139
+ this.datasource.namingStrategy = instance;
140
+ }
141
+ /**
142
+ * The naming strategy of the connection, which names the tables, the columns and the constraints of the entities.
143
+ * @default TypeORM's `DefaultNamingStrategy`, unless the options set `namingStrategy`
144
+ */
145
+ get namingStrategy() {
146
+ return this.datasource.namingStrategy;
147
+ }
148
+ /**
149
+ * The entity subscribers registered on the connection (the `subscribers` of the options).
150
+ */
151
+ get subscribers() {
152
+ return this.datasource.subscribers;
153
+ }
154
+ /**
155
+ * The metadata of every entity registered on the connection.
156
+ */
157
+ get entityMetadatas() {
158
+ return this.datasource.entityMetadatas;
159
+ }
160
+ /**
161
+ * The metadata of every entity registered on the connection, by entity target (class, name or schema): the same as
162
+ * {@link Database.entityMetadatas}, for fast lookups.
163
+ */
164
+ get entityMetadatasMap() {
165
+ return this.datasource.entityMetadatasMap;
166
+ }
167
+ /**
168
+ * The query result cache of the connection, `undefined` unless the options enable `cache`.
169
+ */
170
+ get queryResultCache() {
171
+ return this.datasource.queryResultCache;
172
+ }
173
+ /**
174
+ * Connect to the database with the options, their entities and the ones of the `entities` option.
175
+ * @protected
176
+ */
177
+ async init() {
178
+ const entities = this.entities ? this.entities : [];
179
+ const options = {
180
+ ...this.options,
181
+ entities: [...As(this.options.entities ? this.options.entities : []), ...As(entities)]
182
+ };
183
+ this.#datasource = await (new DataSource(options)).initialize();
184
+ }
185
+ /**
186
+ * Disconnect from the database.
187
+ * @protected
188
+ */
189
+ async destroy() {
190
+ await this.datasource.destroy();
191
+ }
192
+ /**
193
+ * Create or update the database schema from the registered entities (the tables, columns, indices and foreign
194
+ * keys). Meant for development: the migrations change the schema of a production database.
195
+ * @param dropBeforeSync Drop every table of the database schema, with its data (also the tables of no entity),
196
+ * before creating the schema. Defaults to `false`.
197
+ * @returns Resolves once the schema is built.
198
+ * @throws {CannotExecuteNotConnectedError} When the connection is closed.
199
+ */
200
+ async synchronize(dropBeforeSync) {
201
+ return await this.datasource.synchronize(dropBeforeSync);
202
+ }
203
+ /**
204
+ * Run the pending migrations (the `migrations` of the options not yet recorded in the migrations table), in their
205
+ * timestamp order.
206
+ * @param options The transactions of the migrations, and whether they are only recorded (`fake`).
207
+ * @returns The migrations run, an empty array when none is pending.
208
+ * @throws {CannotExecuteNotConnectedError} When the connection is closed.
209
+ * @throws {Error} The error of a failed migration, once its transaction (`'all'` or `'each'`) is rolled back.
210
+ */
211
+ async runMigrations(options) {
212
+ return await this.datasource.runMigrations(options);
213
+ }
214
+ /**
215
+ * Revert the last migration run (its `down()`), and remove it from the migrations table. Does nothing when no
216
+ * migration was run.
217
+ * @param options The transaction of the migration (`'all'` by default, `migrationsTransactionMode` not applying),
218
+ * and whether it is only removed from the migrations table (`fake`).
219
+ * @returns Resolves once the migration is reverted.
220
+ * @throws {CannotExecuteNotConnectedError} When the connection is closed.
221
+ */
222
+ async undoLastMigration(options) {
223
+ return await this.datasource.undoLastMigration(options);
224
+ }
225
+ /**
226
+ * Log each migration of the options with whether it was run (`[X]`) or not (`[ ]`), through the logger of the
227
+ * connection (shown when its `logging` includes `schema`).
228
+ * @returns Whether a migration is pending.
229
+ */
230
+ async showMigrations() {
231
+ return await this.datasource.showMigrations();
232
+ }
233
+ /**
234
+ * Whether an entity is registered on the connection.
235
+ * @param target The entity class, its name, or its table name.
236
+ * @returns `true` when the connection has its metadata.
237
+ */
238
+ hasMetadata(target) {
239
+ return this.datasource.hasMetadata(target);
240
+ }
241
+ /**
242
+ * The metadata of a registered entity: its table, columns, relations…
243
+ * @param target The entity class, its name, or its table name.
244
+ * @returns The metadata of the entity.
245
+ * @throws {EntityMetadataNotFoundError} When the entity is not registered on the connection.
246
+ */
247
+ getMetadata(target) {
248
+ return this.datasource.getMetadata(target);
249
+ }
250
+ /**
251
+ * The repository of an entity, created once per entity: its `find`, `save`, `delete`… operations outside a
252
+ * transaction (in a transaction, use the entity manager given to the callback).
253
+ * @param target The entity class, its name, or its `EntitySchema`.
254
+ * @returns The repository of the entity (a `MongoRepository` on a MongoDB connection).
255
+ * @throws {EntityMetadataNotFoundError} From the repository operations, when the entity is not registered.
256
+ */
257
+ getRepository(target) {
258
+ return this.datasource.getRepository(target);
259
+ }
260
+ /**
261
+ * The tree repository of an entity decorated with `@Tree()`: the operations on its ancestors and descendants
262
+ * (`findTrees`, `findDescendants`…).
263
+ * @param target The tree entity class, or its name.
264
+ * @returns The tree repository of the entity.
265
+ * @throws {TreeRepositoryNotSupportedError} On a driver without tree support (MongoDB).
266
+ */
267
+ getTreeRepository(target) {
268
+ return this.datasource.getTreeRepository(target);
269
+ }
270
+ /**
271
+ * The MongoDB repository of an entity: the repository operations plus the MongoDB ones (`aggregate`, `bulkWrite`…).
272
+ * @param target The entity class, or its name.
273
+ * @returns The MongoDB repository of the entity.
274
+ * @throws {TypeORMError} When the connection is not a MongoDB one.
275
+ */
276
+ getMongoRepository(target) {
277
+ return this.datasource.getMongoRepository(target);
278
+ }
279
+ async transaction(inp1, inp2) {
280
+ return inp2 ? await this.datasource.transaction(inp1, inp2) : await this.datasource.transaction(inp1);
281
+ }
282
+ /**
283
+ * Run a raw SQL query.
284
+ * @param query The SQL, its parameters as placeholders: `$1`, `$2`… for PostgreSQL, `?` for MySQL and SQLite.
285
+ * @param parameters The values of the placeholders, escaped by the driver.
286
+ * @param queryRunner The query runner to run it on (a transaction of {@link Database.createQueryRunner}), a
287
+ * connection of the pool otherwise.
288
+ * @returns The raw result of the driver: the rows of a `SELECT` (an array of objects).
289
+ * @throws {QueryFailedError} When the database rejects the query.
290
+ */
291
+ async query(query, parameters, queryRunner) {
292
+ return await this.datasource.query(query, parameters, queryRunner);
293
+ }
294
+ createQueryBuilder(inp1, inp2, inp3) {
295
+ return arguments.length > 1 ? this.datasource.createQueryBuilder(inp1, inp2, inp3) : this.datasource.createQueryBuilder(inp1);
296
+ }
297
+ /**
298
+ * Create a query runner: one connection taken from the pool, to run several queries on the same connection and
299
+ * control its transaction by hand (`connect()`, `startTransaction()`, `commitTransaction()`,
300
+ * `rollbackTransaction()`). The caller must `release()` it, or the connection stays taken.
301
+ * @param mode With replication, `'master'` (the default) for the writes, `'slave'` for the reads on a replica.
302
+ * @returns The query runner, not connected until its first query or `connect()`.
303
+ */
304
+ createQueryRunner(mode) {
305
+ return this.datasource.createQueryRunner(mode);
306
+ }
307
+ /**
308
+ * The metadata of the junction table of a many-to-many relation.
309
+ * @param entityTarget The entity owning the relation.
310
+ * @param relationPropertyPath The property of the relation (`'tags'`, or a path such as `'profile.tags'`).
311
+ * @returns The metadata of the junction table.
312
+ * @throws {EntityMetadataNotFoundError} When the entity is not registered.
313
+ * @throws {TypeORMError} When the entity has no such relation, or the relation is not a many-to-many one.
314
+ */
315
+ getManyToManyMetadata(entityTarget, relationPropertyPath) {
316
+ return this.datasource.getManyToManyMetadata(entityTarget, relationPropertyPath);
317
+ }
318
+ /**
319
+ * Create an entity manager on the connection, bound to a query runner when given (its operations then run on the
320
+ * runner's connection and transaction).
321
+ * @param queryRunner The query runner the manager uses, a connection of the pool per operation otherwise.
322
+ * @returns The entity manager.
323
+ */
324
+ createEntityManager(queryRunner) {
325
+ return this.datasource.createEntityManager(queryRunner);
326
+ }
327
+ };
328
+ __decorate([
329
+ Configurable(),
330
+ __metadata("design:type", Object)
331
+ ], Database.prototype, "options", void 0);
332
+ __decorate([
333
+ Configurable(),
334
+ __metadata("design:type", Object)
335
+ ], Database.prototype, "entities", void 0);
336
+ Database = __decorate([
337
+ Transient()
338
+ ], Database);
339
+ export { Database };