@metabase/cli 0.3.1 → 0.3.2-alpha.fix-transform-test-ee-path.041c793

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 (267) hide show
  1. package/dist/{add-collection-CYDUm_XO.mjs → add-collection-73X1DmCM.mjs} +6 -9
  2. package/dist/{alert-ClyhtxIz.mjs → alert-BB38lWSL.mjs} +7 -7
  3. package/dist/{alerts-Dt3D1gcz.mjs → alerts-DxyzqLSU.mjs} +7 -7
  4. package/dist/{append-Bl_Ensmr.mjs → append-CHme1Enm.mjs} +5 -5
  5. package/dist/{archive-DSMqHRr1.mjs → archive-BGiDxu8O.mjs} +4 -4
  6. package/dist/{archive-D3a3Wgz0.mjs → archive-BMyvyf62.mjs} +4 -4
  7. package/dist/{archive-BdHXQg4I.mjs → archive-C4Y2B58q.mjs} +4 -4
  8. package/dist/{archive-CWceyy8x.mjs → archive-CP5Hlqjw.mjs} +5 -5
  9. package/dist/{archive-BOyKhNOz.mjs → archive-Cq3fnc0v2.mjs} +6 -6
  10. package/dist/{archive-DVGDg8mP.mjs → archive-CqKqNdUh.mjs} +6 -6
  11. package/dist/{archive-DDru3vdy.mjs → archive-Czo5T0Lp.mjs} +4 -4
  12. package/dist/{archive-nKD3mOB8.mjs → archive-DBcxZwLd.mjs} +6 -6
  13. package/dist/{archive-CNblz55j.mjs → archive-DKFPJ9j3.mjs} +6 -6
  14. package/dist/{archive-BJZ7Dace.mjs → archive-DPL1qOuL.mjs} +6 -6
  15. package/dist/{archive-DiGxCojL.mjs → archive-eS-XA74p.mjs} +4 -4
  16. package/dist/{auth-aCksg8q2.mjs → auth-6YyB0HNB.mjs} +5 -5
  17. package/dist/{body-DxRSAMNC.mjs → body-OjAWKVaU.mjs} +3 -3
  18. package/dist/{branches-_0VWR2Zm.mjs → branches-D5YLVFDK.mjs} +4 -7
  19. package/dist/{cancel-ctpVE8uC.mjs → cancel-DeRIq1YJ.mjs} +4 -4
  20. package/dist/{cancel-task-FtxBka-M.mjs → cancel-task-CqExODVm.mjs} +5 -8
  21. package/dist/card-BMSqofd7.mjs +24 -0
  22. package/dist/{card-zyUkr2nS.mjs → card-CEkp1mcI.mjs} +1 -1
  23. package/dist/{card-DZxRmver.mjs → card-voh1k4hl.mjs} +14 -11
  24. package/dist/{cards-DHOWAvfv.mjs → cards-B813G9I5.mjs} +7 -7
  25. package/dist/cli.mjs +572 -69
  26. package/dist/client-cJ7aw0Gt.mjs +4092 -0
  27. package/dist/collection-BfNg7tEg.mjs +20 -0
  28. package/dist/{collection-CfulNRBG.mjs → collection-BxdPxD38.mjs} +1 -1
  29. package/dist/{collection-CGoVLvcD.mjs → collection-DYM0p3Xl.mjs} +1 -1
  30. package/dist/{collection-namespace-CEoQ7G08.mjs → collection-namespace-CVzDgJV0.mjs} +2 -2
  31. package/dist/{content-translation-DNKerjS3.mjs → content-translation-QKWt9l76.mjs} +3 -3
  32. package/dist/{create-e650zxzX.mjs → create-4UnoQvsy.mjs} +5 -5
  33. package/dist/{create-DaYRnK5P.mjs → create-BJad6MR82.mjs} +8 -8
  34. package/dist/{create-CcLchJAN.mjs → create-BLiB2xqo.mjs} +7 -7
  35. package/dist/{create-C9vy4ZG6.mjs → create-BWp6L_dW.mjs} +5 -5
  36. package/dist/{create-C78g8Crb.mjs → create-Bef5eBCA.mjs} +5 -5
  37. package/dist/{create-F4Lf09xq.mjs → create-CMV3qlzJ.mjs} +4 -4
  38. package/dist/{create-DmvoibX8.mjs → create-CWGsiFvU.mjs} +4 -4
  39. package/dist/{create-C3IaXXty.mjs → create-CoFg1p6m.mjs} +4 -4
  40. package/dist/{create-CEydRMWS.mjs → create-CvIeb1NU.mjs} +7 -7
  41. package/dist/{create-vlrlY-2E.mjs → create-CvpeAcFc.mjs} +4 -4
  42. package/dist/{create-wJR4CxHA.mjs → create-D50TxVTk.mjs} +5 -8
  43. package/dist/{create-CLG2-bso.mjs → create-DEBgYRlM.mjs} +6 -6
  44. package/dist/{create-7ddYK4TA.mjs → create-DJm0YuLW.mjs} +6 -6
  45. package/dist/{create-BdPVWYSi.mjs → create-DmKwDQCY2.mjs} +6 -6
  46. package/dist/{create-branch-B8C7jl-J.mjs → create-branch-BN5iH-GM.mjs} +5 -9
  47. package/dist/{create-DIVhBIyE.mjs → create-bvpl6Fn5.mjs} +11 -7
  48. package/dist/create-uanpKsPo.mjs +34 -0
  49. package/dist/{csv-BLPJtlSC.mjs → csv-BhuX9fwh.mjs} +5 -5
  50. package/dist/{current-task-C-ldJbWE.mjs → current-task-BMt2NeqV.mjs} +5 -8
  51. package/dist/{dashboard-CtO_3EfC.mjs → dashboard-Ct_ajSYI.mjs} +10 -10
  52. package/dist/{dashboard-CKUR8ZpQ.mjs → dashboard-D0hwTC-f.mjs} +11 -2
  53. package/dist/{dashboard-BlbNszi8.mjs → dashboard-DgK81azj.mjs} +1 -1
  54. package/dist/{database-B19qlLKZ.mjs → database-C3E9PZSx.mjs} +1 -1
  55. package/dist/{database-C8G6ZKG0.mjs → database-JtHTqSpq.mjs} +1 -1
  56. package/dist/{db-xXselnBq.mjs → db-B_LW2VE-.mjs} +7 -7
  57. package/dist/{delete-ZJJyqsRh.mjs → delete-BOcPK_H9.mjs} +5 -5
  58. package/dist/{delete-BZZHw6pm.mjs → delete-CowGO4rh.mjs} +5 -5
  59. package/dist/{delete-D6WxgWRp.mjs → delete-D0f7VatX.mjs} +5 -5
  60. package/dist/{delete-BwSPQy7m.mjs → delete-D2bUV6uo.mjs} +5 -5
  61. package/dist/delete-DZ_ICQug.mjs +44 -0
  62. package/dist/{delete-BZwAOQxG.mjs → delete-Ur7b11no.mjs} +5 -5
  63. package/dist/{delete-runtime-D74s6vhu.mjs → delete-runtime-BKEzJn22.mjs} +1 -2
  64. package/dist/{delete-table-CJktZE3w.mjs → delete-table-Dd8X573t.mjs} +5 -5
  65. package/dist/{dependencies-BdqIqEIy.mjs → dependencies-XDVLBwko.mjs} +7 -7
  66. package/dist/{dirty-BW2As2wS.mjs → dirty-k-JmGLsS.mjs} +6 -9
  67. package/dist/{document-Cd2mmqCp.mjs → document-BHpLJbKU.mjs} +5 -0
  68. package/dist/document-BW9iow8R.mjs +19 -0
  69. package/dist/{document-D6OybtP2.mjs → document-CA0Q6lqu.mjs} +1 -1
  70. package/dist/{download-mfFJ9oRS.mjs → download-CQjPIYDO.mjs} +3 -6
  71. package/dist/{eid-DZ-4t2xe.mjs → eid-CNTKDgwj.mjs} +4 -5
  72. package/dist/{events-D6yFmXP1.mjs → events-BshWlkDp.mjs} +5 -5
  73. package/dist/{export-DYZjz1WP.mjs → export-Dq6ecU8h.mjs} +7 -10
  74. package/dist/{field-BJ54wmIX.mjs → field-Bo2ISMO4.mjs} +5 -5
  75. package/dist/{field-Cr2DPUG9.mjs → field-CcN4oZy6.mjs} +16 -1
  76. package/dist/{field-BPsNa-TO.mjs → field-fDtIrY6D.mjs} +1 -1
  77. package/dist/{fields-FUWCgPOa.mjs → fields-CVctqn5G.mjs} +7 -7
  78. package/dist/{get-BraVQ1FJ.mjs → get-7xTeNGAo.mjs} +6 -6
  79. package/dist/{get-LAew34ID.mjs → get-8b5Sh50q.mjs} +6 -6
  80. package/dist/{get-CWnriw33.mjs → get-B4RgW-VT.mjs} +6 -6
  81. package/dist/{get-C_5AbfpO.mjs → get-BD81MHl_.mjs} +4 -4
  82. package/dist/{get-ByZJf9nO.mjs → get-Bl3OmlBP.mjs} +5 -5
  83. package/dist/get-BtTetWzm.mjs +32 -0
  84. package/dist/{get-_ggLr1tY.mjs → get-BvSA_mmf.mjs} +6 -6
  85. package/dist/{get-DhkltKIV.mjs → get-BvgEF--n.mjs} +4 -4
  86. package/dist/{get-DYaQpixt.mjs → get-C5sWciaE.mjs} +6 -6
  87. package/dist/get-CO6X4nZH.mjs +93 -0
  88. package/dist/{get-DVyesErX.mjs → get-CTPvdcud.mjs} +6 -6
  89. package/dist/{get-DMECsioX.mjs → get-CrpwxWOV.mjs} +4 -4
  90. package/dist/{get-Ba2HRdrx.mjs → get-D4oGhZWX.mjs} +6 -6
  91. package/dist/{get-CsN7NBI0.mjs → get-Df6cGHCM.mjs} +4 -4
  92. package/dist/{get-BWl3vzsf.mjs → get-DfMVlz64.mjs} +6 -6
  93. package/dist/{get-C5q49Dgx.mjs → get-Dr-U321T2.mjs} +6 -6
  94. package/dist/{get-DAOSGt5Z.mjs → get-Dw7jAno3.mjs} +6 -6
  95. package/dist/{get-DRJtsS1_.mjs → get-PWhOdz1z.mjs} +4 -4
  96. package/dist/{get-CQ0-fFWP.mjs → get-RslzBaXx.mjs} +5 -8
  97. package/dist/{get-run-oH4dRCBx.mjs → get-run-CZdDqfUj.mjs} +6 -6
  98. package/dist/{get-DCutQeiV.mjs → get-wjIgUlNl.mjs} +4 -4
  99. package/dist/git-sync-BmoRk0UV.mjs +28 -0
  100. package/dist/{git-sync-BDnxPrqU.mjs → git-sync-BwBRmEhE.mjs} +18 -1
  101. package/dist/{git-sync-DxD_ng48.mjs → git-sync-TjX1r_wF.mjs} +1 -1
  102. package/dist/{group-DBM87IgC.mjs → group-YQQ5GIcP.mjs} +2 -2
  103. package/dist/{has-remote-changes-CnmyIw_7.mjs → has-remote-changes-i-3MVxat.mjs} +5 -8
  104. package/dist/{import-B7Si-bSI.mjs → import-DWEKejya.mjs} +7 -10
  105. package/dist/{input-DH9i67x_.mjs → input-DEvkIjGr.mjs} +1 -1
  106. package/dist/{is-dirty-BOH_VEA8.mjs → is-dirty-C5ipqd4v.mjs} +3 -6
  107. package/dist/{items-DouHkWev.mjs → items-hKJ2ZDwy.mjs} +7 -7
  108. package/dist/{key-BEhqIzIQ.mjs → key-PYetuQ13.mjs} +1 -1
  109. package/dist/{library-1J_4Dicw.mjs → library-B7_04UVK.mjs} +5 -5
  110. package/dist/library-BPIzb3K_.mjs +81 -0
  111. package/dist/{library-DfYAT2Ep.mjs → library-PGCfm0UA.mjs} +1 -1
  112. package/dist/{list-BK_6VNm_.mjs → list-1vdClKSE.mjs} +4 -4
  113. package/dist/{list-DWLGpMvr.mjs → list-6myofqMv.mjs} +7 -7
  114. package/dist/{list-DhViDVx_.mjs → list-B-9QOX9Y.mjs} +6 -6
  115. package/dist/{list-aKUk-a1Y.mjs → list-Bs7_Rysg.mjs} +7 -7
  116. package/dist/list-CHuhMXet.mjs +35 -0
  117. package/dist/{list-DptEWB5Y.mjs → list-CLZU_EOf.mjs} +4 -4
  118. package/dist/{list-B2Ddf4W0.mjs → list-Cen-7uTo.mjs} +5 -5
  119. package/dist/{list-D2IYZ6lk.mjs → list-CgH-H-O6.mjs} +6 -6
  120. package/dist/{list-BeMYIeiI.mjs → list-CjNXskB4.mjs} +7 -7
  121. package/dist/{list-C1bAtgO1.mjs → list-CmFh1GQ_.mjs} +4 -4
  122. package/dist/{list-Cy0w4Fap.mjs → list-D6tTvYUP.mjs} +4 -4
  123. package/dist/{list-C7UvO3Uw.mjs → list-DI820W6w.mjs} +6 -6
  124. package/dist/{list-D25ofn4v.mjs → list-DKZnQ4Ts.mjs} +7 -7
  125. package/dist/{list-C0zJ2ehz.mjs → list-DKcC4cm0.mjs} +6 -6
  126. package/dist/{list-qs9wAtC3.mjs → list-DfRqNH1N.mjs} +4 -4
  127. package/dist/list-DjwnsyXM.mjs +60 -0
  128. package/dist/{list-sDpy4nDU.mjs → list-VNC-_E59.mjs} +6 -6
  129. package/dist/{list-DJK9_BEF.mjs → list-eKDT1XXk.mjs} +14 -13
  130. package/dist/{list-BXlTYsYA.mjs → list-oX2SMzxZ.mjs} +4 -4
  131. package/dist/{login-BmyCAfRV.mjs → login-DumZaWXK.mjs} +18 -15
  132. package/dist/{logout-DUR32q0V.mjs → logout-BsXPRc-3.mjs} +3 -4
  133. package/dist/{measure-DdVp-8jw.mjs → measure-BFxkbAoa.mjs} +6 -6
  134. package/dist/{notification-Fcq1fIPw.mjs → notification-DVrLkjFT.mjs} +1 -1
  135. package/dist/{parameter-DUKR8NXo.mjs → parameter-Celg0wZa.mjs} +1 -1
  136. package/dist/{parameter-values-CBR-cBev.mjs → parameter-values-CoF9Hx1p.mjs} +5 -6
  137. package/dist/{parse-enum-D0Jfm_Bz.mjs → parse-enum-Dc0dMZ3P.mjs} +1 -1
  138. package/dist/{parse-id-B3YwNojT.mjs → parse-id-DmFJgpY6.mjs} +1 -1
  139. package/dist/{parse-ref-ibKVB0J4.mjs → parse-ref-DTDld_LJ.mjs} +1 -1
  140. package/dist/{path-D8BQmEhL.mjs → path-BQ4lRDyN.mjs} +5 -5
  141. package/dist/{poll-75SvT7Zv.mjs → poll-CZeXepUQ.mjs} +2 -2
  142. package/dist/{preflight-CoF1Em99.mjs → preflight-BTQe4swo.mjs} +3 -4
  143. package/dist/{process-DBOOrmET.mjs → process-CTrfxxaC.mjs} +1 -1
  144. package/dist/{publish-Cb7XrQ3X.mjs → publish-CFB2Cc5A.mjs} +9 -9
  145. package/dist/{pulse-BmsDenXm.mjs → pulse-Dz0ocv0l.mjs} +1 -1
  146. package/dist/{pulse-DhG6I9mI.mjs → pulse-x0gFxWfG.mjs} +2 -2
  147. package/dist/{query-D35B588l.mjs → query-BJbUnAHf.mjs} +10 -12
  148. package/dist/query-CV2KCS5O.mjs +114 -0
  149. package/dist/{query-result-DBDwk8TS.mjs → query-result-E4Q-Gra6.mjs} +1 -1
  150. package/dist/{remove-collection-DJem6V26.mjs → remove-collection-D3yvKH3e.mjs} +6 -9
  151. package/dist/{render-CI93iP0I.mjs → render-BJRCs7rA.mjs} +13 -2
  152. package/dist/{replace-CtsWICrD.mjs → replace-uj4WTqx_.mjs} +5 -5
  153. package/dist/{rescan-values-CaXUL6z5.mjs → rescan-values-CzxQU318.mjs} +6 -6
  154. package/dist/{run-CM-Amtbf.mjs → run-B2f_omHu.mjs} +26 -14
  155. package/dist/run-DlO1J1Sx.mjs +50 -0
  156. package/dist/{run-BeLm17F4.mjs → run-yX2dtmE5.mjs} +6 -6
  157. package/dist/{runs-DFG63zgr.mjs → runs-DzUO45wU.mjs} +7 -7
  158. package/dist/{runtime-z8rra6-I.mjs → runtime-arKqJqIT.mjs} +994 -252
  159. package/dist/{schema-tables-COAHkIcy.mjs → schema-tables-DZCNzuQ6.mjs} +7 -7
  160. package/dist/{schemas-BX5BATiV.mjs → schemas-2ejqaVsG.mjs} +5 -5
  161. package/dist/{search-DFBwUc6d.mjs → search-BAXg-EJw.mjs} +2 -1
  162. package/dist/{search-CPvvmhdt.mjs → search-DcihauDZ.mjs} +6 -6
  163. package/dist/{segment-C62L6BI3.mjs → segment-BQT2poPG.mjs} +6 -6
  164. package/dist/{selectors-P4QnrORk.mjs → selectors-BzestDld.mjs} +3 -3
  165. package/dist/{send-PZh5IKF8.mjs → send-DMxoLFo7.mjs} +4 -4
  166. package/dist/{set-DbCtUoFd.mjs → set-CDmiD0vv.mjs} +5 -5
  167. package/dist/{set-active-DL4QzWDO.mjs → set-active-RrvWR9NY.mjs} +5 -5
  168. package/dist/{setting-BlRcZbhC.mjs → setting-BiBLCcxz.mjs} +4 -4
  169. package/dist/{setup-D_SLaC-3.mjs → setup-DYsTzkWO.mjs} +4 -4
  170. package/dist/{signal-CMd0EFUa.mjs → signal-k7cm5N6h.mjs} +11 -2
  171. package/dist/skill-list-D9_1Pmt7.mjs +76 -0
  172. package/dist/skills-BPHXUfeL.mjs +351 -0
  173. package/dist/{skills-D991LB1M.mjs → skills-C3bxxC6a.mjs} +3 -3
  174. package/dist/snippet-BtfxE60H.mjs +19 -0
  175. package/dist/{stash-DyBxFoP6.mjs → stash-DdheS0Ad.mjs} +7 -11
  176. package/dist/{status-cfDHqK2Q.mjs → status-BuIzXRX1.mjs} +12 -11
  177. package/dist/{status-DUsiogz5.mjs → status-CXouQJ31.mjs} +11 -9
  178. package/dist/{subscription-Bn0AU7GN.mjs → subscription-CJ8Igs1U.mjs} +6 -6
  179. package/dist/{subscriptions-DwqjCVlc.mjs → subscriptions-D0NpGvCQ.mjs} +7 -7
  180. package/dist/{summary-BGwSNzf4.mjs → summary-D04S8gGj.mjs} +6 -6
  181. package/dist/{sync-schema-dtkDOAKe.mjs → sync-schema-DrA5zkdl.mjs} +7 -7
  182. package/dist/{sync-task-BACcrs0i.mjs → sync-task-BXeWuARG.mjs} +1 -1
  183. package/dist/{table-CsIJNPFf.mjs → table-C6h4tIRw.mjs} +1 -1
  184. package/dist/{table-CeeTJgQb.mjs → table-DfuY0N8e.mjs} +51 -4
  185. package/dist/{table-BJoEAoCU.mjs → table-Dntbz7Q2.mjs} +5 -5
  186. package/dist/timeline-8jwsldo3.mjs +21 -0
  187. package/dist/{timeline-event-BsF7YqzZ.mjs → timeline-event-BbB1xEdI.mjs} +6 -6
  188. package/dist/{transform-DoTyyXAu.mjs → transform-CtqB1WYo.mjs} +2 -2
  189. package/dist/{transform-D3QX0jxA.mjs → transform-DiW7bREn.mjs} +68 -5
  190. package/dist/{transform-job-50GZHhKH.mjs → transform-job-AaMZRxAq.mjs} +1 -1
  191. package/dist/transform-job-B-1YAbvy.mjs +22 -0
  192. package/dist/{transform-job-DRrK28IH.mjs → transform-job-CCguL6LP.mjs} +41 -4
  193. package/dist/transform-m6s4kkWU.mjs +28 -0
  194. package/dist/{transform-tag-VM9R7Q_M.mjs → transform-tag-PjryheLF.mjs} +5 -5
  195. package/dist/transform-test-BjjCQ2xm.mjs +169 -0
  196. package/dist/transform-test-DSTkKKNC.mjs +16 -0
  197. package/dist/transform-test-gzDcbypy.mjs +25 -0
  198. package/dist/{transforms-BjACGbBp.mjs → transforms-CijX3VE7.mjs} +7 -7
  199. package/dist/{tree-BwS6JAmk.mjs → tree-Cmb3O6rH.mjs} +4 -5
  200. package/dist/{unpublish-DWdPnENY.mjs → unpublish-DkP_AcK5.mjs} +4 -7
  201. package/dist/{update-DKEHY-gt.mjs → update-8UmD1prT.mjs} +7 -7
  202. package/dist/{update-C1FBVLfC.mjs → update-BFyRBc-H.mjs} +8 -8
  203. package/dist/{update-tLIhVIPp.mjs → update-BrXGg3QO.mjs} +8 -8
  204. package/dist/{update-DCjAjihm.mjs → update-C91m9YAR.mjs} +6 -6
  205. package/dist/{update-BpPaacCF.mjs → update-COcx61Ur.mjs} +6 -6
  206. package/dist/update-Ci8YL4_2.mjs +41 -0
  207. package/dist/{update-BR_vkkd1.mjs → update-CtLbFCd_.mjs} +5 -5
  208. package/dist/{update-DTmRHBik.mjs → update-D6Zzvc7F.mjs} +7 -7
  209. package/dist/{update-cqR1U6DU.mjs → update-D8htjzNJ.mjs} +5 -5
  210. package/dist/{update-B2CF2DK4.mjs → update-D9kOTr0n.mjs} +6 -6
  211. package/dist/{update-C4y3iQsv.mjs → update-DPTio6i1.mjs} +7 -7
  212. package/dist/{update-DsZttiSC.mjs → update-DlWB9s0v.mjs} +5 -5
  213. package/dist/{update-BCT9qpVr.mjs → update-DubrpPbz.mjs} +5 -5
  214. package/dist/{update-3idz42uD.mjs → update-Dz47cKBk.mjs} +7 -7
  215. package/dist/{update-DkviXwSg.mjs → update-FCP5Lop2.mjs} +7 -7
  216. package/dist/{update-DlTaD1x3.mjs → update-KSHnb6vB.mjs} +9 -9
  217. package/dist/{update-dashcard-DlE_bb2F.mjs → update-dashcard-BlibHa5o.mjs} +7 -7
  218. package/dist/{upgrade-mNV7XuJG.mjs → upgrade-EwL6wPSY.mjs} +6 -8
  219. package/dist/upload-BZshRJIM.mjs +13 -0
  220. package/dist/{upload-CEGVxmYB.mjs → upload-D0KaTqUE.mjs} +4 -7
  221. package/dist/{upload-CD555ui1.mjs → upload-Do2PBSeH.mjs} +2 -2
  222. package/dist/{uuid-C4hqn3kA.mjs → uuid-DjKLDIVE.mjs} +10 -7
  223. package/dist/{validate-query-DaGYSmpQ.mjs → validate-query-D6_ad-Gi.mjs} +3 -4
  224. package/dist/{validate-BWchyW0V.mjs → validate-xR_MHBNR.mjs} +69 -23
  225. package/dist/{values-C0O3eNaW.mjs → values-Dc9612_L.mjs} +6 -6
  226. package/dist/{verify-DfTjYF7s.mjs → verify-DVN1eqXZ.mjs} +3 -18
  227. package/dist/{wait-WZmFenN_.mjs → wait-C-ovOTAZ.mjs} +7 -10
  228. package/dist/{wait-flags-BbfDSP8R.mjs → wait-flags-BQNmuvIj.mjs} +2 -2
  229. package/dist/{window-BkvrP0gB.mjs → window-DSb1tqSe.mjs} +1 -1
  230. package/package.json +1 -1
  231. package/skill-data/core/SKILL.md +31 -15
  232. package/skill-data/dashboard/SKILL.md +1 -1
  233. package/skill-data/data-workflow/references/building-clean-tables.md +6 -2
  234. package/skill-data/data-workflow/references/reusable-definitions.md +11 -3
  235. package/skill-data/document/SKILL.md +4 -1
  236. package/skill-data/git-sync/SKILL.md +5 -0
  237. package/skill-data/mbql/SKILL.md +84 -115
  238. package/skill-data/mbql/references/operators.md +77 -231
  239. package/skill-data/metadata/SKILL.md +1 -1
  240. package/skill-data/metadata/references/semantic-types.md +7 -1
  241. package/skill-data/native-sql/SKILL.md +8 -9
  242. package/skill-data/native-sql/references/template-tags.md +27 -27
  243. package/skill-data/notification/SKILL.md +7 -1
  244. package/skill-data/transform/SKILL.md +76 -4
  245. package/skill-data/transform-test-plan/SKILL.md +171 -0
  246. package/skill-data/transform-test-plan/references/checklist.md +81 -0
  247. package/skill-data/transform-test-plan/references/checks.md +260 -0
  248. package/skill-data/visualization/SKILL.md +13 -6
  249. package/skill-data/visualization/references/settings.md +13 -11
  250. package/skills/metabase-cli/SKILL.md +1 -1
  251. package/dist/card-CGCXbdmD.mjs +0 -24
  252. package/dist/client-mKuHg_sc.mjs +0 -2218
  253. package/dist/collection-D8Tk8i3a.mjs +0 -20
  254. package/dist/document-KbcHhzFz.mjs +0 -19
  255. package/dist/get-BC8J8BXB.mjs +0 -80
  256. package/dist/git-sync-Dik8nKfw.mjs +0 -28
  257. package/dist/library-ClLgrAXy.mjs +0 -19
  258. package/dist/list-CW5PdYCX.mjs +0 -98
  259. package/dist/network-error-D6CiOEBw.mjs +0 -431
  260. package/dist/predicates-Bkm2IoeX.mjs +0 -170
  261. package/dist/query-C256WBYG.mjs +0 -87
  262. package/dist/skills-DTCrMcix.mjs +0 -216
  263. package/dist/snippet-DTDO55Cg.mjs +0 -19
  264. package/dist/timeline-DcXPshcT.mjs +0 -21
  265. package/dist/transform-Dsf_wHAj.mjs +0 -28
  266. package/dist/transform-job-B1yLv5l-.mjs +0 -22
  267. package/dist/upload-DsYCf5kB.mjs +0 -13
