@contember/engine-content-api 1.3.0-alpha.1 → 1.3.0-alpha.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 (263) hide show
  1. package/dist/src/ExecutionContainer.d.ts +141 -0
  2. package/dist/src/ExecutionContainer.d.ts.map +1 -0
  3. package/dist/src/ExecutionContainer.js +84 -0
  4. package/dist/src/ExecutionContainer.js.map +1 -0
  5. package/dist/src/index.d.ts +2 -1
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/index.js +18 -2
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/mapper/ColumnValue.d.ts +2 -2
  10. package/dist/src/mapper/ColumnValue.d.ts.map +1 -1
  11. package/dist/src/mapper/EventManager.d.ts +86 -0
  12. package/dist/src/mapper/EventManager.d.ts.map +1 -0
  13. package/dist/src/mapper/EventManager.js +118 -0
  14. package/dist/src/mapper/EventManager.js.map +1 -0
  15. package/dist/src/mapper/JunctionTableManager.d.ts +12 -11
  16. package/dist/src/mapper/JunctionTableManager.d.ts.map +1 -1
  17. package/dist/src/mapper/JunctionTableManager.js +20 -8
  18. package/dist/src/mapper/JunctionTableManager.js.map +1 -1
  19. package/dist/src/mapper/Mapper.d.ts +11 -6
  20. package/dist/src/mapper/Mapper.d.ts.map +1 -1
  21. package/dist/src/mapper/Mapper.js +34 -17
  22. package/dist/src/mapper/Mapper.js.map +1 -1
  23. package/dist/src/mapper/MapperFactory.d.ts +33 -0
  24. package/dist/src/mapper/MapperFactory.d.ts.map +1 -0
  25. package/dist/src/mapper/MapperFactory.js +40 -0
  26. package/dist/src/mapper/MapperFactory.js.map +1 -0
  27. package/dist/src/mapper/Result.d.ts +3 -2
  28. package/dist/src/mapper/Result.d.ts.map +1 -1
  29. package/dist/src/mapper/Result.js +2 -1
  30. package/dist/src/mapper/Result.js.map +1 -1
  31. package/dist/src/mapper/delete/DeleteExecutor.d.ts.map +1 -1
  32. package/dist/src/mapper/delete/DeleteExecutor.js +41 -1
  33. package/dist/src/mapper/delete/DeleteExecutor.js.map +1 -1
  34. package/dist/src/mapper/index.d.ts +3 -1
  35. package/dist/src/mapper/index.d.ts.map +1 -1
  36. package/dist/src/mapper/index.js +3 -1
  37. package/dist/src/mapper/index.js.map +1 -1
  38. package/dist/src/mapper/insert/InsertBuilder.d.ts +2 -2
  39. package/dist/src/mapper/insert/InsertBuilder.d.ts.map +1 -1
  40. package/dist/src/mapper/insert/InsertBuilder.js +8 -2
  41. package/dist/src/mapper/insert/InsertBuilder.js.map +1 -1
  42. package/dist/src/mapper/insert/Inserter.js +3 -3
  43. package/dist/src/mapper/insert/Inserter.js.map +1 -1
  44. package/dist/src/mapper/select/OrderByHelper.d.ts +1 -1
  45. package/dist/src/mapper/select/OrderByHelper.d.ts.map +1 -1
  46. package/dist/src/mapper/select/OrderByHelper.js +3 -1
  47. package/dist/src/mapper/select/OrderByHelper.js.map +1 -1
  48. package/dist/src/mapper/select/RelationFetcher.js +2 -2
  49. package/dist/src/mapper/select/RelationFetcher.js.map +1 -1
  50. package/dist/src/mapper/update/UpdateBuilder.d.ts +4 -4
  51. package/dist/src/mapper/update/UpdateBuilder.d.ts.map +1 -1
  52. package/dist/src/mapper/update/UpdateBuilder.js +26 -8
  53. package/dist/src/mapper/update/UpdateBuilder.js.map +1 -1
  54. package/dist/src/mapper/update/UpdateBuilderFactory.d.ts +1 -1
  55. package/dist/src/mapper/update/UpdateBuilderFactory.d.ts.map +1 -1
  56. package/dist/src/mapper/update/UpdateBuilderFactory.js +2 -2
  57. package/dist/src/mapper/update/UpdateBuilderFactory.js.map +1 -1
  58. package/dist/src/mapper/update/Updater.d.ts.map +1 -1
  59. package/dist/src/mapper/update/Updater.js +6 -10
  60. package/dist/src/mapper/update/Updater.js.map +1 -1
  61. package/dist/src/resolvers/GraphQlQueryAstFactory.d.ts +1 -3
  62. package/dist/src/resolvers/GraphQlQueryAstFactory.d.ts.map +1 -1
  63. package/dist/src/resolvers/GraphQlQueryAstFactory.js +1 -4
  64. package/dist/src/resolvers/GraphQlQueryAstFactory.js.map +1 -1
  65. package/dist/src/resolvers/MutationResolver.d.ts +1 -4
  66. package/dist/src/resolvers/MutationResolver.d.ts.map +1 -1
  67. package/dist/src/resolvers/MutationResolver.js +9 -11
  68. package/dist/src/resolvers/MutationResolver.js.map +1 -1
  69. package/dist/src/resolvers/ReadResolver.d.ts +1 -3
  70. package/dist/src/resolvers/ReadResolver.d.ts.map +1 -1
  71. package/dist/src/resolvers/ReadResolver.js +6 -10
  72. package/dist/src/resolvers/ReadResolver.js.map +1 -1
  73. package/dist/src/resolvers/ValidationResolver.d.ts +1 -3
  74. package/dist/src/resolvers/ValidationResolver.d.ts.map +1 -1
  75. package/dist/src/resolvers/ValidationResolver.js +3 -4
  76. package/dist/src/resolvers/ValidationResolver.js.map +1 -1
  77. package/dist/src/resolvers/index.d.ts +0 -1
  78. package/dist/src/resolvers/index.d.ts.map +1 -1
  79. package/dist/src/resolvers/index.js +0 -1
  80. package/dist/src/resolvers/index.js.map +1 -1
  81. package/dist/src/schema/CustomTypesProvider.d.ts.map +1 -1
  82. package/dist/src/schema/CustomTypesProvider.js +1 -23
  83. package/dist/src/schema/CustomTypesProvider.js.map +1 -1
  84. package/dist/src/schema/MutationProvider.js +4 -4
  85. package/dist/src/schema/MutationProvider.js.map +1 -1
  86. package/dist/src/schema/QueryProvider.js +3 -3
  87. package/dist/src/schema/QueryProvider.js.map +1 -1
  88. package/dist/src/tsconfig.tsbuildinfo +1 -1
  89. package/dist/src/types.d.ts +2 -3
  90. package/dist/src/types.d.ts.map +1 -1
  91. package/dist/tests/cases/bugs/bug-update-by-nested-unique.test.js +3 -5
  92. package/dist/tests/cases/bugs/bug-update-by-nested-unique.test.js.map +1 -1
  93. package/dist/tests/cases/integration/graphQlDb/insert/insertSequence.test.js +2 -2
  94. package/dist/tests/cases/integration/graphQlDb/insert/insertSequence.test.js.map +1 -1
  95. package/dist/tests/cases/integration/graphQlDb/update/bug-freeze-connect-missing-one.test.js +1 -1
  96. package/dist/tests/cases/integration/graphQlDb/update/bug-freeze-connect-missing-one.test.js.map +1 -1
  97. package/dist/tests/cases/integration/graphQlDb/update/deferedConstraints.test.js +45 -45
  98. package/dist/tests/cases/integration/graphQlDb/update/deferedConstraints.test.js.map +1 -1
  99. package/dist/tests/cases/integration/graphQlDb/update/failedDelete.test.js +5 -5
  100. package/dist/tests/cases/integration/graphQlDb/update/failedDelete.test.js.map +1 -1
  101. package/dist/tests/cases/integration/graphQlDb/update/invalidInput.test.js +2 -2
  102. package/dist/tests/cases/integration/graphQlDb/update/invalidInput.test.js.map +1 -1
  103. package/dist/tests/cases/integration/graphQlDb/update/nullChecksNotNull.test.js +7 -7
  104. package/dist/tests/cases/integration/graphQlDb/update/nullChecksNotNull.test.js.map +1 -1
  105. package/dist/tests/cases/integration/graphQlDb/update/nullChecksNullable.test.js +7 -7
  106. package/dist/tests/cases/integration/graphQlDb/update/nullChecksNullable.test.js.map +1 -1
  107. package/dist/tests/cases/integration/graphQlDb/update/uniqueConstraint.test.js +2 -2
  108. package/dist/tests/cases/integration/graphQlDb/update/uniqueConstraint.test.js.map +1 -1
  109. package/dist/tests/cases/integration/graphQlRequests/insert/oneHasMany/connect.test.js +3 -3
  110. package/dist/tests/cases/integration/graphQlRequests/insert/oneHasMany/connect.test.js.map +1 -1
  111. package/dist/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.d.ts +2 -0
  112. package/dist/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.d.ts.map +1 -0
  113. package/dist/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.js +67 -0
  114. package/dist/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.js.map +1 -0
  115. package/dist/tests/cases/integration/graphQlRequests/update/acl/aclUpdate.test.js +6 -18
  116. package/dist/tests/cases/integration/graphQlRequests/update/acl/aclUpdate.test.js.map +1 -1
  117. package/dist/tests/cases/integration/graphQlRequests/update/additionalFilter.test.js +3 -4
  118. package/dist/tests/cases/integration/graphQlRequests/update/additionalFilter.test.js.map +1 -1
  119. package/dist/tests/cases/integration/graphQlRequests/update/basic/columnUpdate.test.js +3 -8
  120. package/dist/tests/cases/integration/graphQlRequests/update/basic/columnUpdate.test.js.map +1 -1
  121. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/update.test.js +3 -9
  122. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/update.test.js.map +1 -1
  123. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/upsert.test.js +3 -9
  124. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/upsert.test.js.map +1 -1
  125. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/update.test.js +3 -9
  126. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/update.test.js.map +1 -1
  127. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/upsert.test.js +3 -9
  128. package/dist/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/upsert.test.js.map +1 -1
  129. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/connect.test.js +3 -10
  130. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/connect.test.js.map +1 -1
  131. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/create.test.js +3 -10
  132. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/create.test.js.map +1 -1
  133. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/disconnect.test.js +3 -9
  134. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/disconnect.test.js.map +1 -1
  135. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/update.test.js +3 -9
  136. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/update.test.js.map +1 -1
  137. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/upsert.test.js +6 -18
  138. package/dist/tests/cases/integration/graphQlRequests/update/manyHasOne/upsert.test.js.map +1 -1
  139. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/connect.test.js +3 -11
  140. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/connect.test.js.map +1 -1
  141. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/disconnect.test.js +3 -8
  142. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/disconnect.test.js.map +1 -1
  143. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/update.test.js +3 -6
  144. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/update.test.js.map +1 -1
  145. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/upsert.test.js +3 -6
  146. package/dist/tests/cases/integration/graphQlRequests/update/oneHasMany/upsert.test.js.map +1 -1
  147. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.js +15 -50
  148. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.js.map +1 -1
  149. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/create.test.js +3 -10
  150. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/create.test.js.map +1 -1
  151. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/disconnect.test.js +3 -10
  152. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/disconnect.test.js.map +1 -1
  153. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/update.test.js +3 -6
  154. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/update.test.js.map +1 -1
  155. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/upsert.test.js +3 -7
  156. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/upsert.test.js.map +1 -1
  157. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.js +12 -32
  158. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.js.map +1 -1
  159. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connectOrCreate.test.js +3 -3
  160. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connectOrCreate.test.js.map +1 -1
  161. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.js +6 -20
  162. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.js.map +1 -1
  163. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/disconnect.test.js +3 -10
  164. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/disconnect.test.js.map +1 -1
  165. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/update.test.js +3 -9
  166. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/update.test.js.map +1 -1
  167. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/upsert.test.js +6 -19
  168. package/dist/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/upsert.test.js.map +1 -1
  169. package/dist/tests/cases/integration/graphQlRequests/update/queryPortal.test.js +6 -8
  170. package/dist/tests/cases/integration/graphQlRequests/update/queryPortal.test.js.map +1 -1
  171. package/dist/tests/cases/integration/graphQlRequests/update/transaction.test.js +9 -24
  172. package/dist/tests/cases/integration/graphQlRequests/update/transaction.test.js.map +1 -1
  173. package/dist/tests/cases/integration/graphQlRequests/upsert/basicUpsert.test.js +3 -7
  174. package/dist/tests/cases/integration/graphQlRequests/upsert/basicUpsert.test.js.map +1 -1
  175. package/dist/tests/cases/unit/orderbyHelper.test.js +11 -0
  176. package/dist/tests/cases/unit/orderbyHelper.test.js.map +1 -1
  177. package/dist/tests/src/test.d.ts +1 -0
  178. package/dist/tests/src/test.d.ts.map +1 -1
  179. package/dist/tests/src/test.js +34 -6
  180. package/dist/tests/src/test.js.map +1 -1
  181. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  182. package/package.json +11 -11
  183. package/src/ExecutionContainer.ts +204 -0
  184. package/src/index.ts +24 -1
  185. package/src/mapper/ColumnValue.ts +2 -2
  186. package/src/mapper/EventManager.ts +158 -0
  187. package/src/mapper/JunctionTableManager.ts +50 -32
  188. package/src/mapper/Mapper.ts +39 -21
  189. package/src/mapper/MapperFactory.ts +67 -0
  190. package/src/mapper/Result.ts +2 -1
  191. package/src/mapper/delete/DeleteExecutor.ts +42 -1
  192. package/src/mapper/index.ts +3 -1
  193. package/src/mapper/insert/InsertBuilder.ts +12 -2
  194. package/src/mapper/insert/Inserter.ts +3 -3
  195. package/src/mapper/select/OrderByHelper.ts +2 -1
  196. package/src/mapper/select/RelationFetcher.ts +2 -2
  197. package/src/mapper/update/UpdateBuilder.ts +30 -7
  198. package/src/mapper/update/UpdateBuilderFactory.ts +2 -2
  199. package/src/mapper/update/Updater.ts +6 -11
  200. package/src/resolvers/GraphQlQueryAstFactory.ts +1 -2
  201. package/src/resolvers/MutationResolver.ts +12 -13
  202. package/src/resolvers/ReadResolver.ts +5 -9
  203. package/src/resolvers/ValidationResolver.ts +2 -4
  204. package/src/resolvers/index.ts +0 -1
  205. package/src/schema/CustomTypesProvider.ts +2 -27
  206. package/src/schema/MutationProvider.ts +4 -4
  207. package/src/schema/QueryProvider.ts +3 -3
  208. package/src/tsconfig.json +7 -21
  209. package/src/types.ts +2 -3
  210. package/tests/cases/bugs/bug-update-by-nested-unique.test.ts +3 -5
  211. package/tests/cases/integration/graphQlDb/insert/insertSequence.test.ts +2 -2
  212. package/tests/cases/integration/graphQlDb/update/bug-freeze-connect-missing-one.test.ts +1 -1
  213. package/tests/cases/integration/graphQlDb/update/deferedConstraints.test.ts +9 -9
  214. package/tests/cases/integration/graphQlDb/update/failedDelete.test.ts +3 -3
  215. package/tests/cases/integration/graphQlDb/update/invalidInput.test.ts +2 -2
  216. package/tests/cases/integration/graphQlDb/update/nullChecksNotNull.test.ts +7 -7
  217. package/tests/cases/integration/graphQlDb/update/nullChecksNullable.test.ts +7 -7
  218. package/tests/cases/integration/graphQlDb/update/uniqueConstraint.test.ts +2 -2
  219. package/tests/cases/integration/graphQlRequests/insert/oneHasMany/connect.test.ts +3 -3
  220. package/tests/cases/integration/graphQlRequests/query/sorting/orderBy.test.ts +67 -0
  221. package/tests/cases/integration/graphQlRequests/update/acl/aclUpdate.test.ts +6 -18
  222. package/tests/cases/integration/graphQlRequests/update/additionalFilter.test.ts +3 -4
  223. package/tests/cases/integration/graphQlRequests/update/basic/columnUpdate.test.ts +3 -8
  224. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/update.test.ts +3 -9
  225. package/tests/cases/integration/graphQlRequests/update/manyHasManyInverse/upsert.test.ts +3 -9
  226. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/update.test.ts +3 -9
  227. package/tests/cases/integration/graphQlRequests/update/manyHasManyOwning/upsert.test.ts +3 -9
  228. package/tests/cases/integration/graphQlRequests/update/manyHasOne/connect.test.ts +3 -10
  229. package/tests/cases/integration/graphQlRequests/update/manyHasOne/create.test.ts +3 -10
  230. package/tests/cases/integration/graphQlRequests/update/manyHasOne/disconnect.test.ts +3 -9
  231. package/tests/cases/integration/graphQlRequests/update/manyHasOne/update.test.ts +3 -9
  232. package/tests/cases/integration/graphQlRequests/update/manyHasOne/upsert.test.ts +6 -18
  233. package/tests/cases/integration/graphQlRequests/update/oneHasMany/connect.test.ts +3 -11
  234. package/tests/cases/integration/graphQlRequests/update/oneHasMany/disconnect.test.ts +3 -8
  235. package/tests/cases/integration/graphQlRequests/update/oneHasMany/update.test.ts +3 -6
  236. package/tests/cases/integration/graphQlRequests/update/oneHasMany/upsert.test.ts +3 -6
  237. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.ts +15 -50
  238. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/create.test.ts +3 -10
  239. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/disconnect.test.ts +3 -10
  240. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/update.test.ts +3 -6
  241. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/upsert.test.ts +3 -7
  242. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.ts +12 -32
  243. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connectOrCreate.test.ts +3 -3
  244. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.ts +6 -20
  245. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/disconnect.test.ts +3 -10
  246. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/update.test.ts +3 -9
  247. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/upsert.test.ts +6 -19
  248. package/tests/cases/integration/graphQlRequests/update/queryPortal.test.ts +6 -8
  249. package/tests/cases/integration/graphQlRequests/update/transaction.test.ts +9 -24
  250. package/tests/cases/integration/graphQlRequests/upsert/basicUpsert.test.ts +3 -7
  251. package/tests/cases/unit/orderbyHelper.test.ts +13 -0
  252. package/tests/src/test.ts +38 -15
  253. package/tests/tsconfig.json +3 -9
  254. package/dist/src/mapper/MapperContainer.d.ts +0 -18
  255. package/dist/src/mapper/MapperContainer.d.ts.map +0 -1
  256. package/dist/src/mapper/MapperContainer.js +0 -55
  257. package/dist/src/mapper/MapperContainer.js.map +0 -1
  258. package/dist/src/resolvers/ExecutionContainerFactory.d.ts +0 -24
  259. package/dist/src/resolvers/ExecutionContainerFactory.d.ts.map +0 -1
  260. package/dist/src/resolvers/ExecutionContainerFactory.js +0 -45
  261. package/dist/src/resolvers/ExecutionContainerFactory.js.map +0 -1
  262. package/src/mapper/MapperContainer.ts +0 -142
  263. package/src/resolvers/ExecutionContainerFactory.ts +0 -74
