From 465a6db0f354ad19dfe2303c20804507b4840a0f Mon Sep 17 00:00:00 2001 From: prostgles Date: Sat, 30 Nov 2024 20:27:14 +0200 Subject: [PATCH] improve TableSchemaForClient --- lib/runClientRequest.ts | 1 + tests/server/DBoGenerated.d.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/runClientRequest.ts b/lib/runClientRequest.ts index f1043e6b..e0199018 100644 --- a/lib/runClientRequest.ts +++ b/lib/runClientRequest.ts @@ -104,6 +104,7 @@ export const runClientRequest = async function(this: Prostgles, args: Args){ */ const tableCommand = tableHandler[command] satisfies undefined | TableMethodFunctionWithRulesAndLocalParams; if(!tableCommand) throw `Invalid or disallowed command provided: ${command}`; + //TODO: why does this not work? // const result = await (tableCommand as TableMethodFunctionWithRulesAndLocalParams)(param1, param2, param3, validRules, localParams); // return result; //@ts-ignore diff --git a/tests/server/DBoGenerated.d.ts b/tests/server/DBoGenerated.d.ts index 13f2f170..aeccf676 100644 --- a/tests/server/DBoGenerated.d.ts +++ b/tests/server/DBoGenerated.d.ts @@ -257,6 +257,16 @@ export type DBSchemaGenerated = { id: string; }; }; + newly_created_table: { + is_view: false; + select: true; + insert: true; + update: true; + delete: true; + columns: { + id?: null | number; + }; + }; obj_table: { is_view: false; select: true;