@budibase/server 1.0.49-alpha.8 → 1.0.50

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 (191) hide show
  1. package/builder/assets/{index.83c0944f.css → index.c0cc369d.css} +6 -1
  2. package/builder/assets/{index.94a9250f.js → index.ee035348.js} +190 -190
  3. package/builder/assets/{vendor.d526bfe8.js → vendor.5ad9695a.js} +202 -106
  4. package/builder/index.html +3 -3
  5. package/coverage/clover.xml +140 -144
  6. package/coverage/coverage-final.json +3 -3
  7. package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
  8. package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
  9. package/coverage/lcov-report/api/controllers/application.js.html +1 -1
  10. package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
  11. package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
  12. package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
  13. package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
  14. package/coverage/lcov-report/api/controllers/component.js.html +4 -4
  15. package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
  16. package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
  17. package/coverage/lcov-report/api/controllers/index.html +14 -14
  18. package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
  19. package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
  20. package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
  21. package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
  22. package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
  23. package/coverage/lcov-report/api/controllers/query/index.html +1 -1
  24. package/coverage/lcov-report/api/controllers/query/index.js.html +1 -1
  25. package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
  26. package/coverage/lcov-report/api/controllers/role.js.html +1 -1
  27. package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
  28. package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
  29. package/coverage/lcov-report/api/controllers/row/index.html +1 -1
  30. package/coverage/lcov-report/api/controllers/row/index.js.html +1 -1
  31. package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
  32. package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
  33. package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
  34. package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
  35. package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
  36. package/coverage/lcov-report/api/controllers/script.js.html +1 -1
  37. package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
  38. package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
  39. package/coverage/lcov-report/api/controllers/table/index.html +1 -1
  40. package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
  41. package/coverage/lcov-report/api/controllers/table/internal.js.html +1 -1
  42. package/coverage/lcov-report/api/controllers/table/utils.js.html +1 -1
  43. package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
  44. package/coverage/lcov-report/api/controllers/user.js.html +41 -35
  45. package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
  46. package/coverage/lcov-report/api/controllers/view/index.html +1 -1
  47. package/coverage/lcov-report/api/controllers/view/index.js.html +1 -1
  48. package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
  49. package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
  50. package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
  51. package/coverage/lcov-report/api/index.html +1 -1
  52. package/coverage/lcov-report/api/index.js.html +1 -1
  53. package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
  54. package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
  55. package/coverage/lcov-report/api/routes/application.js.html +1 -1
  56. package/coverage/lcov-report/api/routes/auth.js.html +1 -1
  57. package/coverage/lcov-report/api/routes/automation.js.html +1 -1
  58. package/coverage/lcov-report/api/routes/backup.js.html +1 -1
  59. package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
  60. package/coverage/lcov-report/api/routes/component.js.html +1 -1
  61. package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
  62. package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
  63. package/coverage/lcov-report/api/routes/dev.js.html +1 -1
  64. package/coverage/lcov-report/api/routes/index.html +1 -1
  65. package/coverage/lcov-report/api/routes/index.js.html +1 -1
  66. package/coverage/lcov-report/api/routes/integration.js.html +1 -1
  67. package/coverage/lcov-report/api/routes/layout.js.html +1 -1
  68. package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
  69. package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
  70. package/coverage/lcov-report/api/routes/permission.js.html +1 -1
  71. package/coverage/lcov-report/api/routes/query.js.html +1 -1
  72. package/coverage/lcov-report/api/routes/role.js.html +1 -1
  73. package/coverage/lcov-report/api/routes/routing.js.html +1 -1
  74. package/coverage/lcov-report/api/routes/row.js.html +1 -1
  75. package/coverage/lcov-report/api/routes/screen.js.html +1 -1
  76. package/coverage/lcov-report/api/routes/script.js.html +1 -1
  77. package/coverage/lcov-report/api/routes/static.js.html +1 -1
  78. package/coverage/lcov-report/api/routes/table.js.html +1 -1
  79. package/coverage/lcov-report/api/routes/templates.js.html +1 -1
  80. package/coverage/lcov-report/api/routes/user.js.html +1 -1
  81. package/coverage/lcov-report/api/routes/view.js.html +1 -1
  82. package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
  83. package/coverage/lcov-report/automations/actions.js.html +1 -1
  84. package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
  85. package/coverage/lcov-report/automations/bullboard.js.html +1 -1
  86. package/coverage/lcov-report/automations/index.html +1 -1
  87. package/coverage/lcov-report/automations/index.js.html +1 -1
  88. package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
  89. package/coverage/lcov-report/automations/steps/createRow.js.html +1 -1
  90. package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
  91. package/coverage/lcov-report/automations/steps/deleteRow.js.html +1 -1
  92. package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
  93. package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
  94. package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
  95. package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
  96. package/coverage/lcov-report/automations/steps/index.html +1 -1
  97. package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
  98. package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
  99. package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
  100. package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
  101. package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
  102. package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
  103. package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
  104. package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
  105. package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
  106. package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
  107. package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
  108. package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
  109. package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
  110. package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
  111. package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
  112. package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
  113. package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
  114. package/coverage/lcov-report/automations/triggers.js.html +1 -1
  115. package/coverage/lcov-report/automations/utils.js.html +1 -1
  116. package/coverage/lcov-report/constants/index.html +1 -1
  117. package/coverage/lcov-report/constants/index.js.html +1 -1
  118. package/coverage/lcov-report/constants/layouts.js.html +1 -1
  119. package/coverage/lcov-report/constants/screens.js.html +1 -1
  120. package/coverage/lcov-report/db/client.js.html +1 -1
  121. package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
  122. package/coverage/lcov-report/db/index.html +1 -1
  123. package/coverage/lcov-report/db/index.js.html +1 -1
  124. package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
  125. package/coverage/lcov-report/db/linkedRows/index.html +1 -1
  126. package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
  127. package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +1 -1
  128. package/coverage/lcov-report/db/newid.js.html +1 -1
  129. package/coverage/lcov-report/db/utils.js.html +1 -1
  130. package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
  131. package/coverage/lcov-report/events/index.html +1 -1
  132. package/coverage/lcov-report/events/index.js.html +1 -1
  133. package/coverage/lcov-report/events/utils.js.html +1 -1
  134. package/coverage/lcov-report/index.html +22 -22
  135. package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
  136. package/coverage/lcov-report/integrations/tests/index.html +1 -1
  137. package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
  138. package/coverage/lcov-report/middleware/authorized.js.html +1 -1
  139. package/coverage/lcov-report/middleware/builder.js.html +1 -1
  140. package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
  141. package/coverage/lcov-report/middleware/index.html +1 -1
  142. package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
  143. package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
  144. package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
  145. package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
  146. package/coverage/lcov-report/middleware/utils.js.html +1 -1
  147. package/coverage/lcov-report/threads/automation.js.html +1 -1
  148. package/coverage/lcov-report/threads/index.html +14 -14
  149. package/coverage/lcov-report/threads/index.js.html +1 -1
  150. package/coverage/lcov-report/threads/query.js.html +10 -31
  151. package/coverage/lcov-report/threads/utils.js.html +1 -1
  152. package/coverage/lcov-report/utilities/bcrypt.js.html +1 -1
  153. package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
  154. package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
  155. package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
  156. package/coverage/lcov-report/utilities/global.js.html +1 -1
  157. package/coverage/lcov-report/utilities/index.html +1 -1
  158. package/coverage/lcov-report/utilities/index.js.html +1 -1
  159. package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
  160. package/coverage/lcov-report/utilities/queue/index.html +1 -1
  161. package/coverage/lcov-report/utilities/routing/index.html +1 -1
  162. package/coverage/lcov-report/utilities/routing/index.js.html +1 -1
  163. package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
  164. package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
  165. package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
  166. package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
  167. package/coverage/lcov-report/utilities/security.js.html +1 -1
  168. package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
  169. package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
  170. package/coverage/lcov-report/utilities/usageQuota/index.js.html +1 -1
  171. package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
  172. package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
  173. package/coverage/lcov-report/utilities/users.js.html +1 -1
  174. package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
  175. package/coverage/lcov.info +225 -231
  176. package/dist/api/controllers/row/ExternalRequest.js +14 -4
  177. package/dist/api/controllers/static/index.js +4 -7
  178. package/dist/api/controllers/user.js +27 -25
  179. package/dist/integrations/base/sql.js +49 -15
  180. package/dist/package.json +4 -4
  181. package/dist/threads/query.js +2 -8
  182. package/dist/tsconfig.tsbuildinfo +1 -1
  183. package/package.json +5 -5
  184. package/scripts/integrations/mssql/data/Dockerfile +1 -1
  185. package/scripts/integrations/mssql/data/setup.sql +17 -4
  186. package/scripts/integrations/postgres/init.sql +11 -6
  187. package/src/api/controllers/row/ExternalRequest.ts +14 -1
  188. package/src/api/controllers/static/index.js +4 -6
  189. package/src/api/controllers/user.js +29 -27
  190. package/src/integrations/base/sql.ts +61 -22
  191. package/src/threads/query.js +2 -9
