aboutsummaryrefslogtreecommitdiff
path: root/query-executor.js
diff options
context:
space:
mode:
authorJames Barnett <noreply@jamesbarnett.xyz>2018-02-28 21:49:32 +0000
committerJames Barnett <noreply@jamesbarnett.xyz>2018-02-28 21:49:32 +0000
commitb8beae97f2cf88a405001b1f4a51434e944c776e (patch)
tree65f78641fee455f931823314e6e6db334f0a3e11 /query-executor.js
parent28ebae4525f35672acd6253b3022bdb8cdc1cbd1 (diff)
downloadsql-plus-plus-b8beae97f2cf88a405001b1f4a51434e944c776e.tar.xz
sql-plus-plus-b8beae97f2cf88a405001b1f4a51434e944c776e.zip
Remove cross-schema autocomplete until it can be improved
Add pg database param to new connection config
Diffstat (limited to 'query-executor.js')
-rw-r--r--query-executor.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/query-executor.js b/query-executor.js
index b9fb561..6ae9f4f 100644
--- a/query-executor.js
+++ b/query-executor.js
@@ -12,7 +12,7 @@ const connectionConfig = remote.getCurrentWindow().connectionConfig;
const connectionPool = new Pool({
user: connectionConfig.username,
host: connectionConfig.host,
- database: "postgres",
+ database: connectionConfig.database,
password: connectionConfig.password,
port: connectionConfig.port
});
@@ -56,9 +56,9 @@ ipcRenderer.on("queryExecutor.queryTableMetadata", (event, payload) => {
let tableMetadata = {};
let tableDataQuery =
- "SELECT c.table_schema || '.' || c.table_name identifier, c.column_name " +
+ "SELECT c.table_name identifier, c.column_name " +
"FROM information_schema.columns c " +
- "WHERE c.table_schema != 'pg_catalog'";
+ "WHERE c.table_schema = current_schema()";
connectionPool.query(tableDataQuery, (err, res) => {