@@ -30,11 +30,10 @@ test('applies a filter', async () => {
30
30
  response: { rows: [{ id: testUuid(1) }] },
31
31
  },
32
32
  {
33
- sql: SQL`with "newdata_" as
34
- (select ? :: text as "name", "root_"."id" from "public"."author" as "root_" where "root_"."id" = ? and "root_"."name" = ?)
35
- update "public"."author" set "name" = "newdata_"."name" from "newdata_" where "author"."id" = "newdata_"."id"`,
33
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id" from "public"."author" as "root_" where "root_"."id" = ? and "root_"."name" = ?)
34
+ update "public"."author" set "name" = "newData_"."name" from "newData_" where "author"."id" = "newData_"."id" returning "name_old__"`,
36
35
  parameters: ['John', testUuid(1), 'Jack'],
37
- response: { rowCount: 1 },
36
+ response: { rows: [{ name_old__: 'Jack' }] },
38
37
  },
39
38
  {
40
39
  sql: SQL`select "root_"."id" as "root_id"
@@ -29,15 +29,10 @@ test('update name', async () => {
29
29
  response: { rows: [{ id: testUuid(1) }] },
30
30
  },
31
31
  {
32
- sql: SQL`with "newData_" as (select
33
- ? :: text as "name",
34
- "root_"."id"
35
- from "public"."author" as "root_"
36
- where "root_"."id" = ?) update "public"."author"
37
- set "name" = "newData_"."name" from "newData_"
38
- where "author"."id" = "newData_"."id"`,
32
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id" from "public"."author" as "root_" where "root_"."id" = ?)
33
+ update "public"."author" set "name" = "newData_"."name" from "newData_" where "author"."id" = "newData_"."id" returning "name_old__"`,
39
34
  parameters: ['John', testUuid(1)],
40
- response: { rowCount: 1 },
35
+ response: { rows: [{ name_old__: 'John' }] },
41
36
  },
42
37
  {
43
38
  sql: SQL`select "root_"."id" as "root_id"
@@ -28,16 +28,10 @@ test('update', async () => {
28
28
  response: { rows: [{ id: testUuid(1) }] },
29
29
  },
30
30
  {
31
- sql: SQL`with "newData_" as
32
- (select
33
- ? :: text as "title",
34
- "root_"."id"
35
- from "public"."post" as "root_"
36
- where "root_"."id" = ?) update "public"."post"
37
- set "title" = "newData_"."title" from "newData_"
38
- where "post"."id" = "newData_"."id"`,
31
+ sql: SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?)
32
+ update "public"."post" set "title" = "newData_"."title" from "newData_" where "post"."id" = "newData_"."id" returning "title_old__"`,
39
33
  parameters: ['Lorem', testUuid(1)],
40
- response: { rowCount: 1 },
34
+ response: { rows: [{ title_old__: 'Foo bar' }] },
41
35
  },
42
36
  {
43
37
  sql: SQL`insert into "public"."post_categories" ("post_id", "category_id")
@@ -28,16 +28,10 @@ test('upsert - exists', async () => {
28
28
  response: { rows: [{ id: testUuid(1) }] },
29
29
  },
30
30
  {
31
- sql: SQL`with "newData_" as
32
- (select
33
- ? :: text as "title",
34
- "root_"."id"
35
- from "public"."post" as "root_"
36
- where "root_"."id" = ?) update "public"."post"
37
- set "title" = "newData_"."title" from "newData_"
38
- where "post"."id" = "newData_"."id"`,
31
+ sql: SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?)
32
+ update "public"."post" set "title" = "newData_"."title" from "newData_" where "post"."id" = "newData_"."id" returning "title_old__"`,
39
33
  parameters: ['Lorem', testUuid(1)],
40
- response: { rowCount: 1 },
34
+ response: { rows: [{ title_old__: 'Foo' }] },
41
35
  },
42
36
  {
43
37
  sql: SQL`insert into "public"."post_categories" ("post_id", "category_id")
@@ -28,16 +28,10 @@ test('update', async () => {
28
28
  response: { rows: [{ id: testUuid(1) }] },
29
29
  },
30
30
  {
31
- sql: SQL`with "newData_" as
32
- (select
33
- ? :: text as "name",
34
- "root_"."id"
35
- from "public"."category" as "root_"
36
- where "root_"."id" = ?) update "public"."category"
37
- set "name" = "newData_"."name" from "newData_"
38
- where "category"."id" = "newData_"."id"`,
31
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id" from "public"."category" as "root_" where "root_"."id" = ?)
32
+ update "public"."category" set "name" = "newData_"."name" from "newData_" where "category"."id" = "newData_"."id" returning "name_old__"`,
39
33
  parameters: ['Lorem', testUuid(1)],
40
- response: { rowCount: 1 },
34
+ response: { rows: [{ name_old__: 'Foo' }] },
41
35
  },
42
36
  {
43
37
  sql: SQL`insert into "public"."post_categories" ("post_id", "category_id")
@@ -28,16 +28,10 @@ test('upsert - exists', async () => {
28
28
  response: { rows: [{ id: testUuid(1) }] },
29
29
  },
30
30
  {
31
- sql: SQL`with "newData_" as
32
- (select
33
- ? :: text as "name",
34
- "root_"."id"
35
- from "public"."category" as "root_"
36
- where "root_"."id" = ?) update "public"."category"
37
- set "name" = "newData_"."name" from "newData_"
38
- where "category"."id" = "newData_"."id"`,
31
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id" from "public"."category" as "root_" where "root_"."id" = ?)
32
+ update "public"."category" set "name" = "newData_"."name" from "newData_" where "category"."id" = "newData_"."id" returning "name_old__"`,
39
33
  parameters: ['Lorem', testUuid(1)],
40
- response: { rowCount: 1 },
34
+ response: { rows: [{ name_old__: 'Foo' }] },
41
35
  },
42
36
  {
43
37
  sql: SQL`insert into "public"."post_categories" ("post_id", "category_id")
@@ -28,17 +28,10 @@ test('connect', async () => {
28
28
  response: { rows: [{ id: testUuid(1) }] },
29
29
  },
30
30
  {
31
- sql: SQL`with "newData_" as
32
- (select
33
- ? :: uuid as "author_id",
34
- "root_"."id",
35
- "root_"."title"
36
- from "public"."post" as "root_"
37
- where "root_"."id" = ?) update "public"."post"
38
- set "author_id" = "newData_"."author_id" from "newData_"
39
- where "post"."id" = "newData_"."id"`,
31
+ sql: SQL`with "newData_" as (select ? :: uuid as "author_id", "root_"."author_id" as "author_id_old__", "root_"."id", "root_"."title" from "public"."post" as "root_" where "root_"."id" = ?)
32
+ update "public"."post" set "author_id" = "newData_"."author_id" from "newData_" where "post"."id" = "newData_"."id" returning "author_id_old__"`,
40
33
  parameters: [testUuid(1), testUuid(2)],
41
- response: { rowCount: 1 },
34
+ response: { rows: [{ author_id_old__: testUuid(99) }] },
42
35
  },
43
36
  ]),
44
37
  ],
@@ -39,17 +39,10 @@ test('create', async () => {
39
39
  },
40
40
 
41
41
  {
42
- sql: SQL`with "newData_" as
43
- (select
44
- ? :: uuid as "author_id",
45
- "root_"."id",
46
- "root_"."title"
47
- from "public"."post" as "root_"
48
- where "root_"."id" = ?) update "public"."post"
49
- set "author_id" = "newData_"."author_id" from "newData_"
50
- where "post"."id" = "newData_"."id"`,
42
+ sql: SQL`with "newData_" as (select ? :: uuid as "author_id", "root_"."author_id" as "author_id_old__", "root_"."id", "root_"."title" from "public"."post" as "root_" where "root_"."id" = ?)
43
+ update "public"."post" set "author_id" = "newData_"."author_id" from "newData_" where "post"."id" = "newData_"."id" returning "author_id_old__"`,
51
44
  parameters: [testUuid(1), testUuid(2)],
52
- response: { rowCount: 1 },
45
+ response: { rows: [{ author_id_old__: testUuid(99) }] },
53
46
  },
54
47
  ]),
55
48
  ],
@@ -23,16 +23,10 @@ test('disconnect', async () => {
23
23
  response: { rows: [{ id: testUuid(2) }] },
24
24
  },
25
25
  {
26
- sql: SQL`with "newData_" as
27
- (select
28
- ? :: uuid as "author_id",
29
- "root_"."id"
30
- from "public"."post" as "root_"
31
- where "root_"."id" = ?) update "public"."post"
32
- set "author_id" = "newData_"."author_id" from "newData_"
33
- where "post"."id" = "newData_"."id"`,
26
+ sql: SQL`with "newData_" as (select ? :: uuid as "author_id", "root_"."author_id" as "author_id_old__", "root_"."id" from "public"."post" as "root_" where "root_"."id" = ?)
27
+ update "public"."post" set "author_id" = "newData_"."author_id" from "newData_" where "post"."id" = "newData_"."id" returning "author_id_old__"`,
34
28
  parameters: [null, testUuid(2)],
35
- response: { rowCount: 1 },
29
+ response: { rows: [{ author_id_old__: testUuid(99) }] },
36
30
  },
37
31
  ]),
38
32
  ],
@@ -37,16 +37,10 @@ test('update', async () => {
37
37
  response: { rows: [{ id: testUuid(1) }] },
38
38
  },
39
39
  {
40
- sql: SQL`with "newData_" as
41
- (select
42
- ? :: text as "name",
43
- "root_"."id"
44
- from "public"."author" as "root_"
45
- where "root_"."id" = ?) update "public"."author"
46
- set "name" = "newData_"."name" from "newData_"
47
- where "author"."id" = "newData_"."id"`,
40
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id" from "public"."author" as "root_" where "root_"."id" = ?)
41
+ update "public"."author" set "name" = "newData_"."name" from "newData_" where "author"."id" = "newData_"."id" returning "name_old__"`,
48
42
  parameters: ['John', testUuid(1)],
49
- response: { rowCount: 1 },
43
+ response: { rows: [{ name_old__: 'Jack' }] },
50
44
  },
51
45
  ]),
52
46
  ],
@@ -37,15 +37,10 @@ test('upsert - exists', async () => {
37
37
  response: { rows: [{ id: testUuid(1) }] },
38
38
  },
39
39
  {
40
- sql: SQL`with "newData_" as (select
41
- ? :: text as "name",
42
- "root_"."id"
43
- from "public"."author" as "root_"
44
- where "root_"."id" = ?) update "public"."author"
45
- set "name" = "newData_"."name" from "newData_"
46
- where "author"."id" = "newData_"."id"`,
40
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id" from "public"."author" as "root_" where "root_"."id" = ?)
41
+ update "public"."author" set "name" = "newData_"."name" from "newData_" where "author"."id" = "newData_"."id" returning "name_old__"`,
47
42
  parameters: ['Jack', testUuid(1)],
48
- response: { rowCount: 1 },
43
+ response: { rows: [{ name_old__: 'John' }] },
49
44
  },
50
45
  ]),
51
46
  ],
@@ -97,17 +92,10 @@ test('upsert - not exists', async () => {
97
92
  response: { rows: [{ id: testUuid(1) }] },
98
93
  },
99
94
  {
100
- sql: SQL`with "newData_" as
101
- (select
102
- ? :: uuid as "author_id",
103
- "root_"."id",
104
- "root_"."title"
105
- from "public"."post" as "root_"
106
- where "root_"."id" = ?) update "public"."post"
107
- set "author_id" = "newData_"."author_id" from "newData_"
108
- where "post"."id" = "newData_"."id"`,
95
+ sql: SQL`with "newData_" as (select ? :: uuid as "author_id", "root_"."author_id" as "author_id_old__", "root_"."id", "root_"."title" from "public"."post" as "root_" where "root_"."id" = ?)
96
+ update "public"."post" set "author_id" = "newData_"."author_id" from "newData_" where "post"."id" = "newData_"."id" returning "author_id_old__"`,
109
97
  parameters: [testUuid(1), testUuid(2)],
110
- response: { rowCount: 1 },
98
+ response: { rows: [{ author_id_old__: null }] },
111
99
  },
112
100
  ]),
113
101
  ],
