From c9c761c9ddaf56ffb1ef78cf1dc761298bab9300 Mon Sep 17 00:00:00 2001 From: Juanma Hidalgo Date: Wed, 27 Nov 2024 20:06:24 +0100 Subject: [PATCH] fix: do not use safe for base queries --- src/ports/squids/queries.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ports/squids/queries.ts b/src/ports/squids/queries.ts index a3fcb6e..e7b986d 100644 --- a/src/ports/squids/queries.ts +++ b/src/ports/squids/queries.ts @@ -73,11 +73,10 @@ export const getPromoteQuery = (serviceName: string, schemaName: string, project } export const getSchemaByServiceNameQuery = (serviceName: string): SQLStatement => { - const safeServiceName = escapeLiteral(serviceName) return SQL` SELECT schema FROM public.indexers - WHERE service = ${safeServiceName} + WHERE service = ${serviceName} ORDER BY created_at DESC LIMIT 1; ` @@ -85,11 +84,10 @@ export const getSchemaByServiceNameQuery = (serviceName: string): SQLStatement = export const getActiveSchemaQuery = (serviceName: string): SQLStatement => { const projectName = getProjectNameFromService(serviceName) - const safeProjectName = escapeLiteral(projectName) return SQL` SELECT schema FROM public.squids - WHERE name = ${safeProjectName}; + WHERE name = ${projectName}; ` }