From 409ccf0bceaad8a4ef5ebb73c2821321f2f143ea Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Sun, 25 Sep 2022 12:59:17 +0100 Subject: [PATCH] Fix types --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index ef1dc2d..0f531a1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -119,9 +119,9 @@ class PlanetScaleConnection implements DatabaseConnection { const results = await this.#conn.execute(compiledQuery.sql, parameters) - // If an error is returned throw it. - if (results.error) { - throw results.error + // @planetscale/database versions older than 1.3.0 return errors directly, rather than throwing + if ((results as any).error) { + throw (results as any).error } return {