From bfba1e4afa709a8a0760a874825d192334301aee Mon Sep 17 00:00:00 2001 From: Tadeuchi Date: Thu, 9 Nov 2023 14:37:55 +0100 Subject: [PATCH] 1.1.0-beta.1 --- package.json | 2 +- src/PgSortKeyCache.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 920fa0a..db2042b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "warp-contracts-postgres", - "version": "1.0.4", + "version": "1.1.0-beta.1", "description": "Postgres contract cache for Warp SDK", "types": "./lib/types/index.d.ts", "main": "./lib/cjs/index.js", diff --git a/src/PgSortKeyCache.ts b/src/PgSortKeyCache.ts index 4f7a672..ef3c5f1 100644 --- a/src/PgSortKeyCache.ts +++ b/src/PgSortKeyCache.ts @@ -23,7 +23,9 @@ export class PgSortKeyCache implements SortKeyCache { } private async createTableIfNotExists() { - await this.connection().query(`CREATE schema if not exists "${this.schemaName}"; SET search_path TO '${this.schemaName}';`); + await this.connection().query( + `CREATE schema if not exists "${this.schemaName}"; SET search_path TO '${this.schemaName}';` + ); this.logger.info(`Attempting to create table ${this.tableName}`); const query = ` CREATE TABLE IF NOT EXISTS "${this.tableName}" @@ -103,7 +105,9 @@ export class PgSortKeyCache implements SortKeyCache { } async getLastSortKey(): Promise { - const result = await this.connection().query(`SELECT max(sort_key) as sort_key FROM "${this.schemaName}"."${this.tableName}";`); + const result = await this.connection().query( + `SELECT max(sort_key) as sort_key FROM "${this.schemaName}"."${this.tableName}";` + ); return result.rows[0].sort_key == '' ? null : result.rows[0].sortKey; }