postgresql-client
Advanced tools
Comparing version 1.8.1 to 1.9.0
@@ -26,3 +26,3 @@ /// <reference types="node" /> | ||
timezone?: string; | ||
searchPath?: string; | ||
schema?: string; | ||
connectTimeoutMs?: number; | ||
@@ -29,0 +29,0 @@ autoCommit?: boolean; |
@@ -65,8 +65,8 @@ "use strict"; | ||
let startupCommand = ''; | ||
if (this.config.searchPath) | ||
startupCommand += 'SET search_path = ' + escape_literal_1.escapeLiteral(this.config.searchPath) + ';'; | ||
if (this.config.schema) | ||
startupCommand += 'SET search_path = ' + escape_literal_1.escapeLiteral(this.config.schema) + ';'; | ||
if (this.config.timezone) | ||
startupCommand += 'SET timezone TO ' + escape_literal_1.escapeLiteral(this.config.timezone) + ';'; | ||
if (startupCommand) | ||
await this.execute(startupCommand); | ||
await this.execute(startupCommand, { autoCommit: true }); | ||
} | ||
@@ -73,0 +73,0 @@ async close() { |
@@ -20,4 +20,4 @@ "use strict"; | ||
result.timezone = env.PGTZ; | ||
if (env.PGSEARCHPATH) | ||
result.searchPath = env.PGSEARCHPATH; | ||
if (env.PGSCHEMA) | ||
result.schema = env.PGSCHEMA; | ||
if (env.PGCONNECT_TIMEOUT) | ||
@@ -24,0 +24,0 @@ result.connectTimeoutMs = parseInt(env.PGCONNECT_TIMEOUT, 10); |
@@ -53,4 +53,4 @@ "use strict"; | ||
cfg.database = decodeURI(getFirst(parsed.query.db)); | ||
if (parsed.query['search-path']) | ||
cfg.searchPath = decodeURI(getFirst(parsed.query['search-path'])); | ||
if (parsed.query.schema) | ||
cfg.schema = decodeURI(getFirst(parsed.query.schema)); | ||
if (parsed.query.application_name) | ||
@@ -57,0 +57,0 @@ cfg.applicationName = decodeURI(getFirst(parsed.query.application_name)); |
{ | ||
"name": "postgresql-client", | ||
"description": "Professional PostgreSQL client for JavaScript and TypeScript", | ||
"version": "1.8.1", | ||
"version": "1.9.0", | ||
"author": "Panates", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
183251