@@ -1,21 +1,17 @@
1
1
  ---
2
2
  name: mbql
3
- description: Author and debug MBQL query bodies for the `mb` CLI — the only hand-authorable query format. Covers the JSON shape (flat numeric-id stages, options-object-second clauses, optional lib/uuid), joins and FK traversal, multi-stage pipelines, aggregation naming, the flat-vs-legacy-envelope footgun, and the print-schema → dry-run → run validation loop. Use when writing or fixing any query body — `mb query`, a card's `dataset_query`, a transform's `source.query`, or a segment/measure `definition` — or when `--dry-run`/run reports validation errors. Triggers — "write an MBQL query", "the dataset_query is wrong", "aggregate and group by", "join two tables", "month-over-month".
3
+ description: Author and debug MBQL query bodies for the `mb` CLI — the query shape, clauses, filters, aggregation and breakout, order and limit, expressions, joins and FK columns, multi-stage pipelines, saved questions and definitions as sources, output column names, and the print-schema → dry-run → run loop. Use when writing or fixing any query body — `mb query`, a card's `dataset_query`, a transform's `source.query`, or a segment/measure `definition` — or when `--dry-run` or a run reports errors. Triggers — "write an MBQL query", "the dataset_query is wrong", "aggregate and group by", "join two tables", "month-over-month".
4
4
  allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