@@ -825,15 +825,15 @@ DA:13,1
825
825
  DA:19,1
826
826
  DA:20,1
827
827
  DA:21,1
828
- DA:22,50
828
+ DA:22,51
829
829
  DA:23,1
830
- DA:25,49
831
- DA:26,49
830
+ DA:25,50
831
+ DA:26,50
832
832
  DA:33,1
833
833
  LF:17
834
834
  LH:17
835
835
  BRDA:22,0,0,1
836
- BRDA:22,0,1,49
836
+ BRDA:22,0,1,50
837
837
  BRF:2
838
838
  BRH:2
839
839
  end_of_record
@@ -1741,15 +1741,16 @@ FN:58,(anonymous_4)
1741
1741
  FN:72,(anonymous_5)
1742
1742
  FN:98,(anonymous_6)
1743
1743
  FN:99,(anonymous_7)
1744
- FN:143,(anonymous_8)
1745
- FN:150,(anonymous_9)
1746
- FN:163,(anonymous_10)
1747
- FN:173,(anonymous_11)
1748
- FN:185,(anonymous_12)
1749
- FN:198,(anonymous_13)
1750
- FN:202,(anonymous_14)
1751
- FN:221,(anonymous_15)
1752
- FNF:16
1744
+ FN:108,(anonymous_8)
1745
+ FN:145,(anonymous_9)
1746
+ FN:152,(anonymous_10)
1747
+ FN:165,(anonymous_11)
1748
+ FN:175,(anonymous_12)
1749
+ FN:187,(anonymous_13)
1750
+ FN:200,(anonymous_14)
1751
+ FN:204,(anonymous_15)
1752
+ FN:223,(anonymous_16)
1753
+ FNF:17
1753
1754
  FNH:5
