尝试使用typeorm查询information_schema
,但失败了,如何使用typeorm访问此数据?
QueryFailedError:关系“ information_schema.columns”不存在
const rawData = await connection.query(`
SELECT
COLUMN_NAME
FROM
information_schema.COLUMNS
WHERE
TABLE_NAME = 'members';
`);
答案 0 :(得分:0)
必须修改查询:
const rawData = await connection.query(`
SELECT COLUMN_NAME
FROM "information_schema"."columns"
WHERE ("table_schema" = 'public' AND "table_name" = 'members')
`);
在这里https://wanago.io/2019/01/28/typeorm-migrations-postgres/