|
const getColumns = 'select * from information_schema.columns ' + |
|
`where table_name = '${mappedType}'` |
Let's say I have a schema named schema-v1 and another named schema-v2 that both have a table called users. If schema-v1 has a column in users like users.email then the below if statement will wrongly think that the column exists in schema-v2. This is because information_schema.columns returns a list of columns in all schemas.
|
if (!tableColumns[type].some(row => row.column_name === field) && |
Solution should be to specify the exact schema to search in.
fortune-postgres/lib/index.js
Lines 141 to 142 in 7d158ec
Let's say I have a schema named
schema-v1and another namedschema-v2that both have a table calledusers. Ifschema-v1has a column in users like users.email then the below if statement will wrongly think that the column exists inschema-v2. This is because information_schema.columns returns a list of columns in all schemas.fortune-postgres/lib/index.js
Line 188 in 7d158ec
Solution should be to specify the exact schema to search in.