1754
1755
  FNDA:2,rawMetadata
1755
1756
  FNDA:0,(anonymous_1)
@@ -1759,14 +1760,15 @@ FNDA:0,(anonymous_4)
1759
1760
  FNDA:0,(anonymous_5)
1760
1761
  FNDA:0,(anonymous_6)
1761
1762
  FNDA:0,(anonymous_7)
1762
- FNDA:2,(anonymous_8)
1763
- FNDA:0,(anonymous_9)
1763
+ FNDA:0,(anonymous_8)
1764
+ FNDA:2,(anonymous_9)
1764
1765
  FNDA:0,(anonymous_10)
1765
- FNDA:1,(anonymous_11)
1766
+ FNDA:0,(anonymous_11)
1766
1767
  FNDA:1,(anonymous_12)
1767
1768
  FNDA:1,(anonymous_13)
1768
- FNDA:0,(anonymous_14)
1769
+ FNDA:1,(anonymous_14)
1769
1770
  FNDA:0,(anonymous_15)
1771
+ FNDA:0,(anonymous_16)
1770
1772
  DA:5,39
1771
1773
  DA:6,39
1772
1774
  DA:7,39
@@ -1826,67 +1828,68 @@ DA:105,0
1826
1828
  DA:106,0
1827
1829
  DA:108,0
1828
1830
  DA:109,0
1829
- DA:111,0
1831
+ DA:110,0
1830
1832
  DA:112,0
1831
- DA:114,0
1833
+ DA:113,0
1832
1834
  DA:115,0
1833
- DA:117,0
1834
- DA:122,0
1835
+ DA:116,0
1836
+ DA:118,0
1835
1837
  DA:123,0