@@ -28,18 +28,10 @@ test('connect', async () => {
28
28
  response: { rows: [{ id: testUuid(1) }] },
29
29
  },
30
30
  {
31
- sql: SQL`with "newData_" as
32
- (select
33
- ? :: uuid as "post_id",
34
- "root_"."id",
35
- "root_"."title",
36
- "root_"."locale"
37
- from "public"."post_locale" as "root_"
38
- where "root_"."id" = ?) update "public"."post_locale"
39
- set "post_id" = "newData_"."post_id" from "newData_"
40
- where "post_locale"."id" = "newData_"."id"`,
31
+ sql: SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
32
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
41
33
  parameters: [testUuid(2), testUuid(1)],
42
- response: { rowCount: 1 },
34
+ response: { rows: [{ post_id__old: testUuid(99) }] },
43
35
  },
44
36
  ]),
45
37
  ],
@@ -28,15 +28,10 @@ test('disconnect', async () => {
28
28
  response: { rows: [{ id: testUuid(1) }] },
29
29
  },
30
30
  {
31
- sql: SQL`
32
- with "newData_" as
33
- (select ? :: uuid as "post_id", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
34
- update "public"."post_locale"
35
- set "post_id" = "newData_"."post_id"
36
- from "newData_" where "post_locale"."id" = "newData_"."id"
37
- `,
31
+ sql: SQL`with "newData_" as (select ? :: uuid as "post_id", "root_"."post_id" as "post_id_old__", "root_"."id", "root_"."title", "root_"."locale" from "public"."post_locale" as "root_" where "root_"."id" = ?)
32
+ update "public"."post_locale" set "post_id" = "newData_"."post_id" from "newData_" where "post_locale"."id" = "newData_"."id" returning "post_id_old__"`,
38
33
  parameters: [null, testUuid(1)],
39
- response: { rowCount: 1 },
34
+ response: { rows: [{ post_id_old__: testUuid(99) }] },
40
35
  },
41
36
  ]),