5
  ---
6
6
 
7
7
  # MBQL
8
8
 
9
- MBQL is the query format you author by hand — it has a bundled JSON Schema, so the CLI pre-flight-validates it before sending. A native SQL query is **also** MBQL: its single stage is `mbql.stage/native` (raw SQL) instead of `mbql.stage/mbql` (structured), so it's pre-flight-validated the same way (its SQL string aside) — see `native-sql`. Only the legacy flat forms below skip validation.
9
+ MBQL is the structured query format: portable across warehouse engines, and a card built on it wires to dashboard filters as-is. Write a structured query first; write native SQL (a `mbql.stage/native` stage, see `native-sql`) for window functions beyond `offset`, CTEs, set operations, engine-specific functions, or when asked for SQL.
10
10
 
11
- Prefer a **structured** stage over a native SQL stage: portable across warehouse engines. Try it first; fall back to a native stage when structured MBQL can't express what you need, or when a structured body keeps failing server-side and you can't resolve it. For native SQL with parameters (template tags, field filters, snippets), load `native-sql`.
12
-
13
- General flag conventions, body-input precedence, output flags, `./.scratch`, and `mb uuid` mechanics live in `core` (`mb skills get core`).
11
+ Flag conventions, body input, output flags and `./.scratch` live in `core` (`mb skills get core`).
14
12
 