1836
- DA:125,0
1837
- DA:133,0
1838
+ DA:124,0
1839
+ DA:126,0
1838
1840
  DA:134,0
1839
- DA:138,0
1840
- DA:143,39
1841
- DA:144,2
1842
- DA:145,2
1841
+ DA:135,0
1842
+ DA:140,0
1843
+ DA:145,39
1843
1844
  DA:146,2
1844
1845
  DA:147,2
1845
1846
  DA:148,2
1846
- DA:150,7
1847
+ DA:149,2
1848
+ DA:150,2
1847
1849
  DA:152,7
1848
- DA:160,2
1849
- DA:163,39
1850
- DA:165,0
1850
+ DA:154,7
1851
+ DA:162,2
1852
+ DA:165,39
1851
1853
  DA:167,0
1852
1854
  DA:169,0
1853
- DA:170,0
1854
- DA:173,39
1855
- DA:174,1
1856
- DA:175,1
1855
+ DA:171,0
1856
+ DA:172,0
1857
+ DA:175,39
1858
+ DA:176,1
1857
1859
  DA:177,1
1858
- DA:178,1
1859
- DA:182,1
1860
- DA:185,39
1861
- DA:186,1
1862
- DA:187,1
1860
+ DA:179,1
1861
+ DA:180,1
1862
+ DA:184,1
1863
+ DA:187,39
1863
1864
  DA:188,1
1864
- DA:189,0
1865
- DA:193,1
1866
- DA:198,39
1867
- DA:199,1
1868
- DA:202,39
1869
- DA:203,0
1870
- DA:204,0
1865
+ DA:189,1
1866
+ DA:190,1
1867
+ DA:191,0
1868
+ DA:195,1
1869
+ DA:200,39
1870
+ DA:201,1
1871
+ DA:204,39
1871
1872
  DA:205,0
1872
1873
  DA:206,0
1874
+ DA:207,0
1873
1875
  DA:208,0
1874
- DA:209,0
1876
+ DA:210,0
1875
1877
  DA:211,0
1876
- DA:212,0
1878
+ DA:213,0
1877
1879
  DA:214,0
1878
1880
  DA:216,0
1879
- DA:217,0
1880
1881
  DA:218,0
1881
- DA:221,39
1882
- DA:222,0
1883
- DA:223,0
1882
+ DA:219,0
1883
+ DA:220,0
1884
+ DA:223,39
1884
1885
  DA:224,0
1886
+ DA:225,0
1885
1887
  DA:226,0
1886
- DA:227,0
1888
+ DA:228,0
1887
1889
  DA:229,0
1888
1890
  DA:231,0
1889
- LF:119
1891
+ DA:233,0
1892
+ LF:120
1890
1893
  LH:38
1891
1894
  BRDA:32,0,0,0
1892
1895
  BRDA:32,0,1,0
@@ -1913,18 +1916,18 @@ BRDA:94,10,1,0
1913
1916
  BRDA:94,10,2,0
1914
1917
  BRDA:105,11,0,0
1915
1918
  BRDA:105,11,1,0
1916
- BRDA:114,12,0,0
1917
- BRDA:114,12,1,0
1918
- BRDA:122,13,0,0
1919
- BRDA:122,13,1,0
1920
- BRDA:125,14,0,0
1921
- BRDA:125,14,1,0
1922
- BRDA:133,15,0,0
1923
- BRDA:133,15,1,0
1924
- BRDA:205,16,0,0
1925
- BRDA:205,16,1,0
1926
- BRDA:216,17,0,0
1927
- BRDA:216,17,1,0
1919
+ BRDA:115,12,0,0
1920
+ BRDA:115,12,1,0
1921
+ BRDA:123,13,0,0
1922
+ BRDA:123,13,1,0
1923
+ BRDA:126,14,0,0
1924
+ BRDA:126,14,1,0
1925
+ BRDA:134,15,0,0
1926
+ BRDA:134,15,1,0
1927
+ BRDA:207,16,0,0
1928
+ BRDA:207,16,1,0
1929
+ BRDA:218,17,0,0
1930
+ BRDA:218,17,1,0
1928
1931
  BRF:37
1929
1932
  BRH:0
1930
1933
  end_of_record
