From 1b8fc58c8bbc6e4a2138f1ddb602dce8ba31a1f7 Mon Sep 17 00:00:00 2001 From: Christian Paul <christianp@matrix.org> Date: Fri, 8 Jan 2021 16:59:24 +0100 Subject: [PATCH] Convert a string to a number --- src/db/roomstore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/db/roomstore.ts b/src/db/roomstore.ts index e344e33..401e29e 100644 --- a/src/db/roomstore.ts +++ b/src/db/roomstore.ts @@ -106,7 +106,9 @@ export class DbRoomStore { public async countEntries(): Promise<number> { const row = (await this.db.Get("SELECT COUNT(*) AS count FROM room_entries WHERE matrix_id IS NOT NULL AND remote_id IS NOT NULL")) || {}; + // Our Sqlite wrapper returns a number – which is what we want. let count = row.count; + // Our PostgreSQL wrapper returns a string. if (typeof count === 'string') { count = Number.parseInt(count); } -- GitLab