From 9d541eb8f1a9df2c6199574aeeeb068cebe2334d Mon Sep 17 00:00:00 2001 From: Ike Saunders Date: Fri, 12 Jul 2024 22:01:11 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20use=20knex=20query=20builder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/db.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/db/db.ts b/db/db.ts index 6d929d3f419..8f28b746806 100644 --- a/db/db.ts +++ b/db/db.ts @@ -538,11 +538,9 @@ export async function getParentTagsByChildName( const { __rootId, ...flatTagGraph } = await getFlatTagGraph(trx) const tagGraph = createTagGraph(flatTagGraph, __rootId) - const tagsById = await knexRaw>( - trx, - `-- sql - SELECT id, name FROM tags` - ).then((tags) => keyBy(tags, "id")) + const tagsById = await trx("tags") + .select("id", "name") + .then((tags) => keyBy(tags, "id")) const parentTagsByChildName: Record< DbPlainTag["name"],