postgresql - Sequelize.query not woking:错误:关系不存在
问题描述
我想从我的数据库中的表中执行选择查询。我很确定我的连接是正确的,因为我可以查询 showAllSchema()。
这是我的代码:
const sequelize = new Sequelize(database address,
{
logging: false,
pool: {
max: 3,
},
});
sequelize.query('Select * from "order"',{ type: sequelize.QueryTypes.SELECT
}).then((tableObj) => {
console.log('// Tables in database','==========================');
console.log(tableObj);
})
.catch((err) => {
console.log('showAllSchemas ERROR',err);
})
但是错误说:原始:错误:关系“订单”不存在
请帮我。先感谢您。
解决方案
推荐阅读
- javascript - React 中的材质 UI:制作
组件可点击 - rust - 我怎样才能让这个 Rust 代码更地道
- python - 如何计算由 Python 中的另一列确定的单独连续范围内的平均回报?
- sql - SQL 数据库设计:只有主键的父表是不好的做法?
- unity3d - 我应该如何处理多场景项目?
- sql - 如何通过计算显示max函数的结果?[SqlPlus]
- python - 从 ttdownloader 使用 python 下载视频
- c# - 检查是否在井字游戏 2D 数组 c# 中获胜
- mysql - 我如何才能找到哪个类别的产品出货量最多以及该类别的销售净收入?
- python - Django在Admin中显示ForeignKey字段