@casekit/orm 0.0.1-alpha.7 → 0.0.1-alpha.9

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 (245) hide show
  1. package/lib/migrate/commands/implode.js +1 -1
  2. package/lib/migrate/commands/implode.js.map +1 -1
  3. package/lib/migrate/sql/createTableSql.test.js +1 -0
  4. package/lib/migrate/sql/createTableSql.test.js.map +1 -1
  5. package/lib/orm.d.ts.map +1 -1
  6. package/lib/orm.js +4 -2
  7. package/lib/orm.js.map +1 -1
  8. package/lib/queries/clauses/ReturningClause.d.ts +2 -3
  9. package/lib/queries/clauses/ReturningClause.d.ts.map +1 -1
  10. package/lib/queries/clauses/SelectClause.d.ts +2 -3
  11. package/lib/queries/clauses/SelectClause.d.ts.map +1 -1
  12. package/lib/queries/clauses/WhereClause.d.ts +1 -1
  13. package/lib/queries/clauses/WhereClause.d.ts.map +1 -1
  14. package/lib/queries/clauses/helpers/OptionalColumn.d.ts +4 -5
  15. package/lib/queries/clauses/helpers/OptionalColumn.d.ts.map +1 -1
  16. package/lib/queries/clauses/helpers/OptionalParams.d.ts +2 -2
  17. package/lib/queries/clauses/helpers/OptionalParams.d.ts.map +1 -1
  18. package/lib/queries/clauses/helpers/RequiredColumn.d.ts +2 -3
  19. package/lib/queries/clauses/helpers/RequiredColumn.d.ts.map +1 -1
  20. package/lib/queries/clauses/helpers/RequiredParams.d.ts +2 -2
  21. package/lib/queries/clauses/helpers/RequiredParams.d.ts.map +1 -1
  22. package/lib/queries/clauses/where/buildWhereClauses.d.ts +1 -1
  23. package/lib/queries/clauses/where/buildWhereClauses.d.ts.map +1 -1
  24. package/lib/queries/clauses/where/buildWhereClauses.js.map +1 -1
  25. package/lib/queries/clauses/where/buildWhereClauses.test.js +1 -1
  26. package/lib/queries/clauses/where/buildWhereClauses.test.js.map +1 -1
  27. package/lib/queries/clauses/where/types/WhereClauseValue.d.ts +1 -1
  28. package/lib/queries/clauses/where/types/WhereClauseValue.d.ts.map +1 -1
  29. package/lib/queries/count/buildCount.d.ts.map +1 -1
  30. package/lib/queries/count/buildCount.js +33 -29
  31. package/lib/queries/count/buildCount.js.map +1 -1
  32. package/lib/queries/count/countToSql.d.ts.map +1 -1
  33. package/lib/queries/count/countToSql.js +12 -17
  34. package/lib/queries/count/countToSql.js.map +1 -1
  35. package/lib/queries/count/types/CountBuilder.d.ts +12 -4
  36. package/lib/queries/count/types/CountBuilder.d.ts.map +1 -1
  37. package/lib/queries/count.d.ts.map +1 -1
  38. package/lib/queries/count.js +3 -1
  39. package/lib/queries/count.js.map +1 -1
  40. package/lib/queries/create/buildCreate.d.ts +1 -1
  41. package/lib/queries/create/buildCreate.d.ts.map +1 -1
  42. package/lib/queries/create/buildCreate.js +1 -1
  43. package/lib/queries/create/buildCreate.js.map +1 -1
  44. package/lib/queries/create/createResultSchema.d.ts.map +1 -1
  45. package/lib/queries/create/createResultSchema.js +3 -1
  46. package/lib/queries/create/createResultSchema.js.map +1 -1
  47. package/lib/queries/create/createToSql.d.ts.map +1 -1
  48. package/lib/queries/create/createToSql.js +2 -2
  49. package/lib/queries/create/createToSql.js.map +1 -1
  50. package/lib/queries/create/types/CreateManyParams.d.ts +1 -1
  51. package/lib/queries/create/types/CreateManyParams.d.ts.map +1 -1
  52. package/lib/queries/create/types/CreateManyResult.d.ts +1 -1
  53. package/lib/queries/create/types/CreateManyResult.d.ts.map +1 -1
  54. package/lib/queries/create/types/CreateOneParams.d.ts +1 -1
  55. package/lib/queries/create/types/CreateOneParams.d.ts.map +1 -1
  56. package/lib/queries/create/types/CreateOneResult.d.ts +1 -1
  57. package/lib/queries/create/types/CreateOneResult.d.ts.map +1 -1
  58. package/lib/queries/createMany.d.ts.map +1 -1
  59. package/lib/queries/createMany.js +3 -1
  60. package/lib/queries/createMany.js.map +1 -1
  61. package/lib/queries/delete/buildDelete.d.ts +1 -1
  62. package/lib/queries/delete/buildDelete.d.ts.map +1 -1
  63. package/lib/queries/delete/buildDelete.js +1 -1
  64. package/lib/queries/delete/buildDelete.js.map +1 -1
  65. package/lib/queries/delete/deleteResultSchema.d.ts.map +1 -1
  66. package/lib/queries/delete/deleteResultSchema.js +3 -1
  67. package/lib/queries/delete/deleteResultSchema.js.map +1 -1
  68. package/lib/queries/delete/deleteToSql.js +1 -1
  69. package/lib/queries/delete/deleteToSql.js.map +1 -1
  70. package/lib/queries/delete/types/DeleteManyResult.d.ts +1 -1
  71. package/lib/queries/delete/types/DeleteManyResult.d.ts.map +1 -1
  72. package/lib/queries/delete/types/DeleteOneResult.d.ts +1 -1
  73. package/lib/queries/delete/types/DeleteOneResult.d.ts.map +1 -1
  74. package/lib/queries/delete/types/DeleteParams.d.ts +1 -1
  75. package/lib/queries/delete/types/DeleteParams.d.ts.map +1 -1
  76. package/lib/queries/deleteMany.d.ts.map +1 -1
  77. package/lib/queries/deleteMany.js +3 -1
  78. package/lib/queries/deleteMany.js.map +1 -1
  79. package/lib/queries/find/buildFind.d.ts.map +1 -1
  80. package/lib/queries/find/buildFind.js +34 -30
  81. package/lib/queries/find/buildFind.js.map +1 -1
  82. package/lib/queries/find/findResultSchema.d.ts.map +1 -1
  83. package/lib/queries/find/findResultSchema.js +9 -2
  84. package/lib/queries/find/findResultSchema.js.map +1 -1
  85. package/lib/queries/find/findToSql.d.ts.map +1 -1
  86. package/lib/queries/find/findToSql.js +12 -17
  87. package/lib/queries/find/findToSql.js.map +1 -1
  88. package/lib/queries/find/tests/findMany.nullable-relations.test.d.ts +2 -0
  89. package/lib/queries/find/tests/findMany.nullable-relations.test.d.ts.map +1 -0
  90. package/lib/queries/find/tests/findMany.nullable-relations.test.js +118 -0
  91. package/lib/queries/find/tests/findMany.nullable-relations.test.js.map +1 -0
  92. package/lib/queries/find/types/FindBuilder.d.ts +12 -4
  93. package/lib/queries/find/types/FindBuilder.d.ts.map +1 -1
  94. package/lib/queries/find/types/FindManyParams.d.ts +2 -2
  95. package/lib/queries/find/types/FindManyParams.d.ts.map +1 -1
  96. package/lib/queries/find/types/FindOneParams.d.ts +1 -1
  97. package/lib/queries/find/types/FindOneParams.d.ts.map +1 -1
  98. package/lib/queries/findMany.d.ts.map +1 -1
  99. package/lib/queries/findMany.js +17 -9
  100. package/lib/queries/findMany.js.map +1 -1
  101. package/lib/queries/update/buildUpdate.d.ts +1 -1
  102. package/lib/queries/update/buildUpdate.d.ts.map +1 -1
  103. package/lib/queries/update/buildUpdate.js +1 -1
  104. package/lib/queries/update/buildUpdate.js.map +1 -1
  105. package/lib/queries/update/types/UpdateManyResult.d.ts +1 -1
  106. package/lib/queries/update/types/UpdateManyResult.d.ts.map +1 -1
  107. package/lib/queries/update/types/UpdateOneResult.d.ts +1 -1
  108. package/lib/queries/update/types/UpdateOneResult.d.ts.map +1 -1
  109. package/lib/queries/update/types/UpdateParams.d.ts +1 -1
  110. package/lib/queries/update/types/UpdateParams.d.ts.map +1 -1
  111. package/lib/queries/update/types/UpdateValues.d.ts +1 -1
  112. package/lib/queries/update/types/UpdateValues.d.ts.map +1 -1
  113. package/lib/queries/update/updateResultSchema.d.ts.map +1 -1
  114. package/lib/queries/update/updateResultSchema.js +3 -1
  115. package/lib/queries/update/updateResultSchema.js.map +1 -1
  116. package/lib/queries/update/updateToSql.js +1 -1
  117. package/lib/queries/update/updateToSql.js.map +1 -1
  118. package/lib/queries/updateMany.d.ts.map +1 -1
  119. package/lib/queries/updateMany.js +3 -1
  120. package/lib/queries/updateMany.js.map +1 -1
  121. package/lib/queries/util/rowToObject.d.ts.map +1 -1
  122. package/lib/queries/util/rowToObject.js +1 -1
  123. package/lib/queries/util/rowToObject.js.map +1 -1
  124. package/lib/schema/types/base/BaseRelation.d.ts +1 -0
  125. package/lib/schema/types/base/BaseRelation.d.ts.map +1 -1
  126. package/lib/schema/types/helpers/ColumnName.d.ts +2 -3
  127. package/lib/schema/types/helpers/ColumnName.d.ts.map +1 -1
  128. package/lib/schema/types/helpers/ColumnType.d.ts +2 -2
  129. package/lib/schema/types/helpers/ColumnType.d.ts.map +1 -1
  130. package/lib/schema/types/helpers/Columns.d.ts +2 -3
  131. package/lib/schema/types/helpers/Columns.d.ts.map +1 -1
  132. package/lib/schema/types/helpers/HasDefault.d.ts +2 -3
  133. package/lib/schema/types/helpers/HasDefault.d.ts.map +1 -1
  134. package/lib/schema/types/helpers/IsNullable.d.ts +2 -3
  135. package/lib/schema/types/helpers/IsNullable.d.ts.map +1 -1
  136. package/lib/schema/types/helpers/IsProvided.d.ts +2 -3
  137. package/lib/schema/types/helpers/IsProvided.d.ts.map +1 -1
  138. package/lib/schema/types/helpers/IsSerial.d.ts +2 -3
  139. package/lib/schema/types/helpers/IsSerial.d.ts.map +1 -1
  140. package/lib/schema/types/loose/LooseRelationDefinition.d.ts +1 -0
  141. package/lib/schema/types/loose/LooseRelationDefinition.d.ts.map +1 -1
  142. package/lib/schema/types/relations/ManyToManyRelation.d.ts +2 -2
  143. package/lib/schema/types/relations/ManyToManyRelation.d.ts.map +1 -1
  144. package/lib/schema/types/relations/ManyToOneRelation.d.ts +1 -1
  145. package/lib/schema/types/relations/ManyToOneRelation.d.ts.map +1 -1
  146. package/lib/schema/types/relations/OneToManyRelation.d.ts +2 -1
  147. package/lib/schema/types/relations/OneToManyRelation.d.ts.map +1 -1
  148. package/lib/test/db/index.d.ts +40 -0
  149. package/lib/test/db/index.d.ts.map +1 -1
  150. package/lib/test/db/models/post.model.d.ts +9 -0
  151. package/lib/test/db/models/post.model.d.ts.map +1 -1
  152. package/lib/test/db/models/post.model.js +6 -0
  153. package/lib/test/db/models/post.model.js.map +1 -1
  154. package/lib/test/db/models/post.relations.d.ts +6 -0
  155. package/lib/test/db/models/post.relations.d.ts.map +1 -1
  156. package/lib/test/db/models/post.relations.js +6 -0
  157. package/lib/test/db/models/post.relations.js.map +1 -1
  158. package/lib/test/db/models/user.model.d.ts +9 -0
  159. package/lib/test/db/models/user.model.d.ts.map +1 -1
  160. package/lib/test/db/models/user.model.js +6 -0
  161. package/lib/test/db/models/user.model.js.map +1 -1
  162. package/lib/test/db/models/user.relations.d.ts +16 -0
  163. package/lib/test/db/models/user.relations.d.ts.map +1 -1
  164. package/lib/test/db/models/user.relations.js +16 -0
  165. package/lib/test/db/models/user.relations.js.map +1 -1
  166. package/lib/test/db/models.d.ts +18 -0
  167. package/lib/test/db/models.d.ts.map +1 -1
  168. package/lib/test/db/relations.d.ts +22 -0
  169. package/lib/test/db/relations.d.ts.map +1 -1
  170. package/lib/test/seed/index.d.ts +40 -0
  171. package/lib/test/seed/index.d.ts.map +1 -1
  172. package/lib/types/ModelType.d.ts +10 -3
  173. package/lib/types/ModelType.d.ts.map +1 -1
  174. package/package.json +1 -1
  175. package/src/migrate/commands/implode.ts +1 -1
  176. package/src/migrate/sql/createTableSql.test.ts +1 -0
  177. package/src/orm.ts +5 -2
  178. package/src/queries/clauses/ReturningClause.ts +4 -6
  179. package/src/queries/clauses/SelectClause.ts +4 -6
  180. package/src/queries/clauses/WhereClause.ts +1 -1
  181. package/src/queries/clauses/helpers/OptionalColumn.ts +7 -11
  182. package/src/queries/clauses/helpers/OptionalParams.ts +2 -2
  183. package/src/queries/clauses/helpers/RequiredColumn.ts +5 -6
  184. package/src/queries/clauses/helpers/RequiredParams.ts +2 -2
  185. package/src/queries/clauses/where/buildWhereClauses.test.ts +1 -1
  186. package/src/queries/clauses/where/buildWhereClauses.ts +1 -1
  187. package/src/queries/clauses/where/types/WhereClauseValue.ts +1 -1
  188. package/src/queries/count/buildCount.ts +39 -33
  189. package/src/queries/count/countToSql.ts +27 -32
  190. package/src/queries/count/types/CountBuilder.ts +23 -6
  191. package/src/queries/count.ts +4 -1
  192. package/src/queries/create/buildCreate.ts +2 -2
  193. package/src/queries/create/createResultSchema.ts +3 -1
  194. package/src/queries/create/createToSql.ts +6 -2
  195. package/src/queries/create/types/CreateManyParams.ts +1 -1
  196. package/src/queries/create/types/CreateManyResult.ts +1 -1
  197. package/src/queries/create/types/CreateOneParams.ts +1 -1
  198. package/src/queries/create/types/CreateOneResult.ts +1 -1
  199. package/src/queries/createMany.ts +4 -1
  200. package/src/queries/delete/buildDelete.ts +2 -2
  201. package/src/queries/delete/deleteResultSchema.ts +3 -1
  202. package/src/queries/delete/deleteToSql.ts +1 -1
  203. package/src/queries/delete/types/DeleteManyResult.ts +1 -1
  204. package/src/queries/delete/types/DeleteOneResult.ts +1 -1
  205. package/src/queries/delete/types/DeleteParams.ts +1 -1
  206. package/src/queries/deleteMany.ts +4 -1
  207. package/src/queries/find/buildFind.ts +40 -34
  208. package/src/queries/find/findResultSchema.ts +9 -2
  209. package/src/queries/find/findToSql.ts +27 -32
  210. package/src/queries/find/tests/findMany.nullable-relations.test.ts +127 -0
  211. package/src/queries/find/types/FindBuilder.ts +23 -6
  212. package/src/queries/find/types/FindManyParams.ts +2 -2
  213. package/src/queries/find/types/FindOneParams.ts +1 -1
  214. package/src/queries/findMany.ts +25 -17
  215. package/src/queries/update/buildUpdate.ts +2 -2
  216. package/src/queries/update/types/UpdateManyResult.ts +1 -1
  217. package/src/queries/update/types/UpdateOneResult.ts +1 -1
  218. package/src/queries/update/types/UpdateParams.ts +1 -1
  219. package/src/queries/update/types/UpdateValues.ts +1 -1
  220. package/src/queries/update/updateResultSchema.ts +3 -1
  221. package/src/queries/update/updateToSql.ts +1 -1
  222. package/src/queries/updateMany.ts +4 -1
  223. package/src/queries/util/rowToObject.ts +5 -1
  224. package/src/schema/types/base/BaseRelation.ts +1 -0
  225. package/src/schema/types/helpers/ColumnName.ts +5 -6
  226. package/src/schema/types/helpers/ColumnType.ts +2 -2
  227. package/src/schema/types/helpers/Columns.ts +2 -6
  228. package/src/schema/types/helpers/HasDefault.ts +5 -7
  229. package/src/schema/types/helpers/IsNullable.ts +4 -6
  230. package/src/schema/types/helpers/IsProvided.ts +4 -6
  231. package/src/schema/types/helpers/IsSerial.ts +4 -6
  232. package/src/schema/types/loose/LooseRelationDefinition.ts +1 -1
  233. package/src/schema/types/relations/ManyToManyRelation.ts +2 -2
  234. package/src/schema/types/relations/ManyToOneRelation.ts +1 -1
  235. package/src/schema/types/relations/OneToManyRelation.ts +2 -1
  236. package/src/test/db/models/post.model.ts +6 -0
  237. package/src/test/db/models/post.relations.ts +6 -0
  238. package/src/test/db/models/user.model.ts +6 -0
  239. package/src/test/db/models/user.relations.ts +16 -0
  240. package/src/types/ModelType.ts +16 -3
  241. package/lib/queries/clauses/helpers/ModelValues.d.ts +0 -8
  242. package/lib/queries/clauses/helpers/ModelValues.d.ts.map +0 -1
  243. package/lib/queries/clauses/helpers/ModelValues.js +0 -2
  244. package/lib/queries/clauses/helpers/ModelValues.js.map +0 -1
  245. package/src/queries/clauses/helpers/ModelValues.ts +0 -9