42
37
  ],
@@ -32,13 +32,10 @@ test('update (composed unique)', async () => {
32
32
  },
33
33
  },
34
34
  {
35
- sql: SQL`
36
- with "newData_" as
37
- (select ? :: text as "title", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
38
- update "public"."post_locale" set "title" = "newData_"."title"
39
- from "newData_" where "post_locale"."id" = "newData_"."id"`,
35
+ sql: SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
36
+ update "public"."post_locale" set "title" = "newData_"."title" from "newData_" where "post_locale"."id" = "newData_"."id" returning "title_old__"`,
40
37
  parameters: ['Hello', testUuid(1)],
41
- response: { rowCount: 1 },
38
+ response: { rows: [{ title_old__: 'Hi' }] },
42
39
  },
43
40
  ]),
44
41
  ],
@@ -32,13 +32,10 @@ test('upsert - exists (composed unique)', async () => {
32
32
  },
33
33
  },
34
34
  {
35
- sql: SQL`
36
- with "newData_" as
37
- (select ? :: text as "title", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
38
- update "public"."post_locale" set "title" = "newData_"."title"
39
- from "newData_" where "post_locale"."id" = "newData_"."id"`,
35
+ sql: SQL`with "newData_" as (select ? :: text as "title", "root_"."title" as "title_old__", "root_"."id", "root_"."locale", "root_"."post_id" from "public"."post_locale" as "root_" where "root_"."id" = ?)
36
+ update "public"."post_locale" set "title" = "newData_"."title" from "newData_" where "post_locale"."id" = "newData_"."id" returning "title_old__"`,
40
37
  parameters: ['Hello', testUuid(1)],
41
- response: { rowCount: 1 },
38
+ response: { rows: [{ title_old__: 'Foo' }] },
42
39
  },
43
40
  ]),
44
41
  ],
@@ -84,17 +84,10 @@ test('connect - no owner', async () => {
84
84
  },
85
85
  },
86
86
  {
87
- sql: SQL`with "newData_" as
88
- (select
89
- ? :: uuid as "setting_id",
90
- "root_"."id",
91
- "root_"."name"
92
- from "public"."site" as "root_"
93
- where "root_"."id" = ?) update "public"."site"
94
- set "setting_id" = "newData_"."setting_id" from "newData_"
95
- where "site"."id" = "newData_"."id"`,
87
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
88
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
96
89
  parameters: [testUuid(2), testUuid(1)],
97
- response: { rowCount: 1 },
90
+ response: { rows: [{}] },
98
91
  },
99
92
  ]),
100
93
  ],
@@ -143,30 +136,16 @@ test('connect - different owner', async () => {
143
136
  },
144
137
  },
145
138
  {
146
- sql: SQL`with "newData_" as
147
- (select
148
- ? :: uuid as "setting_id",
149
- "root_"."id",
150
- "root_"."name"
151
- from "public"."site" as "root_"
152
- where "root_"."id" = ?) update "public"."site"
153
- set "setting_id" = "newData_"."setting_id" from "newData_"
154
- where "site"."id" = "newData_"."id"`,
139
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
140
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
155
141
  parameters: [null, testUuid(3)],
156
- response: { rowCount: 1 },
142
+ response: { rows: [{}] },
157
143
  },
158
144
  {
159
- sql: SQL`with "newData_" as
160
- (select
161
- ? :: uuid as "setting_id",
162
- "root_"."id",
163
- "root_"."name"
164
- from "public"."site" as "root_"
165
- where "root_"."id" = ?) update "public"."site"
166
- set "setting_id" = "newData_"."setting_id" from "newData_"
167
- where "site"."id" = "newData_"."id"`,
145
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
146
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
168
147
  parameters: [testUuid(2), testUuid(1)],
169
- response: { rowCount: 1 },
148
+ response: { rows: [{}] },
170
149
  },
171
150
  ]),
172
151
  ],
@@ -219,17 +198,10 @@ test('connect - different owner & orphan removal enabled', async () => {
219
198
  },
220
199
  // set current owner to null
221
200
  {
222
- sql: SQL`with "newData_" as
223
- (select
224
- ? :: uuid as "setting_id",
225
- "root_"."id",
226
- "root_"."name"
227
- from "public"."site" as "root_"
228
- where "root_"."id" = ?) update "public"."site"
229
- set "setting_id" = "newData_"."setting_id" from "newData_"
230
- where "site"."id" = "newData_"."id"`,
201
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
202
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
231
203
  parameters: [null, testUuid(3)],
232
- response: { rowCount: 1 },
204
+ response: { rows: [{}] },
233
205
  },
234
206
  // current inverse of new owner
235
207
  {
@@ -239,17 +211,10 @@ test('connect - different owner & orphan removal enabled', async () => {
239
211
  },
240
212
  // update inverse of new owner
241
213
  {
242
- sql: SQL`with "newData_" as
243
- (select
244
- ? :: uuid as "setting_id",
245
- "root_"."id",
246
- "root_"."name"
247
- from "public"."site" as "root_"
248
- where "root_"."id" = ?) update "public"."site"
249
- set "setting_id" = "newData_"."setting_id" from "newData_"
250
- where "site"."id" = "newData_"."id"`,
214
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
215
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
251
216
  parameters: [testUuid(2), testUuid(1)],
252
- response: { rowCount: 1 },
217
+ response: { rows: [{}] },
253
218
  },
254
219
  {
255
220
  sql: 'select "root_"."id" from "public"."site_setting" as "root_" where "root_"."id" = ?',
@@ -49,17 +49,10 @@ test('create', async () => {
49
49
  },
50
50
  },
51
51
  {
52
- sql: SQL`with "newData_" as
53
- (select
54
- ? :: uuid as "setting_id",
55
- "root_"."id",
56
- "root_"."name"
57
- from "public"."site" as "root_"
58
- where "root_"."id" = ?) update "public"."site"
59
- set "setting_id" = "newData_"."setting_id" from "newData_"
60
- where "site"."id" = "newData_"."id"`,
52
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
53
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
61
54
  parameters: [null, oldSiteId],
62
- response: { rowCount: 1 },
55
+ response: { rows: [{ setting_id_old__: testUuid(99) }] },
63
56
  },
64
57
  {
65
58
  sql: SQL`with "root_" as
@@ -34,17 +34,10 @@ test('disconnect', async () => {
34
34
  },
35
35
  },
36
36
  {
37
- sql: SQL`with "newData_" as
38
- (select
39
- ? :: uuid as "setting_id",
40
- "root_"."id",
41
- "root_"."name"
42
- from "public"."site" as "root_"
43
- where "root_"."id" = ?) update "public"."site"
44
- set "setting_id" = "newData_"."setting_id" from "newData_"
45
- where "site"."id" = "newData_"."id"`,
37
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
38
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
46
39
  parameters: [null, siteId],
47
- response: { rowCount: 1 },
40
+ response: { rows: [{ setting_id_old__: testUuid(99) }] },
48
41
  },
49
42
  ]),
