From d24d012bfc93cd3d36cac8e2e4db2ae6f8bac9e9 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Tue, 22 Mar 2022 16:48:27 +0100 Subject: [PATCH] Apply suggestions from code review --- web/spec/supabase.yml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/web/spec/supabase.yml b/web/spec/supabase.yml index 01d538ec324..0548c5b13c0 100644 --- a/web/spec/supabase.yml +++ b/web/spec/supabase.yml @@ -371,30 +371,8 @@ pages: }; ``` - To get more from the generated types, optionally you can use [`postgrest-js-tools`](https://github.com/mzalevski/postgrest-js-tools). + For more advance type-support, check out [`postgrest-js-tools`](https://github.com/mzalevski/postgrest-js-tools). - Features: - - - Intellisense while selecting fields (`getShape`). - - Return type based on the selected fields (`typeof shape`). - - Auto-generated select string (`getFields`). - - ``` - import { getShape, getFields } from "postgrest-js-tools"; - - const shape = getShape()({ - id: true, - status: true, - }); - - export default async (req: NextApiRequest, res: NextApiResponse) => { - const allOnlineUsers = await supabase - .from("users") - .select(getFields(shape)) - .eq("status", "ONLINE"); - res.status(200).json(allOnlineUsers); - }; - ``` ### Update types automatically with GitHub Actions