@@ -1,5 +1,4 @@
1
- import { LooseModelDefinitions } from "../loose/LooseModelDefinitions";
1
+ import { LooseModelDefinition } from "../loose/LooseModelDefinition";
2
2
  import { Columns } from "./Columns";
3
- import { ModelName } from "./ModelName";
4
- export type IsNullable<Models extends LooseModelDefinitions, M extends ModelName<Models>, C extends keyof Columns<Models, M>> = Columns<Models, M>[C]["nullable"] extends true ? true : false;
3
+ export type IsNullable<Model extends LooseModelDefinition, C extends keyof Columns<Model>> = Columns<Model>[C]["nullable"] extends true ? true : false;
5
4
  //# sourceMappingURL=IsNullable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IsNullable.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/helpers/IsNullable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,UAAU,CAClB,MAAM,SAAS,qBAAqB,EACpC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,EAC3B,CAAC,SAAS,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"IsNullable.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/helpers/IsNullable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,UAAU,CAClB,KAAK,SAAS,oBAAoB,EAClC,CAAC,SAAS,MAAM,OAAO,CAAC,KAAK,CAAC,IAC9B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC"}
@@ -1,6 +1,5 @@
1
- import { LooseModelDefinitions } from "../loose/LooseModelDefinitions";
1
+ import { LooseModelDefinition } from "../loose/LooseModelDefinition";
2
2
  import { ColumnName } from "./ColumnName";