50
43
  ],
@@ -32,13 +32,10 @@ test('update', async () => {
32
32
  },
33
33
  },
34
34
  {
35
- sql: SQL`
36
- with "newData_" as
37
- (select ? :: text as "name", "root_"."id", "root_"."setting_id" from "public"."site" as "root_" where "root_"."id" = ?)
38
- update "public"."site" set "name" = "newData_"."name"
39
- from "newData_" where "site"."id" = "newData_"."id"`,
35
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id", "root_"."setting_id" from "public"."site" as "root_" where "root_"."id" = ?)
36
+ update "public"."site" set "name" = "newData_"."name" from "newData_" where "site"."id" = "newData_"."id" returning "name_old__"`,
40
37
  parameters: ['Mangoweb', testUuid(1)],
41
- response: { rowCount: 1 },
38
+ response: { rows: [{ name_old__: 'Foo' }] },
42
39
  },
43
40
  ]),
44
41
  ],
@@ -32,14 +32,10 @@ test('upsert - exists', async () => {
32
32
  },
33
33
  },
34
34
  {
35
- sql: SQL`
36
- with "newData_" as
37
- (select ? :: text as "name", "root_"."id", "root_"."setting_id" from "public"."site" as "root_" where "root_"."id" = ?)
38
- update "public"."site" set "name" = "newData_"."name"
39
- from "newData_" where "site"."id" = "newData_"."id"
40
- `,
35
+ sql: SQL`with "newData_" as (select ? :: text as "name", "root_"."name" as "name_old__", "root_"."id", "root_"."setting_id" from "public"."site" as "root_" where "root_"."id" = ?)
36
+ update "public"."site" set "name" = "newData_"."name" from "newData_" where "site"."id" = "newData_"."id" returning "name_old__"`,
41
37
  parameters: ['Mangoweb', testUuid(1)],
42
- response: { rowCount: 1 },
38
+ response: { rows: [{ name_old__: 'XX' }] },
43
39
  },
44
40
  ]),
45
41
  ],
@@ -81,17 +81,10 @@ test('connect - no owner', async () => {
81
81
  },
82
82
  },
83
83
  {
84
- sql: SQL`with "newData_" as
85
- (select
86
- ? :: uuid as "setting_id",
87
- "root_"."id",
88
- "root_"."name"
89
- from "public"."site" as "root_"
90
- where "root_"."id" = ?) update "public"."site"
91
- set "setting_id" = "newData_"."setting_id" from "newData_"
92
- where "site"."id" = "newData_"."id"`,
84
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
85
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
93
86
  parameters: [testUuid(1), testUuid(2)],
94
- response: { rowCount: 1 },
87
+ response: { rows: [{}] },
95
88
  },
96
89
  ]),
97
90
  ],
@@ -138,30 +131,16 @@ test('connect - different owner', async () => {
138
131
  },
139
132
  },
140
133
  {
141
- sql: SQL`with "newData_" as
142
- (select
143
- ? :: uuid as "setting_id",
144
- "root_"."id",
145
- "root_"."name"
146
- from "public"."site" as "root_"
147
- where "root_"."id" = ?) update "public"."site"
148
- set "setting_id" = "newData_"."setting_id" from "newData_"
149
- where "site"."id" = "newData_"."id"`,
134
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
135
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
150
136
  parameters: [null, testUuid(3)],
151
- response: { rowCount: 1 },
137
+ response: { rows: [{}] },
152
138
  },
153
139
  {
154
- sql: SQL`with "newData_" as
155
- (select
156
- ? :: uuid as "setting_id",
157
- "root_"."id",
158
- "root_"."name"
159
- from "public"."site" as "root_"
160
- where "root_"."id" = ?) update "public"."site"
161
- set "setting_id" = "newData_"."setting_id" from "newData_"
162
- where "site"."id" = "newData_"."id"`,
140
+ sql: SQL`with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
141
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
163
142
  parameters: [testUuid(1), testUuid(2)],
164
- response: { rowCount: 1 },
143
+ response: { rows: [{}] },
165
144
  },
