better-supabase 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/bin/better-supabase.js +4 -0
- package/dist/{base64-CQeB1eSf.js → base64-D2gsioCY.js} +2 -2
- package/dist/channel-FQW-CnGR.d.ts +70 -0
- package/dist/claims-BAf6c7is.js +48 -0
- package/dist/cli/_format-Cax5EsM9.js +101 -0
- package/dist/cli/bin.d.ts +1 -0
- package/dist/cli/bin.js +48 -0
- package/dist/cli/codemod-DqV7612m.js +388 -0
- package/dist/cli/command-CK14fP91.js +502 -0
- package/dist/cli/compare-BmIWVEui.js +9 -0
- package/dist/cli/config-CPVpXP5I.js +1965 -0
- package/dist/cli/config-dtoekM0v.js +2 -0
- package/dist/cli/db-DOBPt660.js +52 -0
- package/dist/cli/diff-SjkO5rNr.js +752 -0
- package/dist/cli/dist-DBPdlPYK.js +1112 -0
- package/dist/cli/dist-DreZ24Sz.js +129 -0
- package/dist/cli/dist-xn4wlboc.js +732 -0
- package/dist/cli/doctor-L7Z8mYTx.js +2863 -0
- package/dist/cli/env-DmKv_G4A.js +108 -0
- package/dist/cli/env-jIFUADLY.js +511 -0
- package/dist/cli/errors-4v4DTtda.js +56 -0
- package/dist/cli/fastest-levenshtein-CFN-lNDv.js +120 -0
- package/dist/cli/gen-BJc9vdyu.js +2 -0
- package/dist/cli/gen-C2osRcr5.js +2204 -0
- package/dist/cli/index.d.ts +493 -0
- package/dist/cli/index.js +184 -0
- package/dist/cli/init-Saf5-R9T.js +550 -0
- package/dist/cli/introspect--H7oGmcd.js +81 -0
- package/dist/cli/io-k41_z-jT.js +24 -0
- package/dist/cli/json5-ChRycquj.js +787 -0
- package/dist/cli/jsonc-BUniUpOk.js +2 -0
- package/dist/cli/jsonc-D5Fu67jw.js +45 -0
- package/dist/cli/keys-ByKHnvP9.js +83 -0
- package/dist/cli/ohash-D7bG_EOb.js +277 -0
- package/dist/cli/openapi-Cp5Fyta-.js +66 -0
- package/dist/cli/project-B_GeXyHh.js +70 -0
- package/dist/cli/prompts-BNcNfAve.js +1142 -0
- package/dist/cli/prompts-BTYQGunc.js +2 -0
- package/dist/cli/read-sets-BfMQcKy8.js +289 -0
- package/dist/cli/rolldown-runtime-BPOCksWG.js +24 -0
- package/dist/cli/run-BKR2W_79.js +351 -0
- package/dist/cli/seed-CUlqWh-8.js +98 -0
- package/dist/cli/skills-LJJIhLFR.js +137 -0
- package/dist/cli/sql-DzPbfngx.js +348 -0
- package/dist/cli/style-C0NFdJRL.js +29 -0
- package/dist/cli/toml-DB-MNnFs.js +424 -0
- package/dist/cli/version-BDJuO0UR.js +4 -0
- package/dist/cli/yaml-CYCbJ6et.js +2252 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +15 -22
- package/dist/clone-BfgmLU90.js +21 -0
- package/dist/{compiler-2zqGzxVZ.d.ts → compiler-BXH_aZ7N.d.ts} +2 -2
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +5 -5
- package/dist/{config-DOsGYSiT.js → config-DreERlKo.js} +1 -1
- package/dist/{config-C1CYcm6o.d.ts → config-T_ejwyd3.d.ts} +176 -11
- package/dist/{define-DUbydmJa.d.ts → define-Bp_BZa5h.d.ts} +37 -29
- package/dist/{define-DF341GDj.js → define-cNKzqwL_.js} +356 -89
- package/dist/edge/index.d.ts +20 -13
- package/dist/edge/index.js +55 -26
- package/dist/{entitlements-DvJXoI02.d.ts → entitlements-DUxU4oHe.d.ts} +2 -2
- package/dist/env/index.d.ts +2 -2
- package/dist/env/index.js +34 -1
- package/dist/{errors-Bl3rkOzo.js → errors-DtwXa6b8.js} +2 -1
- package/dist/events/index.d.ts +3 -2
- package/dist/events/index.js +69 -16
- package/dist/events-aIO7vsIk.d.ts +230 -0
- package/dist/executor-BunPOO-k.d.ts +402 -0
- package/dist/{executor-B26lgbHD.d.ts → executor-Cghdstwu.d.ts} +1 -2
- package/dist/{executor-C57jx2pn.js → executor-XycESQPH.js} +3 -3
- package/dist/hono/index.d.ts +27 -23
- package/dist/hono/index.js +46 -11
- package/dist/impersonation-VfaGc4Q_.js +41 -0
- package/dist/{index-BNsABq7P.d.ts → index-BGdgBPdf.d.ts} +66 -25
- package/dist/{index-qriRM9cZ.d.ts → index-C7f8cOBM.d.ts} +4 -4
- package/dist/{index-Dy6kuF0P.d.ts → index-CLg87OBW.d.ts} +6 -1
- package/dist/{index-GV77NpRP.d.ts → index-DOESKG27.d.ts} +34 -9
- package/dist/{index-CriFFJ_p.d.ts → index-DgILJRXj.d.ts} +43 -17
- package/dist/{index-UJ-LUxtI.d.ts → index-DmXSxbLi.d.ts} +14 -14
- package/dist/{index-Cf-D2jk1.d.ts → index-Dxn2a5cw.d.ts} +2 -2
- package/dist/{index-CTTMS6_1.d.ts → index-SaTsEfGP.d.ts} +86 -9
- package/dist/{index-CADlNHK-.d.ts → index-fag8VJZ2.d.ts} +5 -6
- package/dist/index.d.ts +34 -17
- package/dist/index.js +15 -14
- package/dist/jobs/index.d.ts +147 -95
- package/dist/jobs/index.js +773 -250
- package/dist/{json-schema--aOXAGfU.js → json-schema-m1fiwKgN.js} +23 -2
- package/dist/kit-events-CTFDfSwb.js +60 -0
- package/dist/kit-transport-B82k1djG.d.ts +33 -0
- package/dist/kit-transport-DJlHQUBU.js +55 -0
- package/dist/{config-Be4GwsqI.js → kits-CGLLrNPd.js} +38 -10
- package/dist/list/index.d.ts +1 -1
- package/dist/list/index.js +3 -3
- package/dist/{live-D8rV1Ldw.js → live-CdJBOc4f.js} +13 -9
- package/dist/{live-QE3UPbGm.d.ts → live-D9W2M5aO.d.ts} +16 -15
- package/dist/lookup-BaP5bI27.js +18 -0
- package/dist/mcp/index.d.ts +39 -22
- package/dist/mcp/index.js +39 -25
- package/dist/{mfa-x3V3vGh-.d.ts → mfa-CusDgPaD.d.ts} +5 -1
- package/dist/next/image/index.js +6 -3
- package/dist/next/index.d.ts +60 -36
- package/dist/next/index.js +167 -50
- package/dist/notifications/index.d.ts +162 -0
- package/dist/notifications/index.js +264 -0
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +6 -6
- package/dist/orgs/index.d.ts +132 -0
- package/dist/orgs/index.js +245 -0
- package/dist/orpc/index.d.ts +37 -20
- package/dist/orpc/index.js +24 -11
- package/dist/otel/index.d.ts +24 -5
- package/dist/otel/index.js +124 -64
- package/dist/permdock-sql-C2Inc6Xc.d.ts +29 -0
- package/dist/permdock-sql-DgOfeixi.js +51 -0
- package/dist/plugin-DwARMuQp.js +59 -0
- package/dist/{plugin-DVRB8qNE.d.ts → plugin-o144f322.d.ts} +17 -5
- package/dist/plugins/actor/index.d.ts +5 -2
- package/dist/plugins/actor/index.js +22 -8
- package/dist/plugins/rules/index.d.ts +2 -2
- package/dist/plugins/rules/index.js +52 -17
- package/dist/plugins/soft-delete/index.d.ts +3 -3
- package/dist/plugins/soft-delete/index.js +14 -5
- package/dist/plugins/tenant/index.d.ts +3 -3
- package/dist/plugins/tenant/index.js +45 -21
- package/dist/plugins/timestamps/index.d.ts +1 -1
- package/dist/plugins/timestamps/index.js +4 -3
- package/dist/plugins/validation/index.d.ts +2 -2
- package/dist/plugins/validation/index.js +26 -6
- package/dist/{pool-B9qsLyFR.d.ts → pool-C9voM4Kw.d.ts} +24 -6
- package/dist/postgres/index.d.ts +5 -5
- package/dist/postgres/index.js +20 -10
- package/dist/{postgrest-DmBlevh-.d.ts → postgrest-CruYKAvV.d.ts} +1 -1
- package/dist/{problem-CGt1ADix.js → problem-BW1KhzSG.js} +2 -1
- package/dist/{problem-Z2RTQjZD.d.ts → problem-Blxe8S31.d.ts} +1 -1
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +3 -3
- package/dist/{query-BdKLTPlj.js → query-CCbo44lG.js} +18 -18
- package/dist/queue-BYUCjr59.d.ts +252 -0
- package/dist/react/index.d.ts +8 -7
- package/dist/react/index.js +4 -3
- package/dist/react/server.d.ts +16 -5
- package/dist/react/server.js +12 -4
- package/dist/react/session.d.ts +10 -4
- package/dist/react/session.js +11 -3
- package/dist/{react-DNBYNazu.js → react-C_s7kiNz.js} +138 -46
- package/dist/{read-set-D0qBcboM.js → read-set-DQFt1N_Y.js} +71 -15
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +14 -12
- package/dist/{index-kpgopLNv.d.ts → refresh-BTrQ_ZTp.d.ts} +6 -3
- package/dist/{resolve-BRciX2jK.d.ts → resolve-C15TJq77.d.ts} +22 -11
- package/dist/{resource-D30rp0GN.js → resource-CRxxwkQq.js} +24 -9
- package/dist/{resource-CwVgiI5q.d.ts → resource-D8iqWMr-.d.ts} +6 -6
- package/dist/respond-D2OQl62-.d.ts +371 -0
- package/dist/{result-DWXatkd6.js → result-BKiliPY7.js} +2 -2
- package/dist/server/index.d.ts +17 -15
- package/dist/server/index.js +16 -22
- package/dist/server-Csx2sRjg.js +655 -0
- package/dist/{shared-_6-uPL7E.js → shared-D1dRUrAg.js} +19 -4
- package/dist/signers-Cc6r98SW.d.ts +162 -0
- package/dist/{simplify-LakqK1vH.js → simplify-_0oUKqCd.js} +27 -95
- package/dist/sql/index.d.ts +247 -10
- package/dist/sql/index.js +8591 -780
- package/dist/{sql-BIgk12ew.js → sql-Coh6n4cC.js} +11 -3
- package/dist/ssr/index.d.ts +4 -4
- package/dist/ssr/index.js +1 -2
- package/dist/{standard-FUi3Z3-7.js → standard-D7r6dMUu.js} +6 -3
- package/dist/{standard-eudBiRk1.d.ts → standard-J4YgMOLm.d.ts} +1 -1
- package/dist/{stats-D78UQ8Yu.js → stats-Bqob3WqT.js} +34 -9
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.js +174 -27
- package/dist/support-DT-OhSxD.d.ts +88 -0
- package/dist/support-Dk6vdmEw.js +291 -0
- package/dist/support-view-Da5peKFg.d.ts +17 -0
- package/dist/support-view-g4YLBeqX.js +18 -0
- package/dist/{tables-Dhha3BXM.js → tables-Cb-3_VWc.js} +14 -0
- package/dist/{permdock-sql-Bta_G0v-.js → template-TxrGI5jR.js} +2 -31
- package/dist/{temporal-BwshQk0W.js → temporal-CVlIV2DZ.js} +17 -4
- package/dist/{temporal-required-CMxeSVPo.js → temporal-required-CAt4Dc9Z.js} +2 -2
- package/dist/testing/index.d.ts +113 -24
- package/dist/testing/index.js +375 -47
- package/dist/{types-DONv9SHN.d.ts → types-Dnf_wRDz.d.ts} +26 -3
- package/dist/user-change-CHFEUro1.js +49 -0
- package/dist/{webhooks-CAIFQSTM.js → verify-Ce49ETPz.js} +38 -19
- package/dist/{version-BfpG2gks.js → version-DM_Roffb.js} +1 -1
- package/dist/{view-3Po_PVlr.d.ts → view-BEf0diC5.d.ts} +10 -5
- package/dist/{mfa-BxoR1RkN.js → view-Bq64ki8-.js} +210 -64
- package/dist/webhooks/index.d.ts +136 -5
- package/dist/webhooks/index.js +588 -2
- package/dist/wire-D2dT86vi.js +35 -0
- package/package.json +50 -10
- package/schemas/config-v1.json +131 -1
- package/schemas/doctor-report-v1.json +10 -0
- package/skills/better-supabase/SKILL.md +60 -10
- package/skills/better-supabase/references/plugins.md +13 -14
- package/skills/better-supabase/references/troubleshooting.md +25 -4
- package/skills/better-supabase-api/SKILL.md +74 -19
- package/skills/better-supabase-api/references/adapters.md +48 -27
- package/skills/better-supabase-auth/SKILL.md +149 -0
- package/skills/better-supabase-auth/references/permdock.md +100 -0
- package/skills/better-supabase-testing/SKILL.md +58 -4
- package/dist/claims-CoTobNC-.js +0 -25
- package/dist/events-Do8jXh4D.d.ts +0 -84
- package/dist/executor-DynmIWhq.d.ts +0 -195
- package/dist/invalidate-DbxuL2jL.js +0 -18
- package/dist/permdock-sql-DImJULY-.d.ts +0 -17
- package/dist/plugin-BqR6wKMB.js +0 -23
- package/dist/respond-C44EZAJo.js +0 -399
- package/dist/respond-DAkPIdTH.d.ts +0 -175
- package/dist/result-c2OYgCV2.d.ts +0 -203
- package/dist/view-wZ-9qIUz.js +0 -45
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-supabase",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Strongly typed Supabase: generated schema, typed repositories, plugins, auth glue
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Strongly typed Supabase: generated schema, typed repositories, plugins, auth glue, framework integrations and the better-supabase CLI.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"codegen",
|
|
6
8
|
"hono",
|
|
7
9
|
"mcp",
|
|
8
10
|
"nextjs",
|
|
@@ -25,7 +27,11 @@
|
|
|
25
27
|
"url": "git+https://github.com/ScaleDockHQ/better-supabase.git",
|
|
26
28
|
"directory": "packages/better-supabase"
|
|
27
29
|
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"better-supabase": "./bin/better-supabase.js"
|
|
32
|
+
},
|
|
28
33
|
"files": [
|
|
34
|
+
"bin",
|
|
29
35
|
"dist",
|
|
30
36
|
"schemas",
|
|
31
37
|
"skills",
|
|
@@ -43,6 +49,10 @@
|
|
|
43
49
|
"types": "./dist/config/index.d.ts",
|
|
44
50
|
"default": "./dist/config/index.js"
|
|
45
51
|
},
|
|
52
|
+
"./cli": {
|
|
53
|
+
"types": "./dist/cli/index.d.ts",
|
|
54
|
+
"default": "./dist/cli/index.js"
|
|
55
|
+
},
|
|
46
56
|
"./client": {
|
|
47
57
|
"types": "./dist/client/index.d.ts",
|
|
48
58
|
"default": "./dist/client/index.js"
|
|
@@ -96,6 +106,14 @@
|
|
|
96
106
|
"types": "./dist/jobs/index.d.ts",
|
|
97
107
|
"default": "./dist/jobs/index.js"
|
|
98
108
|
},
|
|
109
|
+
"./orgs": {
|
|
110
|
+
"types": "./dist/orgs/index.d.ts",
|
|
111
|
+
"default": "./dist/orgs/index.js"
|
|
112
|
+
},
|
|
113
|
+
"./notifications": {
|
|
114
|
+
"types": "./dist/notifications/index.d.ts",
|
|
115
|
+
"default": "./dist/notifications/index.js"
|
|
116
|
+
},
|
|
99
117
|
"./env": {
|
|
100
118
|
"types": "./dist/env/index.d.ts",
|
|
101
119
|
"default": "./dist/env/index.js"
|
|
@@ -174,6 +192,7 @@
|
|
|
174
192
|
"dependencies": {
|
|
175
193
|
"@standard-schema/spec": "1.1.0",
|
|
176
194
|
"@supabase/middleware": "1.0.0",
|
|
195
|
+
"@supabase/postgrest-js": "2.117.2",
|
|
177
196
|
"@supabase/postgrest-typegen": "0.3.1",
|
|
178
197
|
"@supabase/server": "1.9.0",
|
|
179
198
|
"@supabase/ssr": "0.12.7"
|
|
@@ -182,12 +201,16 @@
|
|
|
182
201
|
"@arethetypeswrong/cli": "0.18.5",
|
|
183
202
|
"@better-supabase/ox-config": "0.0.0",
|
|
184
203
|
"@better-supabase/typescript-config": "0.0.0",
|
|
204
|
+
"@clack/prompts": "1.8.1",
|
|
205
|
+
"@effect/platform-node": "4.0.0",
|
|
185
206
|
"@opentelemetry/api": "1.9.1",
|
|
186
207
|
"@orpc/server": "2.0.0-beta.40",
|
|
208
|
+
"@supabase/config": "0.11.1",
|
|
187
209
|
"@supabase/supabase-js": "2.117.2",
|
|
210
|
+
"@t3-oss/env-core": "0.13.11",
|
|
188
211
|
"@tanstack/query-core": "5.104.0",
|
|
189
212
|
"@tanstack/react-query": "5.104.0",
|
|
190
|
-
"@types/node": "
|
|
213
|
+
"@types/node": "26.6.3",
|
|
191
214
|
"@types/pg": "8.23.1",
|
|
192
215
|
"@types/react": "19.3.0",
|
|
193
216
|
"@types/react-dom": "19.3.0",
|
|
@@ -195,14 +218,22 @@
|
|
|
195
218
|
"@vitest/coverage-v8": "5.0.3",
|
|
196
219
|
"ajv": "8.20.0",
|
|
197
220
|
"ajv-formats": "3.0.1",
|
|
221
|
+
"c12": "4.0.0-rc.2",
|
|
222
|
+
"citty": "0.2.2",
|
|
223
|
+
"diff": "9.0.0",
|
|
224
|
+
"effect": "4.0.0",
|
|
225
|
+
"fastest-levenshtein": "1.0.16",
|
|
198
226
|
"hono": "4.13.12",
|
|
199
227
|
"next": "16.3.8",
|
|
228
|
+
"oxfmt": "0.71.0",
|
|
200
229
|
"oxlint": "1.86.0",
|
|
201
230
|
"pg": "8.23.1",
|
|
202
231
|
"publint": "0.3.24",
|
|
203
232
|
"react": "19.3.0",
|
|
204
233
|
"react-dom": "19.3.0",
|
|
234
|
+
"smol-toml": "1.9.0",
|
|
205
235
|
"temporal-polyfill": "1.0.5",
|
|
236
|
+
"tinyexec": "1.3.1",
|
|
206
237
|
"tsdown": "0.23.0",
|
|
207
238
|
"typescript": "7.0.2",
|
|
208
239
|
"valibot": "1.5.0",
|
|
@@ -210,13 +241,15 @@
|
|
|
210
241
|
"zod": "4.6.5"
|
|
211
242
|
},
|
|
212
243
|
"peerDependencies": {
|
|
213
|
-
"@opentelemetry/api": ">=1.9",
|
|
214
|
-
"@orpc/server": ">=2.0.0-
|
|
244
|
+
"@opentelemetry/api": ">=1.9 <2",
|
|
245
|
+
"@orpc/server": ">=2.0.0-beta.40 <3",
|
|
246
|
+
"@supabase/config": ">=0.9.0 <0.12",
|
|
215
247
|
"@supabase/supabase-js": "^2.116.0",
|
|
216
|
-
"@tanstack/query-core": "^5",
|
|
217
|
-
"hono": ">=4",
|
|
218
|
-
"next": ">=16",
|
|
219
|
-
"
|
|
248
|
+
"@tanstack/query-core": "^5.62.0",
|
|
249
|
+
"hono": ">=4 <5",
|
|
250
|
+
"next": ">=16 <17",
|
|
251
|
+
"oxfmt": "0.66.0",
|
|
252
|
+
"pg": ">=8.15 <9",
|
|
220
253
|
"react": "^19",
|
|
221
254
|
"temporal-polyfill": ">=1"
|
|
222
255
|
},
|
|
@@ -227,6 +260,9 @@
|
|
|
227
260
|
"@orpc/server": {
|
|
228
261
|
"optional": true
|
|
229
262
|
},
|
|
263
|
+
"@supabase/config": {
|
|
264
|
+
"optional": true
|
|
265
|
+
},
|
|
230
266
|
"@tanstack/query-core": {
|
|
231
267
|
"optional": true
|
|
232
268
|
},
|
|
@@ -236,6 +272,9 @@
|
|
|
236
272
|
"next": {
|
|
237
273
|
"optional": true
|
|
238
274
|
},
|
|
275
|
+
"oxfmt": {
|
|
276
|
+
"optional": true
|
|
277
|
+
},
|
|
239
278
|
"pg": {
|
|
240
279
|
"optional": true
|
|
241
280
|
},
|
|
@@ -253,8 +292,9 @@
|
|
|
253
292
|
"bench": "node tests/next/next.bench.ts",
|
|
254
293
|
"build": "tsdown",
|
|
255
294
|
"check:publish": "publint && pnpm pack --out pack.tgz && attw --profile esm-only pack.tgz && rm -f pack.tgz",
|
|
295
|
+
"gen:fixtures": "node scripts/gen-fixtures.ts",
|
|
256
296
|
"lint": "oxlint",
|
|
257
|
-
"test": "vitest run --coverage",
|
|
297
|
+
"test": "vitest run --project unit --coverage",
|
|
258
298
|
"transit": "true",
|
|
259
299
|
"typecheck": "tsc --noEmit"
|
|
260
300
|
}
|
package/schemas/config-v1.json
CHANGED
|
@@ -292,7 +292,10 @@
|
|
|
292
292
|
"type": "object",
|
|
293
293
|
"additionalProperties": false,
|
|
294
294
|
"properties": {
|
|
295
|
-
"scope": {
|
|
295
|
+
"scope": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"description": "The PermDock scope tenants are. Defaults to the manifest's root scope, the rls.scopes entry without within."
|
|
298
|
+
}
|
|
296
299
|
}
|
|
297
300
|
}
|
|
298
301
|
]
|
|
@@ -346,6 +349,11 @@
|
|
|
346
349
|
"description": "Tables that broadcast change signals (`table` or `schema.table`). Install with `better-supabase sql add realtime-tables`.",
|
|
347
350
|
"type": "array",
|
|
348
351
|
"items": { "type": "string" }
|
|
352
|
+
},
|
|
353
|
+
"global": {
|
|
354
|
+
"description": "Tables in `tables` without a tenant column, which broadcast on one topic for every signed-in user.",
|
|
355
|
+
"type": "array",
|
|
356
|
+
"items": { "type": "string" }
|
|
349
357
|
}
|
|
350
358
|
}
|
|
351
359
|
},
|
|
@@ -359,6 +367,14 @@
|
|
|
359
367
|
"kit": { "type": "array", "items": { "type": "string" } }
|
|
360
368
|
}
|
|
361
369
|
},
|
|
370
|
+
"kits": {
|
|
371
|
+
"type": "object",
|
|
372
|
+
"description": "How each SQL kit module maps onto the database, keyed by module name.",
|
|
373
|
+
"properties": {
|
|
374
|
+
"access": { "$ref": "#/$defs/accessKit" }
|
|
375
|
+
},
|
|
376
|
+
"additionalProperties": { "$ref": "#/$defs/kitModule" }
|
|
377
|
+
},
|
|
362
378
|
"seed": {
|
|
363
379
|
"type": "object",
|
|
364
380
|
"additionalProperties": false,
|
|
@@ -394,6 +410,120 @@
|
|
|
394
410
|
}
|
|
395
411
|
},
|
|
396
412
|
"$defs": {
|
|
413
|
+
"stringRecord": {
|
|
414
|
+
"type": "object",
|
|
415
|
+
"additionalProperties": { "type": "string" }
|
|
416
|
+
},
|
|
417
|
+
"kitModuleProperties": {
|
|
418
|
+
"mode": { "enum": ["managed", "adopt", "custom"], "default": "managed" },
|
|
419
|
+
"schema": { "type": "string", "default": "better_supabase" },
|
|
420
|
+
"tables": {
|
|
421
|
+
"type": "object",
|
|
422
|
+
"additionalProperties": { "type": ["string", "null"] }
|
|
423
|
+
},
|
|
424
|
+
"columns": {
|
|
425
|
+
"type": "object",
|
|
426
|
+
"additionalProperties": {
|
|
427
|
+
"type": "object",
|
|
428
|
+
"additionalProperties": { "type": ["string", "null"] }
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"idType": { "type": "string" },
|
|
432
|
+
"triggerPrefix": { "type": "string", "default": "bs_" },
|
|
433
|
+
"permissions": { "$ref": "#/$defs/stringRecord" },
|
|
434
|
+
"options": { "type": "object" }
|
|
435
|
+
},
|
|
436
|
+
"kitModule": {
|
|
437
|
+
"type": "object",
|
|
438
|
+
"additionalProperties": false,
|
|
439
|
+
"properties": {
|
|
440
|
+
"mode": { "$ref": "#/$defs/kitModuleProperties/mode" },
|
|
441
|
+
"schema": { "$ref": "#/$defs/kitModuleProperties/schema" },
|
|
442
|
+
"tables": { "$ref": "#/$defs/kitModuleProperties/tables" },
|
|
443
|
+
"columns": { "$ref": "#/$defs/kitModuleProperties/columns" },
|
|
444
|
+
"idType": { "$ref": "#/$defs/kitModuleProperties/idType" },
|
|
445
|
+
"triggerPrefix": {
|
|
446
|
+
"$ref": "#/$defs/kitModuleProperties/triggerPrefix"
|
|
447
|
+
},
|
|
448
|
+
"permissions": { "$ref": "#/$defs/kitModuleProperties/permissions" },
|
|
449
|
+
"options": { "$ref": "#/$defs/kitModuleProperties/options" }
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"accessKit": {
|
|
453
|
+
"type": "object",
|
|
454
|
+
"additionalProperties": false,
|
|
455
|
+
"properties": {
|
|
456
|
+
"mode": { "$ref": "#/$defs/kitModuleProperties/mode" },
|
|
457
|
+
"schema": { "$ref": "#/$defs/kitModuleProperties/schema" },
|
|
458
|
+
"tables": { "$ref": "#/$defs/kitModuleProperties/tables" },
|
|
459
|
+
"columns": { "$ref": "#/$defs/kitModuleProperties/columns" },
|
|
460
|
+
"idType": { "$ref": "#/$defs/kitModuleProperties/idType" },
|
|
461
|
+
"triggerPrefix": {
|
|
462
|
+
"$ref": "#/$defs/kitModuleProperties/triggerPrefix"
|
|
463
|
+
},
|
|
464
|
+
"permissions": { "$ref": "#/$defs/kitModuleProperties/permissions" },
|
|
465
|
+
"options": { "$ref": "#/$defs/kitModuleProperties/options" },
|
|
466
|
+
"model": {
|
|
467
|
+
"enum": ["roles", "catalog", "permdock", "custom"],
|
|
468
|
+
"default": "roles"
|
|
469
|
+
},
|
|
470
|
+
"roles": {
|
|
471
|
+
"type": "object",
|
|
472
|
+
"additionalProperties": {
|
|
473
|
+
"type": "array",
|
|
474
|
+
"items": { "type": "string" }
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"functions": {
|
|
478
|
+
"type": "object",
|
|
479
|
+
"additionalProperties": false,
|
|
480
|
+
"properties": {
|
|
481
|
+
"can": { "type": "string" },
|
|
482
|
+
"tenantIdsWith": { "type": "string" },
|
|
483
|
+
"isPlatform": { "type": "string" },
|
|
484
|
+
"canUser": { "type": "string" },
|
|
485
|
+
"canAssign": { "type": "string" },
|
|
486
|
+
"permissionClaims": { "type": "string" }
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
"platformClaim": {
|
|
490
|
+
"type": "string",
|
|
491
|
+
"default": "platform_permissions"
|
|
492
|
+
},
|
|
493
|
+
"disabled": {
|
|
494
|
+
"type": "object",
|
|
495
|
+
"additionalProperties": false,
|
|
496
|
+
"properties": {
|
|
497
|
+
"tenant": { "type": "string" },
|
|
498
|
+
"tenantKey": { "type": "string" },
|
|
499
|
+
"user": { "type": "string" },
|
|
500
|
+
"userKey": { "type": "string" }
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
"activeTenant": {
|
|
504
|
+
"oneOf": [
|
|
505
|
+
{ "enum": ["claim", "resolver"] },
|
|
506
|
+
{
|
|
507
|
+
"type": "object",
|
|
508
|
+
"additionalProperties": false,
|
|
509
|
+
"required": ["profileColumn"],
|
|
510
|
+
"properties": {
|
|
511
|
+
"profileColumn": { "type": "string" },
|
|
512
|
+
"key": { "type": "string" }
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
},
|
|
517
|
+
"permdock": {
|
|
518
|
+
"type": "object",
|
|
519
|
+
"additionalProperties": false,
|
|
520
|
+
"properties": {
|
|
521
|
+
"schema": { "type": "string" },
|
|
522
|
+
"scope": { "type": "string" }
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
},
|
|
397
527
|
"casing": { "enum": ["snake", "camel"] },
|
|
398
528
|
"privileges": {
|
|
399
529
|
"type": "array",
|
|
@@ -73,6 +73,14 @@
|
|
|
73
73
|
"BS304",
|
|
74
74
|
"BS305",
|
|
75
75
|
"BS306",
|
|
76
|
+
"BS307",
|
|
77
|
+
"BS308",
|
|
78
|
+
"BS309",
|
|
79
|
+
"BS310",
|
|
80
|
+
"BS311",
|
|
81
|
+
"BS312",
|
|
82
|
+
"BS313",
|
|
83
|
+
"BS314",
|
|
76
84
|
"BS401",
|
|
77
85
|
"BS402",
|
|
78
86
|
"BS403",
|
|
@@ -81,6 +89,8 @@
|
|
|
81
89
|
"BS406",
|
|
82
90
|
"BS407",
|
|
83
91
|
"BS408",
|
|
92
|
+
"BS409",
|
|
93
|
+
"BS410",
|
|
84
94
|
"BS501",
|
|
85
95
|
"BS502"
|
|
86
96
|
]
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: better-supabase
|
|
3
|
-
description: Query and write Supabase data with better-supabase's typed repositories, Results and codegen. Use when code imports better-supabase, when adding a table, query or mutation,
|
|
3
|
+
description: Query and write Supabase data with better-supabase's typed repositories, Results and codegen. Use when code imports better-supabase, when adding a table, query or mutation, when a Supabase type is out of date, or after upgrading better-supabase.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# better-supabase
|
|
7
7
|
|
|
8
|
-
The data layer is `
|
|
8
|
+
The data layer is `betterSupabase = defineSupabase(schema)` in `src/lib/supabase/index.ts`.
|
|
9
9
|
`schema` comes from the generated module (`config.output`, usually
|
|
10
10
|
`src/lib/supabase/generated.ts`). Never edit generated files.
|
|
11
11
|
|
|
12
|
+
The `better-supabase` command ships in the `better-supabase` package, so
|
|
13
|
+
`pnpm better-supabase <command>` works once the package is installed. There
|
|
14
|
+
is no separate CLI package to add.
|
|
15
|
+
|
|
12
16
|
## Workflow: change the schema
|
|
13
17
|
|
|
14
18
|
1. Write the migration: edit `supabase/schemas/*.sql`, then run
|
|
@@ -18,15 +22,18 @@ The data layer is `sb = defineSupabase(schema)` in `src/lib/supabase.ts`.
|
|
|
18
22
|
data and role settings.
|
|
19
23
|
2. For a new table in an exposed schema, in the same file: `enable row level
|
|
20
24
|
security`, a policy per role and command the app uses, and an index on
|
|
21
|
-
every column a policy filters by.
|
|
25
|
+
every column a policy filters by. Write tenant checks as
|
|
26
|
+
`organization_id in (select better_supabase.member_org_ids())`, which
|
|
27
|
+
Postgres runs once per statement, not `has_org_role(organization_id)`,
|
|
28
|
+
which runs once per row. List the table in `expose` in
|
|
22
29
|
`better-supabase.config.ts` and run `pnpm better-supabase sql add grants`:
|
|
23
30
|
new tables get no Data API grants on their own.
|
|
24
31
|
3. Apply it with `supabase db reset` (or `supabase migration up`).
|
|
25
32
|
4. Run `pnpm better-supabase gen`, then fix the type errors it surfaces.
|
|
26
|
-
The command comes from the `@better-supabase/cli` dev dependency.
|
|
27
33
|
5. Run `pnpm better-supabase doctor` and fix every error it reports (RLS off,
|
|
28
34
|
missing policies, missing grants, unindexed foreign keys, drift).
|
|
29
|
-
6. Commit the generated files. CI runs `better-supabase gen --check
|
|
35
|
+
6. Commit the generated files. CI runs `better-supabase gen --check`, which
|
|
36
|
+
prints a diff of each stale file.
|
|
30
37
|
|
|
31
38
|
Done when `gen --check` and `doctor` exit 0 and the project typechecks.
|
|
32
39
|
|
|
@@ -44,14 +51,42 @@ Done when the call typechecks without casts, the error path returns the
|
|
|
44
51
|
`DbError` (not a thrown exception), and a test shows another tenant's rows
|
|
45
52
|
stay hidden.
|
|
46
53
|
|
|
54
|
+
## Workflow: after upgrading better-supabase
|
|
55
|
+
|
|
56
|
+
1. Run `pnpm better-supabase codemod <version> --dry-run` for each minor
|
|
57
|
+
version you crossed (`codemod` without a name lists them), then without
|
|
58
|
+
`--dry-run`, and fix the lines it lists for review.
|
|
59
|
+
2. Run `pnpm better-supabase sql upgrade`, so the kit modules get the
|
|
60
|
+
release's SQL and any forward steps land in a migration, then write a
|
|
61
|
+
migration from the changed files.
|
|
62
|
+
3. Run `pnpm better-supabase gen` and commit the result. Since 0.3, a
|
|
63
|
+
composite foreign key such as `(customer_id, organization_id)` is named
|
|
64
|
+
after the remaining column (`customer`); set `tables.<name>.relations` in
|
|
65
|
+
the config to keep an old relation name.
|
|
66
|
+
4. Run `pnpm better-supabase skills install --check` and reinstall the skills
|
|
67
|
+
when it reports them stale.
|
|
68
|
+
5. Read the release's breaking changes in
|
|
69
|
+
https://github.com/ScaleDockHQ/better-supabase/blob/main/CHANGELOG.md
|
|
70
|
+
(guides live under https://bettersupabase.com/docs/migration). For 0.3: time values are
|
|
71
|
+
`Temporal` (see below), `--db-url` is gone, `doctor --format json` is
|
|
72
|
+
`doctor --json`, `BetterResultShape` is `BetterResultValue`, and an
|
|
73
|
+
exhaustive `switch` over the `invalid` auth reason needs an `'actor'` case.
|
|
74
|
+
|
|
75
|
+
Done when `gen --check`, `doctor` and the typecheck pass.
|
|
76
|
+
|
|
47
77
|
## Where `db` comes from
|
|
48
78
|
|
|
49
|
-
|
|
50
|
-
|
|
79
|
+
Name the definition `betterSupabase` (in `lib/supabase/index.ts`) and every runtime instance `bs` (`lib/supabase/server.ts`, `lib/supabase/client.ts`, or the Hono, oRPC or Edge Function entry).
|
|
80
|
+
|
|
81
|
+
- Next.js: `const { db } = await bs.context()`, `bs.route(...)`, `bs.action(...)`
|
|
82
|
+
- Next.js Cache Components: keep layouts synchronous; read `bs.session()` in a `'use cache: private'` function inside `<Suspense>`, pass the promise to `<SessionProvider>` and read it with `useSession()`
|
|
51
83
|
- Hono: `c.var.db` after `bs.middleware()`
|
|
52
84
|
- oRPC: `context.db` after `bs.middleware()`
|
|
53
85
|
- Edge Functions: `bs.handler((request, { db }) => ...)`
|
|
54
|
-
- Browser: `
|
|
86
|
+
- Browser: `bs.db`, or the hooks from `createHooks<typeof bs>()`
|
|
87
|
+
|
|
88
|
+
For who the caller is (sessions, claims, OAuth clients, agents, scopes), use
|
|
89
|
+
the `better-supabase-auth` skill.
|
|
55
90
|
|
|
56
91
|
## Querying
|
|
57
92
|
|
|
@@ -68,18 +103,33 @@ const customers = result.data;
|
|
|
68
103
|
```
|
|
69
104
|
|
|
70
105
|
- Methods return a `Result`, and database errors never throw. Use `.orThrow()` only where an exception is really wanted.
|
|
71
|
-
- Column names use the configured casing (`casing: 'camel'` means `organizationId`). Raw escape hatches (`$client`,
|
|
106
|
+
- Column names use the configured casing (`casing: 'camel'` means `organizationId`). Raw escape hatches (`$client`, and `queryRaw` on the `better-supabase/postgres` clients) use database names.
|
|
72
107
|
- Writes: `create`, `createMany`, `update(id, patch)`, `updateMany`, `upsert`, `delete`.
|
|
108
|
+
- Page lists with a cursor: `paginate({ after: null, size: 25, orderBy })`, then pass `nextCursor` back as `after` with the same `orderBy` and `where`. Use `page` numbers only when users jump to a page and need a total.
|
|
73
109
|
- Handlers may return a `Result` directly. Adapters turn errors into RFC 9457 Problem Details with the right status.
|
|
74
|
-
- Server-only admin access: `
|
|
110
|
+
- Server-only admin access: `bs.admin()`. Only use it for trusted jobs, never for a user's request.
|
|
75
111
|
- PostgREST has no multi-request transactions. Put multi-step writes in a database function (`db.$rpc()`) or use `postgres.transaction()` on the server.
|
|
76
112
|
|
|
113
|
+
## Time values
|
|
114
|
+
|
|
115
|
+
- With `codecs: { timestamptz: 'instant' }` in the config, `timestamptz` columns decode to `Temporal.Instant` and `timestamp` columns to `Temporal.PlainDateTime`, with microseconds. Without the codec they stay ISO strings.
|
|
116
|
+
- `now` options, job and webhook timestamps and `bucket.sweep({ olderThan })` take `Temporal` values. Auth's `now` stays in epoch milliseconds.
|
|
117
|
+
- On Node 24, Safari and other runtimes without `Temporal`, add `temporal-polyfill` and `import "temporal-polyfill/global"` once at startup. Without it, calls that need `Temporal` return an `unexpected` `DbError` that names the import.
|
|
118
|
+
- Use TypeScript 6 or 7; 5.9 has no Temporal lib.
|
|
119
|
+
|
|
120
|
+
## CLI in scripts and CI
|
|
121
|
+
|
|
122
|
+
- No command takes a connection string as an argument. Set `$DATABASE_URL` or `source.dbUrl`, or pipe it in with `--db-url-stdin`.
|
|
123
|
+
- `--json` prints one JSON document on stdout: the result, or Problem Details with a `code` on failure. `--yes` and `CI` turn prompts off.
|
|
124
|
+
- Exit codes: 0 success, 1 a failure or finding (`--check` drift, doctor errors), 2 a usage, config or environment problem. Each error code is listed at https://bettersupabase.com/docs/cli/errors.
|
|
125
|
+
|
|
77
126
|
## Don't
|
|
78
127
|
|
|
79
128
|
- Don't create supabase-js clients by hand, and don't read cookies yourself. Use the adapters.
|
|
80
129
|
- Don't add `declare module` augmentation for types; everything comes from `schema`.
|
|
81
130
|
- Don't catch and swallow `DbError`; return it, or map it with `mapDbError`.
|
|
82
131
|
- Don't cast rows (`as Customer`). If a type is wrong, the schema or the generated file is out of date: rerun `gen`.
|
|
132
|
+
- Don't convert `Temporal` values to `Date` to compare them; use `.equals()` or `Temporal.Instant.compare`.
|
|
83
133
|
|
|
84
134
|
## When something fails
|
|
85
135
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Plugins
|
|
2
2
|
|
|
3
|
-
```ts title="src/lib/supabase.ts"
|
|
3
|
+
```ts title="src/lib/supabase/index.ts"
|
|
4
4
|
import { defineSupabase } from "better-supabase";
|
|
5
5
|
import { actor } from "better-supabase/plugins/actor";
|
|
6
6
|
import { softDelete } from "better-supabase/plugins/soft-delete";
|
|
@@ -8,10 +8,10 @@ import { tenant } from "better-supabase/plugins/tenant";
|
|
|
8
8
|
import { timestamps } from "better-supabase/plugins/timestamps";
|
|
9
9
|
import { validation } from "better-supabase/plugins/validation";
|
|
10
10
|
|
|
11
|
-
import { schema } from "./
|
|
12
|
-
import { validators } from "./
|
|
11
|
+
import { schema } from "./generated.ts";
|
|
12
|
+
import { validators } from "./generated.zod.ts";
|
|
13
13
|
|
|
14
|
-
export const
|
|
14
|
+
export const betterSupabase = defineSupabase(schema)
|
|
15
15
|
.use(timestamps())
|
|
16
16
|
.use(softDelete())
|
|
17
17
|
.use(tenant())
|
|
@@ -53,16 +53,15 @@ filled it.
|
|
|
53
53
|
RLS still decides what a user can read and write. `tenant()` makes queries
|
|
54
54
|
explicit and fills the column; it doesn't replace the policy.
|
|
55
55
|
|
|
56
|
-
The tenant comes from the
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
The tenant comes from `context.tenant`, which the server's `tenant` resolver
|
|
57
|
+
sets per request (the default `kits.access.activeTenant: 'resolver'`), then
|
|
58
|
+
the verified `tenant_id` claim (renamed with `claims.tenant` in
|
|
59
|
+
`better-supabase.config.ts`), then `app_metadata.tenant_id`. A resolver may
|
|
60
|
+
read the URL, but `current_tenant_id()` only returns a tenant the caller is a
|
|
61
|
+
member of. Never trust a tenant from `user_metadata` or a request body. When the project
|
|
59
62
|
has a `permdock.config.ts`, PermDock's hook writes that claim and the
|
|
60
|
-
memberships
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`supabase.hook` in `permdock.config.ts`, run `permdock supabase hook generate`,
|
|
64
|
-
and `hasEntitlement(session, ...)` works. Run `permdock supabase inspect --out`
|
|
65
|
-
first: with `permdock.manifest.json` present, the entitlements module reads
|
|
66
|
-
PermDock's `member_<scope>_ids` helpers and doesn't add `tenant`.
|
|
63
|
+
memberships: don't run `sql add tenant`, and follow the PermDock reference of
|
|
64
|
+
the `better-supabase-auth` skill
|
|
65
|
+
(https://bettersupabase.com/docs/auth/permdock.md).
|
|
67
66
|
|
|
68
67
|
Docs: https://bettersupabase.com/docs/plugins.md
|
|
@@ -11,29 +11,50 @@ Branch on `result.error.kind`, not on the message.
|
|
|
11
11
|
| ----------------------------------------------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
|
|
12
12
|
| `not_found` | The row doesn't exist, or RLS hides it from this user | Check the policy with an `asUser` test before assuming the row is gone |
|
|
13
13
|
| `unauthorized` | No valid session or token | Get `db` from the adapter for this request |
|
|
14
|
-
| `forbidden` | RLS or a grant rejected the write | Fix the policy or the grant; don't switch to `
|
|
14
|
+
| `forbidden` | RLS or a grant rejected the write | Fix the policy or the grant; don't switch to `bs.admin()` |
|
|
15
15
|
| `conflict` | Unique violation | Use `upsert`, or return the error to the caller |
|
|
16
16
|
| `foreign_key` | Referenced row missing, or still referenced on delete | Create the parent first, or delete children |
|
|
17
17
|
| `not_null`, `check`, `exclusion` | A constraint rejected the row | Validate input earlier with the `validation()` plugin |
|
|
18
18
|
| `invalid_input` | Postgres couldn't parse a value (bad uuid, enum) | Validate before the call |
|
|
19
|
+
| `invalid_value` | A stored value the app type can't hold (`infinity` in a Temporal timestamp) | Store a real timestamp or `null`, or read the column without the codec |
|
|
19
20
|
| `validation` | A Standard Schema rejected the input; see `issues` | Show the issues to the user |
|
|
20
21
|
| `invalid_request` | The query can't run over PostgREST (for example a relation filter on `update`) | Read the keys first, or use a database function or `better-supabase/postgres` |
|
|
21
22
|
| `multiple_rows` | `findUnique` or a single-row write matched more than one row | Filter by a unique key |
|
|
22
23
|
| `stale` | `update(..., { expect })` found a newer row | Reload the row and retry |
|
|
23
24
|
| `serialization`, `timeout`, `network`, `rate_limited` | Transient | Retry with backoff, or surface the error |
|
|
24
25
|
| `raised` | A database function raised an exception | Read `message` and `code` from the function |
|
|
26
|
+
| `unexpected` naming `temporal-polyfill/global` | The runtime has no `Temporal` (Node 24, Safari) | Install `temporal-polyfill` and import `temporal-polyfill/global` at startup |
|
|
27
|
+
|
|
28
|
+
## By error `code`
|
|
29
|
+
|
|
30
|
+
| Code | Meaning | Fix |
|
|
31
|
+
| -------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
32
|
+
| `CLAIMS_INVALID` (unauthorized) | The token verified but failed the `betterSupabase.claims(schema)` schema | Fix the access token hook or loosen the schema; the error names the failing paths |
|
|
33
|
+
| `SESSION_REVOKED` (unauthorized) | `checkSession` found the session gone (signed out, or ended by an admin) | Expected for irreversible actions; ask the user to sign in again |
|
|
34
|
+
| `INSUFFICIENT_SCOPE` (forbidden) | A delegated token (OAuth client or agent) lacks a scope the route requires | The 403 carries an `insufficient_scope` challenge; the client asks the user for that scope |
|
|
25
35
|
|
|
26
36
|
## Other symptoms
|
|
27
37
|
|
|
28
38
|
- Types don't match the database: run `pnpm better-supabase gen`, then
|
|
29
39
|
`gen --check` in CI.
|
|
30
40
|
- A column name is `snake_case` in one place and `camelCase` in another:
|
|
31
|
-
repositories use the configured casing, `$client` and
|
|
32
|
-
names.
|
|
41
|
+
repositories use the configured casing, `$client` and `queryRaw` use
|
|
42
|
+
database names.
|
|
33
43
|
- Every request calls the Auth server: the token is being refreshed outside
|
|
34
|
-
the proxy. Refresh happens only in the Next.js proxy (`
|
|
44
|
+
the proxy. Refresh happens only in the Next.js proxy (`bs.proxy`).
|
|
35
45
|
- Tests pass with the service role but fail as a user: that's the RLS policy.
|
|
36
46
|
Test as users, never with the service role.
|
|
47
|
+
- A relation name changed after `gen`: a composite foreign key that repeats a
|
|
48
|
+
column on both sides is named after the remaining column. Set
|
|
49
|
+
`tables.<name>.relations` in the config to keep the old name.
|
|
50
|
+
- The CLI exits with 2: the command line, the config or an environment
|
|
51
|
+
variable needs a change. Rerun with `--json` to get the error `code`, and
|
|
52
|
+
look it up at https://bettersupabase.com/docs/cli/errors.
|
|
53
|
+
- `--db-url` is rejected: set `$DATABASE_URL` or pipe the URL in with
|
|
54
|
+
`--db-url-stdin`.
|
|
55
|
+
- Two different `Temporal.Instant` values compare equal in `toEqual`: compare
|
|
56
|
+
with `.equals()` or register an equality tester (the
|
|
57
|
+
`better-supabase-testing` skill).
|
|
37
58
|
|
|
38
59
|
Docs: https://bettersupabase.com/docs/cli/doctor.md and
|
|
39
60
|
https://bettersupabase.com/docs/guides/limitations.md
|