Skip to content

Commit

Permalink
1.1.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeuchi committed Nov 9, 2023
1 parent cdc8055 commit bfba1e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 6 additions & 2 deletions src/PgSortKeyCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export class PgSortKeyCache<V> implements SortKeyCache<V> {
}

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}"
Expand Down Expand Up @@ -103,7 +105,9 @@ export class PgSortKeyCache<V> implements SortKeyCache<V> {
}

async getLastSortKey(): Promise<string | null> {
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;
}

Expand Down

0 comments on commit bfba1e4

Please sign in to comment.