Skip to content

Commit 8d619d1

Browse files
author
Dan Hsiung
committed
PostgreSQL: By default, only grab database table information for the public schema.
1 parent 3a363b8 commit 8d619d1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

components/postgresql/actions/execute-custom-query/execute-custom-query.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
name: "Execute SQL Query",
55
key: "postgresql-execute-custom-query",
66
description: "Execute a custom PostgreSQL query. See [our docs](https://pipedream.com/docs/databases/working-with-sql) to learn more about working with SQL in Pipedream.",
7-
version: "3.0.1",
7+
version: "3.0.2",
88
type: "action",
99
props: {
1010
postgresql,

components/postgresql/postgresql.app.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,17 @@ export default {
213213
* JSON-serializable object.
214214
*/
215215
async getSchema() {
216+
const filter = this.$auth.pd_schema_explorer_retrieve_all ?
217+
"NOT IN ('pg_catalog', 'information_schema')" :
218+
"= 'public'";
216219
const text = `
217220
SELECT table_name AS "tableName",
218221
column_name AS "columnName",
219222
is_nullable AS "isNullable",
220223
data_type AS "dataType",
221224
column_default AS "columnDefault"
222225
FROM information_schema.columns
223-
WHERE table_schema NOT IN ('pg_catalog', 'information_schema')
226+
WHERE table_schema ${filter}
224227
ORDER BY table_name,
225228
ordinal_position
226229
`;

0 commit comments

Comments
 (0)