15
13
  ## The shape
16
14
 
17
- A flat object — `lib/type`, a numeric `database` id, and an ordered `stages` array. No recursive `source-query` nesting; multi-step queries are sibling stages.
18
-
19
15
  ```json
20
16
  {
21
17
  "lib/type": "mbql/query",
@@ -31,109 +27,67 @@ A flat object — `lib/type`, a numeric `database` id, and an ordered `stages` a
31
27
  }
32
28
  ```
33
29
 
34
- - **Numeric ids only.** `database`, `source-table`, and field ids are integers from `mb database list` / `mb table get <id> --include fields`. (Git-sync YAML uses _names_ like `[Sample Database, PUBLIC, ORDERS]`; the `/api/dataset` form uses numeric ids — don't mix them.)
35
- - **First stage** carries `source-table` (a table id) or `source-card` (a saved card). Later stages omit both and read the previous stage's output columns by name.
36
- - `source-card` references a saved card by its **numeric id** (from `mb card list`), not its string entity id; downstream fields are referenced by column name (string), not a field id.
30
+ - `database`, `source-table`, `source-card` and field ids are numeric, copied from `mb database list`, `mb table get <id> --include fields`, `mb card list`. A wrong id that exists resolves to the wrong column without an error, so copy ids, never guess them.
31
+ - The first stage names exactly one source: `source-table` (a table id) or `source-card` (a saved question or model id). Later stages name none; they read the previous stage's output columns.
32
+ - Stage keys: `joins`, `expressions`, `filters`, `aggregation`, `breakout`, `fields`, `order-by`, `limit`. Each list holds at least one clause.
37
33
 
38
- ## The one rule that trips everyone: options object is **second**
34
+ ## Clauses
39
35
 
40
- Every clause is `[op, {options}, ...args]`. The options object is element **1**, args follow.
36
+ Every clause is `[op, {options}, ...args]` with the options object at position 1, `{}` when there are none:
41
37
 
42
38
  ```json
43
- ["field", { "base-type": "type/Text" }, 1779] // field id is THIRD; options may be empty {}
44
- ["count", {}] // no args
45
- ["sum", {}, ["field", {}, 42]]
46
- ["=", {}, ["field", {}, 1779], "delivered"]
47
- ["asc", {}, ["field", {}, 42]]
39
+ ["count", {}]
40
+ ["sum", {}, ["field", {}, 42]]
41
+ ["=", {}, ["field", {}, 61], "Gadget", "Widget"]
42
+ ["field", { "temporal-unit": "month" }, 22]
48
43
  ```
49
44
 
50
- The legacy field shape `["field", id, opts]` (id second) is **rejected** here. A slot-1 violation surfaces from `--dry-run` as `must be the field options object` / `must be the clause options object` at `/stages/0/<verb>/<n>/1`.
45
+ An options key the server doesn't know is rejected or silently dropped, never applied, so spell keys exactly as written here. A field ref is `["field", {options}, <field id>]`. Its options: `temporal-unit` (bucket a date: `day`, `week`, `month`, `quarter`, `year`, …), `binning` (`{"strategy": "num-bins", "num-bins": 10}`), `join-alias` (a column of an explicit join), `source-field` (a column reached through an FK), `base-type` (on a column named by string, see Multi-stage).
51
46
 
52
- The same `[op, {options}, …]` rule holds for `aggregation`, `breakout` (a list of field refs), `filters` (implicitly ANDed; nest an explicit `["or", {}, …]` for OR), `order-by`, `expressions`, and join `conditions`.
47
+ ## Filters, aggregation, breakout
53
48
 
54
- ## UUIDs: optional — mint only to reference a clause
49
+ - `filters` are ANDed; OR is `["or", {}, a, b, …]`. Multi-value is `["in", {}, <field>, "a", "b"]` / `["not-in", …]`.
50
+ - Relative dates: `["time-interval", {}, <field>, -30, "day"]`, `["time-interval", {}, <field>, "current", "month"]`. A stated year or date range is absolute: `["between", {}, <field>, "2024-01-01", "2024-12-31"]` (inclusive).
51
+ - `aggregation` is a list of aggregation clauses, `breakout` a list of refs. "only / where X" is a filter; "by / per / over time" is a breakout.
52
+ - Name every aggregation a later stage, a chart setting or a target table reads: `["sum", {"name": "revenue", "display-name": "Revenue"}, <field>]`. Unnamed, it is `count`, `sum`, `avg`, … and a second `sum` is `sum_2`.
53
+ - An aggregation can be arithmetic over aggregations: `["/", {"name": "aov"}, ["sum", {}, <field>], ["count", {}]]`.
54
+ - Date arithmetic is `["datetime-diff", {}, a, b, "day"]`.
55
55
 
56
- `lib/uuid` is **optional — leave it out whenever you can.** Omit it and the server generates a unique one for every clause; an empty options object `{}` is the normal case. The more UUIDs you hand-manage the easier it is to trip the server's "all `lib/uuid`s must be unique" check — a duplicated UUID passes pre-flight, then fails server-side.
56
+ ## Order and limit
57
57
 
58
- Set an explicit `lib/uuid` only when you must **reference a clause from elsewhere in the query** — you have to know the value to point at. The case that needs it: **ordering by (or otherwise reusing) an aggregation.** `["aggregation", {…}, "<uuid>"]`'s third arg is the **string** `lib/uuid` of the target aggregation, so give that aggregation an explicit `lib/uuid` and point the ref at the same string. A numeric position fails with `must be the target aggregation's lib/uuid (string), not a numeric position`.
58
+ `order-by` holds `["asc", {}, <ref>]` / `["desc", {}, <ref>]`. To order by an aggregation of the same stage, set a `lib/uuid` from `mb uuid --format text` (the bare value) in that aggregation's options and point the ref at the same string:
59
59
 
60
60
  ```json
61
- "aggregation": [["count", { "lib/uuid": "AGG_UUID" }]],
62
- "order-by": [["desc", {}, ["aggregation", {}, "AGG_UUID"]]]
61
+ "aggregation": [["count", {}], ["sum", {"name": "revenue", "lib/uuid": "<uuid>"}, ["field", {}, 40]]],
62
+ "breakout": [["field", {}, 43]],
63
+ "order-by": [["desc", {}, ["aggregation", {}, "<uuid>"]]],
64
+ "limit": 10
63
65
  ```
64
66
 
65
- (`AGG_UUID` is both the aggregation's own `lib/uuid` and the string the ref points at — one value, by string equality. Every other clause omits its UUID. Expression refs work the same way but key off the expression's `lib/expression-name` string, so expressions rarely need an explicit `lib/uuid`.)
67
+ A query read back from Metabase carries a `lib/uuid` on every clause, and each must be unique within the query: drop it from a clause you duplicate.
66
68
 
67
- When you do need one, **always mint it with `mb uuid` — never write, guess, or copy a UUID yourself.** A hand-authored value is rejected pre-flight as not-a-v4 (`"a1"`, `"uuid-1"`, `"agg-uuid-001"` → ``must be a UUID v4 (RFC 4122) — run `mb uuid` ``), or if it looks valid risks colliding with another clause. Mint just the few you reference (`mb uuid --count 2 --json`; this also covers native template-tag ids and any other `format: "uuid"` slot).
69
+ "Top / first / latest N" is `order-by` plus `limit: N` in the stage.
68
70
 
69
- ## Authoring loop: print-schema → dry-run → run
71
+ ## Expressions
70
72
 
71
- `mb query` is the canonical authoring surface. Three modes:
73
+ `expressions` is a list of clauses, each named by `lib/expression-name` in its options; `["expression", {}, "<name>"]` uses one in the same stage:
72
74
 
73
- ```bash
74
- mb query --print-schema --profile <n> > ./.scratch/mbql-schema.json # 1. fetch the schema
75
- mb query --file q.json --dry-run --profile <n> # 2. validate, no network
76
- mb query --file q.json --profile <n> --json # 3. validate + run
75
+ ```json
76
+ "expressions": [["+", {"lib/expression-name": "Subtotal"}, ["field", {}, 40], ["field", {}, 44]]],
77
+ "aggregation": [["sum", {}, ["expression", {}, "Subtotal"]]]
77
78
  ```
78
79
 
79
- - `--print-schema` emits `{ schema, defs }` where `defs` carries `id.yaml` / `parameter.yaml` / `ref.yaml` / `temporal_bucketing.yaml` keyed by the path used in the schema's `$ref`s. Read it first for any non-trivial query — cheaper than guess-and-fail.
80
- - `--dry-run` validates and emits `{ ok, errors: [{ path, message }] }`. Exit `0` valid, `2` invalid. No request sent. Iterate until `ok: true`.
81
- - run (no flag) validates, then on success sends to `/api/dataset`. On validation failure it writes the same envelope, exits `2`, and **never sends**.
82
-
83
- `path` is a JSON Pointer into the body (`/stages/0/aggregation/0`); `message` is the validator error. Exit codes: `0` valid + ran, `2` validation failed / malformed body, `1` server-side error after a valid pre-flight.
84
-
85
- **Pre-flight is a lightweight shape check, not the full backend validator.** It checks JSON shape, `lib/uuid` format, and enum values — not operator names, the first-stage source rule, or whether a reference resolves. A clean `--dry-run` is necessary but not sufficient: a body can pass pre-flight and still fail on the server (exit `1`). The server is the authority — when a run fails, read its error and fix the body. Common ones:
86
-
87
- - `not a known MBQL clause` → a misspelled or unsupported **operator**. Check the vocabulary in `operators.md` (`mb skills get mbql --full`).
88
- - `Initial MBQL stage must have either :source-table or :source-card` → the **first stage** is missing its source (a numeric table or card id); only the first stage takes one, later stages read the previous stage's columns.
89
- - `Invalid :expression reference: no expression named "X"` (or an invalid `:aggregation` reference) → a **ref** points to an expression name / aggregation `lib/uuid` that isn't defined in the query; fix the target string.
90
- - `Duplicate :lib/uuid` → you reused a `lib/uuid`. Omit them (the server mints unique ones) or give each clause a distinct value.
91
-
92
- A successful run emits the compact envelope by default: `data.rows` + slim `data.cols` (`name`, `display_name`, `base_type`, `semantic_type`). Pass `--full` for the raw `/api/dataset` envelope (`results_metadata`, `native_form`, per-column fingerprints/`field_ref`) only when you need that metadata; `--fields data.rows` narrows to rows alone. `mb query` also runs a native query — author it as an `mbql.stage/native` stage (pre-flight-validated like any MBQL body; see `native-sql`).
93
-
94
- `--skip-validate` bypasses pre-flight and sends as-is — use only when the bundled schema disagrees with what the server actually accepts (drift / false negative). Mutually exclusive with `--dry-run`. Same flag exists on `card create/update` and `transform create/update`.
80
+ ## Joins
95
81
 
96
- ## Where the query is consumed
97
-
98
- The same body and pre-flight apply everywhere a query is embedded. Each pre-flights only when the value is the `mbql/query` shape (`lib/type: "mbql/query"`); legacy shapes skip it; `--skip-validate` bypasses.
99
-
100
- | Command | The query lives at | Notes |
101
- | --------------------------------------- | ---------------------------------------------- | ------------------------------------------- |
102
- | `mb query` | the whole body | ad-hoc run against `/api/dataset` |
103
- | `card create` / `card update` | `dataset_query` | a **flat** `mbql/query` — see footgun below |
104
- | `transform create` / `transform update` | `source.query` (when `source.type` is `query`) | materializes to a warehouse table |
105
- | `measure create` / `measure update` | `definition` | exactly one `aggregation`, no `filters` |
106
- | `segment create` / `segment update` | `definition` | filter macro tied to a table |
107
-
108
- ## Footgun: `dataset_query` is the flat mbql/query, not a legacy envelope
109
-
110
- The most common mistake. The legacy shape `{ "type": "query", "database": N, "query": {…} }` looks similar but is wrong. `dataset_query` (and `source.query`, and `definition`) **is the `mbql/query` value itself**:
82
+ **A column of an FK-related table:** put the FK column's id in `source-field` and the related table's column id third. The join is added for you:
111
83
 
112
84
  ```json
113
- "dataset_query": {
114
- "lib/type": "mbql/query",
115
- "database": 2,
116
- "stages": [{ "lib/type": "mbql.stage/mbql", "source-table": 190,
117
- "aggregation": [["count", {}]] }]
118
- }
85
+ ["field", { "source-field": 1711 }, 1682]
119
86
  ```
120
87
 
121
- No `type:"query"` wrapper, no `query:` nesting. If you wrap the query inside a legacy envelope the CLI rejects it pre-send with a `ConfigError` (no `--skip-validate` gets it past). If it reached the server it would store silently and fail at run time with `Initial MBQL stage must have either :source-table or :source-card`.
122
-
123
- ## Legacy formats you may encounter
124
-
125
- Older Metabase servers used a different query envelope (sometimes called MBQL 4 / "legacy MBQL"); the `mbql/query` shape above is what recent servers store and return. You won't author the legacy shapes, but you may see them in queries created long ago. Anything not `lib/type: "mbql/query"` is sent as-is and normalized server-side — you lose validation, so don't author these:
126
-
127
- - **Legacy structured** — `{ "type": "query", "database": N, "query": { "source-table": T, … } }`
128
- - **Flat native** — `{ "type": "native", "database": N, "native": { "query": "SELECT …" } }` — the server accepts it, but author the native stage instead (`native-sql`).
129
-
130
- `mb query --file probe.json` runs these directly; `--dry-run` on them returns `{ ok: true, errors: [] }`. Don't author them by hand — build a legacy or complex query in the Metabase UI and pull the body with `mb card get <id> --full --json` / `mb transform get <id> --full --json` (which returns the `mbql/query` shape).
88
+ (`1711` = orders.customer_id, `1682` = customers.plan.)
131
89
 
132
- ## Joins and FK traversal
133
-
134
- Two ways to read columns from a related table.
135
-
136
- **Explicit join.** A stage's `joins` array holds join objects, each with three required keys: `stages` (the joined source as its own one-stage array carrying `source-table`/`source-card`), `conditions` (the ON clause — `[op, {}, leftRef, rightRef]`, slot-1 rule and all), and `alias` (the string name you address joined columns by). Optional `strategy` (`left-join` default; also `right-join` / `inner-join` / `full-join`) and `fields` (`"all"` | `"none"` | an array of refs — which joined columns to select). Reference a joined column anywhere downstream by putting **`join-alias`** in the field options:
90
+ **An explicit join** for a non-FK condition, a chosen strategy, or a joined source question:
137
91
 
138
92
  ```json
139
93
  "joins": [
@@ -141,28 +95,20 @@ Two ways to read columns from a related table.
141
95
  "alias": "Customers",
142
96
  "strategy": "left-join",
143
97
  "stages": [{ "lib/type": "mbql.stage/mbql", "source-table": 170 }],
144
- "conditions": [
145
- ["=", {}, ["field", {}, 1711], ["field", { "join-alias": "Customers" }, 1684]]
146
- ],
147
- "fields": "none"
98
+ "conditions": [["=", {}, ["field", {}, 1711], ["field", { "join-alias": "Customers" }, 1684]]],
99
+ "fields": "all"
148
100
  }
149
101
  ],
150
102
  "breakout": [["field", { "join-alias": "Customers" }, 1682]]
151
103
  ```
152
104
 
153
- Left ref is a column of the stage's own source (`1711` = orders.customer_id); the right ref carries `join-alias` and points at the joined table's key (`1684` = customers.id). Every later reference to a joined column (`1682` = customers.plan) needs that same `join-alias`. Stack multiple objects in `joins`, each with its own `alias`.
154
-
155
- **Implicit FK join via `source-field`.** For a single-hop FK lookup, skip the join — put the FK column's id in the target field's `source-field` option and Metabase traverses the relationship:
156
-
157
- ```json
158
- ["field", { "source-field": 1711 }, 1682] // orders.customer_id → customers.plan
159
- ```
160
-
161
- `source-field` is the **FK field id** (orders.customer_id); the third element is the **target field id** in the related table (customers.plan). Use it for "show a column from the table this FK points at"; reach for an explicit join when you need a non-FK condition, a non-default strategy, or control over which joined columns return.
105
+ - `alias`, `stages` and `conditions` are required; `strategy` is `left-join` (default), `inner-join`, `right-join` or `full-join`.
106
+ - `fields` picks the joined columns a row listing returns: `"all"`, or a list of refs. Without it the join adds none.
107
+ - In the join's stage, every ref to a joined column carries `join-alias`, conditions included. A later stage reads it by name, like any earlier-stage column.
162
108
 
163
- ## Multi-stage pipelines
109
+ ## Multi-stage
164
110
 
165
- Stages run in order; each reads the **previous stage's output columns** — the breakouts and aggregations it produced — referenced by **string name + `base-type`**, not a numeric field id. Only the first stage takes a `source-table`/`source-card`. Add a stage to operate on an aggregate (you can't filter or order by an aggregation within the stage that computes it): aggregate, then filter the aggregate, then order + limit.
111
+ A later stage reads the previous stage's output by column name, with the column's `base-type`: `["field", {"base-type": "type/BigInteger"}, "count"]`. Filter on an aggregate (HAVING), or aggregate an aggregate, in the next stage:
166
112
 
