From 434457055b597978e0c8b61dc3b90cb0cdb409bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Dvo=C5=99=C3=A1k?= Date: Tue, 10 Aug 2021 13:43:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Auto=20convert=20varchar=20from?= =?UTF-8?q?=20buffer=20to=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 2 ++ tests/test.js | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 1fa74e5..28088d6 100644 --- a/src/index.js +++ b/src/index.js @@ -177,6 +177,8 @@ class Client_Firebird extends Client { }); }) ); + } else if (colVal instanceof Buffer) { + rows[rowIndex][colKey] = colVal.toString("utf8"); } }); }); diff --git a/tests/test.js b/tests/test.js index b944850..f43ebc8 100644 --- a/tests/test.js +++ b/tests/test.js @@ -123,7 +123,6 @@ describe("Knex Firebird Dialect", () => { .insert({ id: 101, account_name: "knex", user_id: 1 }); const users = await knex.select("*").from("users"); - console.info(users); expect(users).toMatchSnapshot(); const accounts = await knex.select("*").from("accounts");