@@ -8200,20 +8203,20 @@ BRH:10
8200
8203
  end_of_record
8201
8204
  TN:
8202
8205
  SF:src/threads/query.js
8203
- FN:12,(anonymous_0)
8204
- FN:29,(anonymous_1)
8205
- FN:91,(anonymous_2)
8206
- FN:92,(anonymous_3)
8207
- FN:105,(anonymous_4)
8208
- FN:121,(anonymous_5)
8209
- FN:139,(anonymous_6)
8210
- FN:154,(anonymous_7)
8211
- FN:163,(anonymous_8)
8212
- FN:178,(anonymous_9)
8213
- FN:223,(anonymous_10)
8214
- FN:224,(anonymous_11)
8215
- FN:227,(anonymous_12)
8216
- FN:230,(anonymous_13)
8206
+ FN:9,(anonymous_0)
8207
+ FN:26,(anonymous_1)
8208
+ FN:88,(anonymous_2)
8209
+ FN:89,(anonymous_3)
8210
+ FN:102,(anonymous_4)
8211
+ FN:118,(anonymous_5)
8212
+ FN:136,(anonymous_6)
8213
+ FN:151,(anonymous_7)
8214
+ FN:160,(anonymous_8)
8215
+ FN:175,(anonymous_9)
8216
+ FN:216,(anonymous_10)
8217
+ FN:217,(anonymous_11)
8218
+ FN:220,(anonymous_12)
8219
+ FN:223,(anonymous_13)
8217
8220
  FNF:14
8218
8221
  FNH:13
8219
8222
  FNDA:15,(anonymous_0)
@@ -8236,178 +8239,169 @@ DA:3,2
8236
8239
  DA:4,2
8237
8240
  DA:5,2
8238
8241
  DA:6,2
8239
- DA:8,2
8240
- DA:9,2
8242
+ DA:10,15
8243
+ DA:11,15
8244
+ DA:12,15
8241
8245
  DA:13,15
8242
8246
  DA:14,15
8243
8247
  DA:15,15
8244
8248
  DA:16,15
8245
8249
  DA:17,15
8246
8250
  DA:18,15
8247
- DA:19,15
8248
- DA:20,15
8249
- DA:21,15
8250
- DA:25,15
8251
- DA:26,15
8251
+ DA:22,15
8252
+ DA:23,15
8253
+ DA:27,16
8254
+ DA:29,16
8252
8255
  DA:30,16
8253
- DA:32,16
8254
8256
  DA:33,16
8255
- DA:36,16
8256
- DA:37,0
8257
- DA:40,16
8258
- DA:41,16
8259
- DA:42,2
8257
+ DA:34,0
8258
+ DA:37,16
8259
+ DA:38,16
8260
+ DA:39,2
8261
+ DA:41,14
8262
+ DA:43,14
8260
8263
  DA:44,14
8264
+ DA:45,14
8261
8265
  DA:46,14
8262
8266
  DA:47,14
8263
8267
  DA:48,14
8264
- DA:49,14
8265
- DA:50,14
8266
- DA:51,14
8268
+ DA:49,12
8269
+ DA:50,12
8270
+ DA:51,12
8267
8271
  DA:52,12
8268
- DA:53,12
8269
- DA:54,12
8270
- DA:55,12
8271
- DA:59,14
8272
- DA:60,0
8273
- DA:64,0
8274
- DA:68,14
8272
+ DA:56,14
8273
+ DA:57,0
8274
+ DA:61,0
8275
+ DA:65,14
8276
+ DA:71,1
8277
+ DA:73,1
8275
8278
  DA:74,1
8276
- DA:76,1
8277
- DA:77,1
8278
- DA:81,13
8279
- DA:82,0
8280
- DA:86,13
8281
- DA:87,11
8282
- DA:91,13
8283
- DA:92,0
8284
- DA:96,13
8285
- DA:98,13
8286
- DA:99,0
8287
- DA:102,13
8279
+ DA:78,13
8280
+ DA:79,0
8281
+ DA:83,13
8282
+ DA:84,11
8283
+ DA:88,13
8284
+ DA:89,0
8285
+ DA:93,13
8286
+ DA:95,13
8287
+ DA:96,0
8288
+ DA:99,13
8289
+ DA:103,5
8290
+ DA:104,5
8291
+ DA:105,5
8288
8292
  DA:106,5