3
3
  import { Columns } from "./Columns";
4
- import { ModelName } from "./ModelName";
5
- export type IsProvided<Models extends LooseModelDefinitions, M extends ModelName<Models>, C extends ColumnName<Models, M>> = Columns<Models, M>[C]["provided"];
4
+ export type IsProvided<Model extends LooseModelDefinition, C extends ColumnName<Model>> = Columns<Model>[C]["provided"];
6
5
  //# sourceMappingURL=IsProvided.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IsProvided.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/helpers/IsProvided.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,UAAU,CAClB,MAAM,SAAS,qBAAqB,EACpC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,EAC3B,CAAC,SAAS,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,IAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"IsProvided.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/helpers/IsProvided.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,UAAU,CAClB,KAAK,SAAS,oBAAoB,EAClC,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,IAC3B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC"}
@@ -1,6 +1,5 @@
1
- import { LooseModelDefinitions } from "../loose/LooseModelDefinitions";
1
+ import { LooseModelDefinition } from "../loose/LooseModelDefinition";
2
2
  import { ColumnName } from "./ColumnName";
3
3
  import { Columns } from "./Columns";
4
- import { ModelName } from "./ModelName";
5
- export type IsSerial<Models extends LooseModelDefinitions, M extends ModelName<Models>, C extends ColumnName<Models, M>> = Columns<Models, M>[C]["type"] extends "serial" | "bigserial" | "smallserial" ? true : false;
4
+ export type IsSerial<Model extends LooseModelDefinition, C extends ColumnName<Model>> = Columns<Model>[C]["type"] extends "serial" | "bigserial" | "smallserial" ? true : false;
6
5
  //# sourceMappingURL=IsSerial.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IsSerial.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/helpers/IsSerial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,QAAQ,CAChB,MAAM,SAAS,qBAAqB,EACpC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,EAC3B,CAAC,SAAS,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,IAC/B,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GAAG,WAAW,GAAG,aAAa,GAC1E,IAAI,GACJ,KAAK,CAAC"}