167
113
  ```json
168
114
  "stages": [
@@ -170,16 +116,15 @@ Stages run in order; each reads the **previous stage's output columns** — the
170
116
  "aggregation": [["sum", { "name": "total" }, ["field", {}, 1715]]],
171
117
  "breakout": [["field", {}, 1711]] },
172
118
  { "lib/type": "mbql.stage/mbql",
173
- "filters": [[">", {}, ["field", { "base-type": "type/BigInteger" }, "total"], 0]] },
174
- { "lib/type": "mbql.stage/mbql",
175
- "order-by": [["desc", {}, ["field", { "base-type": "type/BigInteger" }, "total"]]],
119
+ "filters": [[">", {}, ["field", { "base-type": "type/Float" }, "total"], 1000]],
120
+ "order-by": [["desc", {}, ["field", { "base-type": "type/Float" }, "total"]]],
176
121
  "limit": 3 }
177
122
  ]
178
123
  ```
179
124
 
180
- Later stages address the first stage's aggregation by the `name` you gave it (`"total"`) — set that `name`, or the column lands as the default `sum` / `count` / … and you reference that string instead.
125
+ The names and base types are the `name` and `base_type` of the columns the earlier stages return: run them once (`mb query … --json`, `data.cols`) and copy both. A breakout keeps its field's name (`CREATED_AT`, even when bucketed); an aggregation has the `name` you gave it.
181
126
 