8289
- DA:107,5
8290
- DA:108,5
8291
- DA:109,5
8293
+ DA:119,6
8294
+ DA:120,6
8295
+ DA:121,6
8292
8296
  DA:122,6
8293
8297
  DA:123,6
8294
- DA:124,6
8295
- DA:125,6
8296
- DA:126,6
8297
- DA:127,5
8298
- DA:131,5
8299
- DA:132,5
8300
- DA:134,1
8301
- DA:136,6
8302
- DA:140,16
8298
+ DA:124,5
8299
+ DA:128,5
8300
+ DA:129,5
8301
+ DA:131,1
8302
+ DA:133,6
8303
+ DA:137,16
8304
+ DA:138,16
8305
+ DA:139,0
8303
8306
  DA:141,16
8304
- DA:142,0
8305
- DA:144,16
8306
- DA:145,16
8307
- DA:146,16
8308
- DA:147,2
8309
- DA:148,2
8310
- DA:151,16
8311
- DA:153,11
8312
- DA:154,11
8313
- DA:156,6
8314
- DA:157,0
8315
- DA:160,6
8316
- DA:161,6
8317
- DA:163,11
8318
- DA:164,11
8319
- DA:165,11
8320
- DA:166,6
8321
- DA:167,6
8322
- DA:172,6
8323
- DA:175,16
8307
+ DA:142,16
8308
+ DA:143,16
8309
+ DA:144,2
8310
+ DA:145,2
8311
+ DA:148,16
8312
+ DA:150,11
8313
+ DA:151,11
8314
+ DA:153,6
8315
+ DA:154,0
8316
+ DA:157,6
8317
+ DA:158,6
8318
+ DA:160,11
8319
+ DA:161,11
8320
+ DA:162,11
8321
+ DA:163,6
8322
+ DA:164,6
8323
+ DA:169,6
8324
+ DA:172,16
8325
+ DA:176,16
8324
8326
  DA:179,16
8325
- DA:182,16
8327
+ DA:180,19
8328
+ DA:181,0
8326
8329
  DA:183,19
8327
- DA:184,0
8330
+ DA:185,0
8328
8331
  DA:186,19