1
+ {"version":3,"file":"IsSerial.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/helpers/IsSerial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,QAAQ,CAChB,KAAK,SAAS,oBAAoB,EAClC,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,IAC3B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GAAG,WAAW,GAAG,aAAa,GACtE,IAAI,GACJ,KAAK,CAAC"}
@@ -6,6 +6,7 @@ export type LooseRelationDefinition = {
6
6
  model: string;
7
7
  type: "N:1";
8
8
  foreignKey: string;
9
+ optional?: true;
9
10
  } | {
10
11
  model: string;
11
12
  type: "N:N";
@@ -1 +1 @@
1
- {"version":3,"file":"LooseRelationDefinition.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationDefinition.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAC7B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAClD;IACI,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"LooseRelationDefinition.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/loose/LooseRelationDefinition.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAC7B;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,GACnE;IACI,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -7,8 +7,8 @@ export type ManyToManyRelation<Models extends LooseModelDefinitions> = {
7
7
  model: M2;
8
8
  through: J;
9
9
  type: "N:N";
10
- foreignKey: ColumnName<Models, J> | ColumnName<Models, J>[];
11
- otherKey: ColumnName<Models, J> | ColumnName<Models, J>[];
10
+ foreignKey: ColumnName<Models[J]> | ColumnName<Models[J]>[];
11
+ otherKey: ColumnName<Models[J]> | ColumnName<Models[J]>[];
12
12
  };
13
13
  };
14
14
  }[ModelName<Models>][ModelName<Models>];