182
- **Window functions** sit in `aggregation` next to ordinary aggregates. `offset` reads a value from another breakout row — month-over-month is `offset` of a sum by `-1` against a monthly breakout:
127
+ **Window:** `offset` sits in `aggregation` and reads another breakout row. Month-over-month against a monthly breakout:
183
128
 
184
129
  ```json
185
130
  "aggregation": [
@@ -189,23 +134,47 @@ Later stages address the first stage's aggregation by the `name` you gave it (`"
189
134
  "breakout": [["field", { "temporal-unit": "month" }, 1717]]
190
135
  ```
191
136
 
192
- **Binning** is a breakout-level field option — bucket a numeric column into ranges with `["field", { "binning": { "strategy": "num-bins", "num-bins": 5 } }, 1715]`, the numeric counterpart to the `temporal-unit` bucket. Strategies (`num-bins` / `bin-width` / `default`) are in the operator reference.
137
+ ## Saved questions, models and definitions
193
138
 
194
- ## Naming aggregation output columns
139
+ - A saved question or model is a source: `"source-card": 137` on the first stage, same database as the rest of the query; its columns go by name with `base-type`, as in a later stage.
140
+ - A metric is an aggregation: `["metric", {}, <card id>]`, on a stage whose source is the metric's table.
141
+ - A segment is a filter: `["segment", {}, <segment id>]`, on its table.
142
+ - A metric's output column is named for its inner aggregation (`sum`, `count`); set `"name"` in its options for a later stage to read it by.
195
143
 
196
- Default aggregations materialize as `count`, `count_where`, `avg`, `avg_2`, `sum`, … — fine for an ad-hoc run, ugly for a transform target table or card column. Set `name` (the warehouse column name) and `display-name` (the UI header) in the aggregation's options:
144
+ <!-- requires: measures -->
197
145
 
198
- ```json
199
- ["count", { "name": "shipments_shipped", "display-name": "Shipments shipped" }]
200
- ```
146
+ A measure is an aggregation, `["measure", {}, <measure id>]`, on its table, and is named like a metric.
201
147
 
202
- ## Operator reference
148
+ <!-- /requires -->
203
149
 
204
- The full operator vocabulary — filter operators (`=`, `!=`, `<`, `between`, `contains`, `is-null`, …), aggregation functions (`count`, `sum`, `avg`, `distinct`, `count-where`, `share`, …), expression operators (arithmetic, string, temporal), temporal-bucketing units, and binning strategies — lives in this skill's `references/operators.md`, in numeric-id form. Load it on demand rather than dumping the schema:
150
+ ## Authoring loop: print-schema → dry-run → run
205
151
 
206
152
  ```bash
