Skip to content

Commit

Permalink
Merge pull request #23 from decentraland/fix/unnecessary-safe-used
Browse files Browse the repository at this point in the history
fix: do not use safe for base queries
  • Loading branch information
juanmahidalgo authored Nov 27, 2024
2 parents e36ac74 + c9c761c commit 600e121
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ports/squids/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,21 @@ 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;
`
}

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};
`
}

0 comments on commit 600e121

Please sign in to comment.