@@ -1 +1 @@
1
- {"version":3,"file":"ManyToManyRelation.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/relations/ManyToManyRelation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAA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GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7D;KACJ;CACJ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -5,7 +5,7 @@ export type ManyToOneRelation<Models extends LooseModelDefinitions, M extends Mo
5
5
  [M2 in ModelName<Models>]: {
6
6
  model: M2;
7
7
  type: "N:1";
8
- foreignKey: ColumnName<Models, M> | ColumnName<Models, M>[];
8
+ foreignKey: ColumnName<Models[M]> | ColumnName<Models[M]>[];
9
9
  };
10
10
  }[ModelName<Models>];
11
11
  //# sourceMappingURL=ManyToOneRelation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ManyToOneRelation.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/relations/ManyToOneRelation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,CACzB,MAAM,SAAS,qBAAqB,EACpC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,IAC3B;KACC,EAAE,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG;QACvB,KAAK,EAAE,EAAE,CAAC;QACV,IAAI,EAAE,KAAK,CAAC;QACZ,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;KAC/D;CACJ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"ManyToOneRelation.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/relations/ManyToOneRelation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,CACzB,MAAM,SAAS,qBAAqB,EACpC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,IAC3B;KACC,EAAE,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG;QACvB,KAAK,EAAE,EAAE,CAAC;QACV,IAAI,EAAE,KAAK,CAAC;QACZ,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D;CACJ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -5,7 +5,8 @@ export type OneToManyRelation<Models extends LooseModelDefinitions> = {
5
5
  [M2 in ModelName<Models>]: {
6
6
  model: M2;
7
7
  type: "1:N";
8
- foreignKey: ColumnName<Models, M2> | ColumnName<Models, M2>[];
8
+ foreignKey: ColumnName<Models[M2]> | ColumnName<Models[M2]>[];
9
+ optional?: boolean;
9
10
  };
10
11
  }[ModelName<Models>];
11
12
  //# sourceMappingURL=OneToManyRelation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OneToManyRelation.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/relations/OneToManyRelation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,qBAAqB,IAAI;KACjE,EAAE,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG;QACvB,KAAK,EAAE,EAAE,CAAC;QACV,IAAI,EAAE,KAAK,CAAC;QACZ,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;KACjE;CACJ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"OneToManyRelation.d.ts","sourceRoot":"","sources":["../../../../src/schema/types/relations/OneToManyRelation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,qBAAqB,IAAI;KACjE,EAAE,IAAI,SAAS,CAAC,MAAM,CAAC,GAAG;QACvB,KAAK,EAAE,EAAE,CAAC;QACV,IAAI,EAAE,KAAK,CAAC;QACZ,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;KACtB;CACJ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -70,6 +70,15 @@ export declare const db: import("../..").Orm<{
70
70
  readonly column: "id";
71
71
  };
72
72
  };