207
- mb skills get mbql --full # appends references/operators.md to this body
208
- mb skills path mbql # → the skill dir; then Read references/operators.md
153
+ mb query --file q.json --dry-run --profile <n> # check + compile on the server, no run
154
+ mb query --file q.json --profile <n> --json # check + run
155
+ mb query --print-schema --profile <n> > ./.scratch/mbql-schema.json # the full JSON Schema
209
156
  ```
210
157
 
211
- `mb query --print-schema` is the exhaustive-but-heavy fallback (the full JSON Schema, ~1600 lines). The cheat-sheet covers the vocabulary; the `--dry-run` loop settles any disagreement.
158
+ - `--dry-run` checks the shape locally, then has the server compile the query to SQL without running it. It answers `{ ok, errors: [{ path, message }], sql }`: exit `0` with the compiled `sql`, or exit `2` with `sql: null` when either check rejects the body. A local error's `path` is a JSON Pointer into the body; a server error's is `""`. Exit `1` means the compile could not run (the server refused permission, server unreachable).
159
+ - The server compile catches what the shape check cannot: a ref to a missing aggregation or expression, an unknown clause, a duplicate `lib/uuid`, a missing table, field, card or segment, a raw-variable template tag with no value or `default` outside an optional `[[ ]]` clause, a `required` tag with no value. A column's type not suiting its operator and a misspelled column name in a later stage are caught only by the warehouse, so a mistake there compiles and fails on the run. When a run fails, read the message and fix the body it names; an error naming nothing in the body (a `NullPointerException`) is a server fault, so stop editing a body that is otherwise correct.
160
+ - A run checks the shape first and never sends an invalid body; exit `1` is a server or warehouse error after that.
161
+ - A server error `lib/uuid: missing required key` at a clause means that clause's arguments are wrong: their count, a unit it doesn't take, a bad time zone.
162
+ - A run answers `data.rows` and slim `data.cols` (`name`, `display_name`, `base_type`, `semantic_type`); `--full` returns the raw `/api/dataset` envelope.
163
+
164
+ ## Where the query goes
165
+
166
+ Every command below takes the query object itself at the path shown, checked by the same pre-flight (`--skip-validate` sends it unchecked).
167
+
168
+ | Command | The query lives at | Notes |
169
+ | --------------------------------------- | ---------------------------------------------- | --------------------------------- |
170
+ | `mb query` | the whole body | ad-hoc run |
171
+ | `card create` / `card update` | `dataset_query` | |
172
+ | `transform create` / `transform update` | `source.query` (when `source.type` is `query`) | materializes to a warehouse table |
173
+ | `measure create` / `measure update` | `definition` | see below |
174
+ | `segment create` / `segment update` | `definition` | see below |
175
+
176
+ A measure `definition` is one stage with `source-table` and exactly one `aggregation` that references no metric, and no `joins`, `expressions`, `breakout`, `filters`, `fields`, `order-by` or `limit`. A segment `definition` is one stage with `source-table` and at least one `filters` clause, and no `joins`, `expressions`, `breakout`, `aggregation`, `order-by` or `limit`.
177
+
178
+ ## Operator reference
179
+
180
+ Every filter, aggregation, expression, temporal unit and binning strategy, with arguments: `references/operators.md` (`mb skills get mbql --full`, or `mb skills path mbql` and read the file).