From e4c5a576cb062dc333424f13cb23615fe0b41871 Mon Sep 17 00:00:00 2001 From: Anitha Varghese Date: Mon, 2 Sep 2024 13:11:17 +0530 Subject: [PATCH] update: modify ux drhSQL --- service/diabetes-research-hub/ux.sql.ts | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/service/diabetes-research-hub/ux.sql.ts b/service/diabetes-research-hub/ux.sql.ts index f6d79a2..2b93a7d 100755 --- a/service/diabetes-research-hub/ux.sql.ts +++ b/service/diabetes-research-hub/ux.sql.ts @@ -707,21 +707,8 @@ ${pagination.renderSimpleMarkdown()} } } -// // this will be used by any callers who want to serve it as a CLI with SDTOUT -// if (import.meta.main) { -// const SQL = await spn.TypicalSqlPageNotebook.SQL( -// new sh.ShellSqlPages(), -// new c.ConsoleSqlPages(), -// new ur.UniformResourceSqlPages(), -// new orch.OrchestrationSqlPages(), -// new DRHSqlPages(), -// ); -// console.log(SQL.join("\n")); -// } - -// this will be used by any callers who want to serve it as a CLI with SDTOUT -if (import.meta.main) { - const SQL = await spn.TypicalSqlPageNotebook.SQL( +export async function drhSQL() { + return await spn.TypicalSqlPageNotebook.SQL( new class extends spn.TypicalSqlPageNotebook { async statelessDRHSQL() { // read the file from either local or remote (depending on location of this file) @@ -743,5 +730,9 @@ if (import.meta.main) { new orch.OrchestrationSqlPages(), new DRHSqlPages(), ); - console.log(SQL.join("\n")); +} + +// this will be used by any callers who want to serve it as a CLI with SDTOUT +if (import.meta.main) { + console.log((await drhSQL()).join("\n")); }