8329
- DA:188,0
8330
- DA:189,19
8331
- DA:191,19
8332
- DA:193,19
8333
- DA:194,0
8334
- DA:196,19
8335
- DA:200,0
8336
- DA:203,16
8337
- DA:208,0
8338
- DA:209,0
8339
- DA:217,0
8340
- DA:219,16
8341
- DA:223,2
8342
- DA:224,10
8343
- DA:225,10
8344
- DA:226,10
8345
- DA:228,8
8346
- DA:231,2
8347
- LF:114
8348
- LH:99
8349
- BRDA:12,0,0,10
8350
- BRDA:36,1,0,0
8351
- BRDA:36,1,1,16
8352
- BRDA:41,2,0,2
8353
- BRDA:41,2,1,14
8354
- BRDA:51,3,0,12
8355
- BRDA:51,3,1,2
8356
- BRDA:59,4,0,0
8357
- BRDA:59,4,1,14
8358
- BRDA:68,5,0,1
8359
- BRDA:68,5,1,13
8360
- BRDA:69,6,0,14
8361
- BRDA:69,6,1,12
8362
- BRDA:69,6,2,1
8363
- BRDA:69,6,3,1
8364
- BRDA:81,7,0,0
8365
- BRDA:81,7,1,13
8366
- BRDA:86,8,0,11
8367
- BRDA:86,8,1,2
8368
- BRDA:91,9,0,0
8369
- BRDA:91,9,1,13
8370
- BRDA:98,10,0,0
8371
- BRDA:98,10,1,13
8372
- BRDA:126,11,0,5
8373
- BRDA:126,11,1,1
8374
- BRDA:127,12,0,0
8375
- BRDA:127,12,1,5
8376
- BRDA:141,13,0,0
8377
- BRDA:141,13,1,16
8378
- BRDA:141,14,0,16
8379
- BRDA:141,14,1,16
8380
- BRDA:144,15,0,16
8381
- BRDA:144,15,1,15
8382
- BRDA:145,16,0,16
8383
- BRDA:145,16,1,5
8384
- BRDA:147,17,0,2
8385
- BRDA:147,17,1,0
8386
- BRDA:151,18,0,11
8387
- BRDA:151,18,1,5
8388
- BRDA:156,19,0,0
8389
- BRDA:156,19,1,6
8390
- BRDA:178,20,0,0
8391
- BRDA:183,21,0,0
8392
- BRDA:183,21,1,19
8393
- BRDA:186,22,0,0
8394
- BRDA:186,22,1,19
8395
- BRDA:189,23,0,19
8396
- BRDA:189,23,1,0
8397
- BRDA:193,24,0,0
8398
- BRDA:193,24,1,19
8399
- BRDA:193,25,0,19
8400
- BRDA:193,25,1,0
8332
+ DA:188,19
8333
+ DA:193,0
8334
+ DA:196,16
8335
+ DA:201,0
8336
+ DA:202,0
8337
+ DA:210,0
8338
+ DA:212,16
8339
+ DA:216,2
8340
+ DA:217,10
8341
+ DA:218,10
8342
+ DA:219,10
8343
+ DA:221,8
8344
+ DA:224,2
8345
+ LF:109
8346
+ LH:95
8347
+ BRDA:9,0,0,10
8348
+ BRDA:33,1,0,0
8349
+ BRDA:33,1,1,16
8350
+ BRDA:38,2,0,2
8351
+ BRDA:38,2,1,14
8352
+ BRDA:48,3,0,12
8353
+ BRDA:48,3,1,2
8354
+ BRDA:56,4,0,0
8355
+ BRDA:56,4,1,14
8356
+ BRDA:65,5,0,1
8357
+ BRDA:65,5,1,13
8358
+ BRDA:66,6,0,14
8359
+ BRDA:66,6,1,12
8360
+ BRDA:66,6,2,1
8361
+ BRDA:66,6,3,1
8362
+ BRDA:78,7,0,0
8363
+ BRDA:78,7,1,13
8364
+ BRDA:83,8,0,11
8365
+ BRDA:83,8,1,2
8366
+ BRDA:88,9,0,0
8367
+ BRDA:88,9,1,13
8368
+ BRDA:95,10,0,0
8369
+ BRDA:95,10,1,13
8370
+ BRDA:123,11,0,5
8371
+ BRDA:123,11,1,1
8372
+ BRDA:124,12,0,0
8373
+ BRDA:124,12,1,5
8374
+ BRDA:138,13,0,0
8375
+ BRDA:138,13,1,16
8376
+ BRDA:138,14,0,16
8377
+ BRDA:138,14,1,16
8378
+ BRDA:141,15,0,16
8379
+ BRDA:141,15,1,15
8380
+ BRDA:142,16,0,16
8381
+ BRDA:142,16,1,5
8382
+ BRDA:144,17,0,2
8383
+ BRDA:144,17,1,0
8384
+ BRDA:148,18,0,11
8385
+ BRDA:148,18,1,5
8386
+ BRDA:153,19,0,0
8387
+ BRDA:153,19,1,6
8388
+ BRDA:175,20,0,0
8389
+ BRDA:180,21,0,0
8390
+ BRDA:180,21,1,19
8391
+ BRDA:183,22,0,0
8392
+ BRDA:183,22,1,19
8393
+ BRDA:186,23,0,19
8394
+ BRDA:186,23,1,0
8395
+ BRDA:196,24,0,0
8396
+ BRDA:196,24,1,16
8397
+ BRDA:197,25,0,16
8398
+ BRDA:197,25,1,16
8399
+ BRDA:197,25,2,16
8401
8400
  BRDA:203,26,0,0
8402
- BRDA:203,26,1,16
8403
- BRDA:204,27,0,16
8404
- BRDA:204,27,1,16
8405
- BRDA:204,27,2,16
8406
- BRDA:210,28,0,0
8407
- BRDA:210,28,1,0
8408
- BRDA:210,28,2,0
8409
- BRF:60
8410
- BRH:41
8401
+ BRDA:203,26,1,0
8402
+ BRDA:203,26,2,0
8403
+ BRF:56
8404
+ BRH:39
8411
8405
  end_of_record