73
+ readonly reviewedById: {
74
+ readonly name: "reviewed_by_id";
75
+ readonly type: "uuid";
76
+ readonly nullable: true;
77
+ readonly references: {
78
+ readonly table: "user";
79
+ readonly column: "id";
80
+ };
81
+ };
73
82
  readonly publishedAt: {
74
83
  readonly type: "timestamp";
75
84
  readonly nullable: true;
@@ -106,6 +115,15 @@ export declare const db: import("../..").Orm<{
106
115
  readonly zodSchema: import("zod").ZodString;
107
116
  readonly type: "text";
108
117
  };
118
+ readonly invitedById: {
119
+ readonly name: "invited_by_id";
120
+ readonly type: "uuid";
121
+ readonly nullable: true;
122
+ readonly references: {
123
+ readonly table: "user";
124
+ readonly column: "id";
125
+ };
126
+ };
109
127
  readonly joinedAt: {
110
128
  readonly name: "created_at";
111
129
  readonly zodSchema: import("zod").ZodDate;
@@ -183,6 +201,12 @@ export declare const db: import("../..").Orm<{
183
201
  readonly type: "N:1";
184
202
  readonly foreignKey: "authorId";
185
203
  };
204
+ readonly reviewedBy: {
205
+ readonly model: "user";
206
+ readonly type: "N:1";
207
+ readonly foreignKey: "reviewedById";
208
+ readonly optional: true;
209
+ };
186
210
  readonly tenant: {
187
211
  readonly model: "tenant";
188
212
  readonly type: "N:1";
@@ -195,6 +219,22 @@ export declare const db: import("../..").Orm<{
195
219
  readonly model: "post";
196
220
  readonly foreignKey: "authorId";
197
221
  };
222
+ readonly reviewedPosts: {
223
+ readonly type: "1:N";
224
+ readonly model: "post";
225
+ readonly foreignKey: "reviewedById";
226
+ };
227
+ readonly invitedBy: {
228
+ readonly type: "N:1";
229
+ readonly model: "user";
230
+ readonly foreignKey: "invitedById";
231
+ readonly optional: true;
232
+ };
233
+ readonly invitedUsers: {
234
+ readonly type: "1:N";
235
+ readonly model: "user";
236
+ readonly foreignKey: "invitedById";
237
+ };
198
238
  readonly tenancies: {
199
239
  readonly type: "1:N";
200
240
  readonly model: "tenantUser";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/db/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;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QAAQ,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,IAAI,cAAc,CAC9D,MAAM,EACN,SAAS,EACT,CAAC,CACJ,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAC7B,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AAClC,MAAM,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC"}
@@ -19,6 +19,15 @@ export declare const post: {
19
19
  readonly column: "id";
20
20
  };
21
21
  };
22
+ readonly reviewedById: {
23
+ readonly name: "reviewed_by_id";
24
+ readonly type: "uuid";
25
+ readonly nullable: true;
26
+ readonly references: {
27
+ readonly table: "user";
28
+ readonly column: "id";
29
+ };
30
+ };
22
31
  readonly publishedAt: {
23
32
  readonly type: "timestamp";
24
33
  readonly nullable: true;
@@ -1 +1 @@
1
- {"version":3,"file":"post.model.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/post.model.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBmB,CAAC"}
1
+ {"version":3,"file":"post.model.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/post.model.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BmB,CAAC"}
@@ -13,6 +13,12 @@ export const post = {
13
13
  type: "uuid",
14
14
  references: { table: "user", column: "id" },
15
15
  },
16
+ reviewedById: {
17
+ name: "reviewed_by_id",
18
+ type: "uuid",
19
+ nullable: true,
20
+ references: { table: "user", column: "id" },
21
+ },
16
22
  publishedAt: { type: "timestamp", nullable: true },
17
23
  tags: { type: "text[][][][]", nullable: true },
18
24
  tenantId: {
@@ -1 +1 @@
1
- {"version":3,"file":"post.model.js","sourceRoot":"","sources":["../../../../src/test/db/models/post.model.ts"],"names":[],"mappings":"AACA,OAA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M,EAAE;QACvB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QACzB,QAAQ,EAAE;YACN,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;SAC9C;QACD,YAAY,EAAE;YACV,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;SAC9C;QACD,WAAW,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClD,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9C,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;YAC7C,OAAO,EAAE,sCAAsC;SAClD;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChD,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;KACnD;CAC+B,CAAC"}
@@ -4,6 +4,12 @@ export declare const post: {
4
4
  readonly type: "N:1";
5
5
  readonly foreignKey: "authorId";
6
6
  };
7
+ readonly reviewedBy: {
8
+ readonly model: "user";
9
+ readonly type: "N:1";
10
+ readonly foreignKey: "reviewedById";
11
+ readonly optional: true;
12
+ };
7
13
  readonly tenant: {
8
14
  readonly model: "tenant";
9
15
  readonly type: "N:1";
@@ -1 +1 @@
1
- {"version":3,"file":"post.relations.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/post.relations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;;;;;;;;;;CAWuC,CAAC"}
1
+ {"version":3,"file":"post.relations.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/post.relations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;CAiBuC,CAAC"}
@@ -4,6 +4,12 @@ export const post = {
4
4
  type: "N:1",
5
5
  foreignKey: "authorId",
6
6
  },
7
+ reviewedBy: {
8
+ model: "user",
9
+ type: "N:1",
10
+ foreignKey: "reviewedById",
11
+ optional: true,
12
+ },
7
13
  tenant: {
8
14
  model: "tenant",
9
15
  type: "N:1",
@@ -1 +1 @@
1
- {"version":3,"file":"post.relations.js","sourceRoot":"","sources":["../../../../src/test/db/models/post.relations.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,MAAM,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,UAAU;KACzB;IACD,MAAM,EAAE;QACJ,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,UAAU;KACzB;CACmD,CAAC"}
1
+ {"version":3,"file":"post.relations.js","sourceRoot":"","sources":["../../../../src/test/db/models/post.relations.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,MAAM,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,UAAU;KACzB;IACD,UAAU,EAAE;QACR,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,cAAc;QAC1B,QAAQ,EAAE,IAAI;KACjB;IACD,MAAM,EAAE;QACJ,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,UAAU;KACzB;CACmD,CAAC"}
@@ -9,6 +9,15 @@ export declare const user: {
9
9
  readonly zodSchema: z.ZodString;
10
10
  readonly type: "text";
11
11
  };
12
+ readonly invitedById: {
13
+ readonly name: "invited_by_id";
14
+ readonly type: "uuid";
15
+ readonly nullable: true;
16
+ readonly references: {
17
+ readonly table: "user";
18
+ readonly column: "id";
19
+ };
20
+ };
12
21
  readonly joinedAt: {
13
22
  readonly name: "created_at";
14
23
  readonly zodSchema: z.ZodDate;
@@ -1 +1 @@
1
- {"version":3,"file":"user.model.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/user.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBmB,CAAC"}
1
+ {"version":3,"file":"user.model.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/user.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBmB,CAAC"}
@@ -4,6 +4,12 @@ export const user = {
4
4
  columns: {
5
5
  id: { type: "uuid", default: sql `uuid_generate_v4()` },
6
6
  username: { zodSchema: z.string(), type: "text" },
7
+ invitedById: {
8
+ name: "invited_by_id",
9
+ type: "uuid",
10
+ nullable: true,
11
+ references: { table: "user", column: "id" },
12
+ },
7
13
  joinedAt: {
8
14
  name: "created_at",
9
15
  zodSchema: z.date(),
@@ -1 +1 @@
1
- {"version":3,"file":"user.model.js","sourceRoot":"","sources":["../../../../src/test/db/models/user.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,OAAO,EAAE;QACL,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAA,oBAAoB,EAAE;QACtD,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI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D,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;QAChD,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;KACxE;IACD,UAAU,EAAE,CAAC,IAAI,CAAC;IAClB,iBAAiB,EAAE;QACf,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,GAAG,CAAA,oBAAoB,EAAE;KAC5D;CAC+B,CAAC"}
@@ -4,6 +4,22 @@ export declare const user: {
4
4
  readonly model: "post";
5
5
  readonly foreignKey: "authorId";
6
6
  };
7
+ readonly reviewedPosts: {
8
+ readonly type: "1:N";
9
+ readonly model: "post";
10
+ readonly foreignKey: "reviewedById";
11
+ };
12
+ readonly invitedBy: {
13
+ readonly type: "N:1";
14
+ readonly model: "user";
15
+ readonly foreignKey: "invitedById";
16
+ readonly optional: true;
17
+ };
18
+ readonly invitedUsers: {
19
+ readonly type: "1:N";
20
+ readonly model: "user";
21
+ readonly foreignKey: "invitedById";
22
+ };
7
23
  readonly tenancies: {
8
24
  readonly type: "1:N";
9
25
  readonly model: "tenantUser";
@@ -1 +1 @@
1
- {"version":3,"file":"user.relations.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/user.relations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;CAkBuC,CAAC"}
1
+ {"version":3,"file":"user.relations.d.ts","sourceRoot":"","sources":["../../../../src/test/db/models/user.relations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCuC,CAAC"}
@@ -4,6 +4,22 @@ export const user = {
4
4
  model: "post",
5
5
  foreignKey: "authorId",
6
6
  },
7
+ reviewedPosts: {
8
+ type: "1:N",
9
+ model: "post",
10
+ foreignKey: "reviewedById",
11
+ },
12
+ invitedBy: {
13
+ type: "N:1",
14
+ model: "user",
15
+ foreignKey: "invitedById",
16
+ optional: true,
17
+ },
18
+ invitedUsers: {
19
+ type: "1:N",
20
+ model: "user",
21
+ foreignKey: "invitedById",
22
+ },
7
23
  tenancies: {
8
24
  type: "1:N",
9
25
  model: "tenantUser",
@@ -1 +1 @@
1
- {"version":3,"file":"user.relations.js","sourceRoot":"","sources":["../../../../src/test/db/models/user.relations.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,KAAK,EAAE;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,UAAU;KACzB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,YAAY;QACnB,UAAU,EAAE,QAAQ;KACvB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,YAAY;QACrB,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,UAAU;KACvB;CACmD,CAAC"}
1
+ {"version":3,"file":"user.relations.js","sourceRoot":"","sources":["../../../../src/test/db/models/user.relations.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,KAAK,EAAE;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,UAAU;KACzB;IACD,aAAa,EAAE;QACX,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,cAAc;KAC7B;IACD,SAAS,EAAE;QACP,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,aAAa;QACzB,QAAQ,EAAE,IAAI;KACjB;IACD,YAAY,EAAE;QACV,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,aAAa;KAC5B;IACD,SAAS,EAAE;QACP,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,YAAY;QACnB,UAAU,EAAE,QAAQ;KACvB;IACD,OAAO,EAAE;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,YAAY;QACrB,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,UAAU;KACvB;CACmD,CAAC"}
@@ -66,6 +66,15 @@ export declare const models: {
66
66
  readonly column: "id";
67
67
  };
68
68
  };
69
+ readonly reviewedById: {
70
+ readonly name: "reviewed_by_id";
71
+ readonly type: "uuid";
72
+ readonly nullable: true;
73
+ readonly references: {
74
+ readonly table: "user";
75
+ readonly column: "id";
76
+ };
77
+ };
69
78
  readonly publishedAt: {
70
79
  readonly type: "timestamp";
71
80
  readonly nullable: true;
@@ -102,6 +111,15 @@ export declare const models: {
102
111
  readonly zodSchema: import("zod").ZodString;
103
112
  readonly type: "text";
104
113
  };
114
+ readonly invitedById: {
115
+ readonly name: "invited_by_id";
116
+ readonly type: "uuid";
117
+ readonly nullable: true;
118
+ readonly references: {
119
+ readonly table: "user";
120
+ readonly column: "id";
121
+ };
122
+ };
105
123
  readonly joinedAt: {
106
124
  readonly name: "created_at";
107
125
  readonly zodSchema: import("zod").ZodDate;
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/test/db/models.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMlB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/test/db/models.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMlB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC"}
@@ -5,6 +5,12 @@ export declare const relations: {
5
5
  readonly type: "N:1";
6
6
  readonly foreignKey: "authorId";
7
7
  };
8
+ readonly reviewedBy: {
9
+ readonly model: "user";
10
+ readonly type: "N:1";
11
+ readonly foreignKey: "reviewedById";
12
+ readonly optional: true;
13
+ };
8
14
  readonly tenant: {
9
15
  readonly model: "tenant";
10
16
  readonly type: "N:1";
@@ -17,6 +23,22 @@ export declare const relations: {
17
23
  readonly model: "post";
18
24
  readonly foreignKey: "authorId";
19
25
  };
26
+ readonly reviewedPosts: {
27
+ readonly type: "1:N";
28
+ readonly model: "post";
29
+ readonly foreignKey: "reviewedById";
30
+ };
31
+ readonly invitedBy: {
32
+ readonly type: "N:1";
33
+ readonly model: "user";
34
+ readonly foreignKey: "invitedById";
35
+ readonly optional: true;
36
+ };
37
+ readonly invitedUsers: {
38
+ readonly type: "1:N";
39
+ readonly model: "user";
40
+ readonly foreignKey: "invitedById";
41
+ };
20
42
  readonly tenancies: {
21
43
  readonly type: "1:N";
22
44
  readonly model: "tenantUser";
@@ -1 +1 @@
1
- {"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../../src/test/db/relations.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC"}
1
+ {"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../../src/test/db/relations.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC"}
@@ -75,6 +75,15 @@ export declare const seed: (db: import("../..").Orm<{
75
75
  readonly column: "id";
76
76
  };
77
77
  };
78
+ readonly reviewedById: {
79
+ readonly name: "reviewed_by_id";
80
+ readonly type: "uuid";
81
+ readonly nullable: true;
82
+ readonly references: {
83
+ readonly table: "user";
84
+ readonly column: "id";
85
+ };
86
+ };
78
87
  readonly publishedAt: {
79
88
  readonly type: "timestamp";
80
89
  readonly nullable: true;
@@ -111,6 +120,15 @@ export declare const seed: (db: import("../..").Orm<{
111
120
  readonly zodSchema: import("zod").ZodString;
112
121
  readonly type: "text";
113
122
  };
123
+ readonly invitedById: {
124
+ readonly name: "invited_by_id";
125
+ readonly type: "uuid";
126
+ readonly nullable: true;
127
+ readonly references: {
128
+ readonly table: "user";
129
+ readonly column: "id";
130
+ };
131
+ };
114
132
  readonly joinedAt: {
115
133
  readonly name: "created_at";
116
134
  readonly zodSchema: import("zod").ZodDate;
@@ -188,6 +206,12 @@ export declare const seed: (db: import("../..").Orm<{
188
206
  readonly type: "N:1";
189
207
  readonly foreignKey: "authorId";
190
208
  };
209
+ readonly reviewedBy: {
210
+ readonly model: "user";
211
+ readonly type: "N:1";
212
+ readonly foreignKey: "reviewedById";
213
+ readonly optional: true;
214
+ };
191
215
  readonly tenant: {
192
216
  readonly model: "tenant";
193
217
  readonly type: "N:1";
@@ -200,6 +224,22 @@ export declare const seed: (db: import("../..").Orm<{
200
224
  readonly model: "post";
201
225
  readonly foreignKey: "authorId";
202
226
  };
227
+ readonly reviewedPosts: {
228
+ readonly type: "1:N";
229
+ readonly model: "post";
230
+ readonly foreignKey: "reviewedById";
231
+ };
232
+ readonly invitedBy: {
233
+ readonly type: "N:1";
234
+ readonly model: "user";
235
+ readonly foreignKey: "invitedById";
236
+ readonly optional: true;
237
+ };
238
+ readonly invitedUsers: {
239
+ readonly type: "1:N";
240
+ readonly model: "user";
241
+ readonly foreignKey: "invitedById";
242
+ };
203
243
  readonly tenancies: {
204
244
  readonly type: "1:N";
205
245
  readonly model: "tenantUser";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/seed/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE;YACL,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;SACjB,EAAE,CAAC;KACP,EAAE,CAAC;CACP,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAEL,UAAU,KACnB,QAAQ;IACP,KAAK,EAAE,OAAO,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,OAAO,EAAE,OAAO,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,WAAW,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,M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;KAAE,EAAE,CAAC;CAC7E,CAoDA,CAAC"}
@@ -1,7 +1,14 @@
1
+ import { IsNullable } from "../schema/types/helpers/IsNullable";
1
2
  import { LooseModelDefinition } from "../schema/types/loose/LooseModelDefinition";
2
3
  import { ColumnName } from "./ColumnName";
3
4
  import { ColumnType } from "./ColumnType";
4
- export type ModelType<Model extends LooseModelDefinition> = {
5
- [C in ColumnName<Model>]: ColumnType<Model, C>;
6
- };
5
+ import { Simplify } from "./util/Simplify";
6
+ export type NullableColumn<Model extends LooseModelDefinition> = {
7
+ [C in ColumnName<Model>]: IsNullable<Model, C> extends true ? C : never;
8
+ }[ColumnName<Model>];
9
+ export type ModelType<Model extends LooseModelDefinition> = Simplify<{
10
+ [C in Exclude<ColumnName<Model>, NullableColumn<Model>>]: ColumnType<Model, C>;
11
+ } & {
12
+ [C in NullableColumn<Model>]?: ColumnType<Model, C>;
13
+ }>;
7
14
  //# sourceMappingURL=ModelType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModelType.d.ts","sourceRoot":"","sources":["../../src/types/ModelType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,oBAAoB,IAAI;KACvD,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;CACjD,CAAC"}
1
+ {"version":3,"file":"ModelType.d.ts","sourceRoot":"","sources":["../../src/types/ModelType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,MAAM,cAAc,CAAC,KAAK,SAAS,oBAAoB,IAAI;KAC5D,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,KAAK;CAC1E,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;AAErB,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,oBAAoB,IAAI,QAAQ,CAChE;KACK,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CAChE,KAAK,EACL,CAAC,CACJ;CACJ,GAAG;KACC,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;CACtD,CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casekit/orm",
3
- "version": "0.0.1-alpha.7",
3
+ "version": "0.0.1-alpha.9",
4
4
  "description": "A simple ORM",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -33,7 +33,7 @@ export const implode = async (
33
33
  }
34
34
  }
35
35
 
36
- if (output) console.log(statement.text);
36
+ if (output || process.env.ORM_VERBOSE_LOGGING) console.log(statement.text);
37
37
 
38
38
  if (!dryRun) {
39
39
  try {
@@ -16,6 +16,7 @@ describe("createTableSql", () => {
16
16
  CREATE TABLE casekit."user" (
17
17
  id uuid NOT NULL DEFAULT uuid_generate_v4(),
18
18
  username text NOT NULL,
19
+ invited_by_id uuid,
19
20
  created_at timestamp,
20
21
  updated_at timestamp,
21
22
  deleted_at timestamp,
package/src/orm.ts CHANGED
@@ -330,7 +330,7 @@ export class Orm<
330
330
  ...variables: readonly unknown[]
331
331
  ): Promise<T[]> {
332
332
  const query = sql(fragments, ...variables);
333
- if (!process.env.CI) {
333
+ if (process.env.ORM_VERBOSE_LOGGING) {
334
334
  console.log(query.text);
335
335
  console.log(query.values);
336
336
  }
@@ -343,7 +343,10 @@ export class Orm<
343
343
  ...variables: readonly unknown[]
344
344
  ): Promise<T> {
345
345
  const query = sql(fragments, ...variables);
346
- if (!process.env.CI) console.log(query.text);
346
+ if (process.env.ORM_VERBOSE_LOGGING) {
347
+ console.log(query.text);
348
+ console.log(query.values);
349
+ }
347
350
  const result = await this.connection.query<T>(query);
348
351
  if (result.rowCount === 0 || result.rowCount === null)
349
352
  throw new OrmError("No rows returned from query");