166
145
  ]),
167
146
  ],
@@ -216,9 +195,10 @@ test('connect - orphan removal', async () => {
216
195
  response: { rows: [] },
217
196
  },
218
197
  {
219
- sql: 'with "newData_" as (select ? :: uuid as "setting_id", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?) update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id"',
198
+ sql: `with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
199
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
220
200
  parameters: [settingId, siteId],
221
- response: { rowCount: 1 },
201
+ response: { rows: [{ settng_id_old__: testUuid(99) }] },
222
202
  },
223
203
  {
224
204
  sql: 'select "root_"."id" from "public"."site_setting" as "root_" where "root_"."id" = ?',
@@ -33,10 +33,10 @@ test('connect or create', async () => {
33
33
  response: { rows: [] },
34
34
  },
35
35
  {
36
- sql: `with "newData_" as (select ? :: uuid as "setting_id", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
37
- update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id"`,
36
+ sql: `with "newData_" as (select ? :: uuid as "setting_id", "root_"."setting_id" as "setting_id_old__", "root_"."id", "root_"."name" from "public"."site" as "root_" where "root_"."id" = ?)
37
+ update "public"."site" set "setting_id" = "newData_"."setting_id" from "newData_" where "site"."id" = "newData_"."id" returning "setting_id_old__"`,
38
38
  parameters: [testUuid(3), testUuid(2)],
39
- response: { rowCount: 1 },
39
+ response: { rows: [{ setting_id_old__: testUuid(99) }] },
40
40
  },
41
41
  ]),
42
42
  ],