8412
8406
  TN:
8413
8407
  SF:src/threads/utils.js
@@ -155,7 +155,7 @@ var External;
155
155
  thisRow._id = generateIdForRow(row, table);
156
156
  thisRow.tableId = table._id;
157
157
  thisRow._rev = "rev";
158
- return thisRow;
158
+ return utils_4.processFormulas(table, thisRow);
159
159
  }
160
160
  function fixArrayTypes(row, table) {
161
161
  for (let [fieldName, schema] of Object.entries(table.schema)) {
@@ -278,14 +278,24 @@ var External;
278
278
  * This iterates through the returned rows and works out what elements of the rows
279
279
  * actually match up to another row (based on primary keys) - this is pretty specific
280
280
  * to SQL and the way that SQL relationships are returned based on joins.
281
+ * This is complicated, but the idea is that when a SQL query returns all the relations
282
+ * will be separate rows, with all of the data in each row. We have to decipher what comes
283
+ * from where (which tables) and how to convert that into budibase columns.
281
284
  */
282
- updateRelationshipColumns(row, rows, relationships) {
285
+ updateRelationshipColumns(table, row, rows, relationships) {
283
286
  const columns = {};
284
287
  for (let relationship of relationships) {
285
288
  const linkedTable = this.tables[relationship.tableName];
286
289
  if (!linkedTable) {
287
290
  continue;
288
291
  }
292
+ const fromColumn = `${table.name}.${relationship.from}`;
293
+ const toColumn = `${linkedTable.name}.${relationship.to}`;
294
+ // this is important when working with multiple relationships
295
+ // between the same tables, don't want to overlap/multiply the relations
296
+ if (!relationship.through && row[fromColumn] !== row[toColumn]) {
297
+ continue;
298
+ }
289
299
  let linked = basicProcessing(row, linkedTable);
290
300
  if (!linked._id) {
291
301
  continue;
@@ -323,7 +333,7 @@ var External;
323
333
  row._id = rowId;
324
334
  // this is a relationship of some sort
325
335
  if (finalRows[rowId]) {
326
- finalRows = this.updateRelationshipColumns(row, finalRows, relationships);
336
+ finalRows = this.updateRelationshipColumns(table, row, finalRows, relationships);
327
337
  continue;
328
338
  }
329
339
  const thisRow = fixArrayTypes(basicProcessing(row, table), table);
@@ -332,7 +342,7 @@ var External;
332
342
  }
333
343
  finalRows[thisRow._id] = thisRow;
334
344
  // do this at end once its been added to the final rows
335
- finalRows = this.updateRelationshipColumns(row, finalRows, relationships);
345
+ finalRows = this.updateRelationshipColumns(table, row, finalRows, relationships);
336
346
  }
337
347
  return utils_4.processFormulas(table, Object.values(finalRows));
338
348
  }
@@ -21,7 +21,7 @@ const { clientLibraryPath } = require("../../../utilities");
21
21
  const { upload } = require("../../../utilities/fileSystem");
22
22
  const { attachmentsRelativeURL } = require("../../../utilities");
23
23
  const { DocumentTypes } = require("../../../db/utils");
24
- const { getAppDB } = require("@budibase/backend-core/context");
24
+ const { getAppDB, updateAppId } = require("@budibase/backend-core/context");
25
25
  const AWS = require("aws-sdk");
26
26
  const AWS_REGION = env.AWS_REGION ? env.AWS_REGION : "eu-west-1";
27
27
  function prepareUpload({ s3Key, bucket, metadata, file }) {
@@ -50,12 +50,9 @@ function getAppIdFromUrl(ctx) {
50
50
  // search prod apps for a url that matches, exclude dev where id is always used
51
51
  const apps = yield getAllApps({ dev: false });
52
52
  const app = apps.filter(a => a.url && a.url.toLowerCase() === possibleAppUrl)[0];
53
- if (app && app.appId) {
54
- return app.appId;
55
- }
56
- else {
57
- return ctx.params.appId;
58
- }
53
+ const appId = app && app.appId ? app.appId : ctx.params.appId;
54
+ updateAppId(appId);
55
+ return appId;
59
56
  });
60
57
  }
61
58
  exports.serveBuilder = function (ctx) {