我正在为Mysql数据库使用序列化ORM。现在,如果我想在moleculer中使用原始查询(内联或已经准备好的SQL查询),那么我应该如何使用它。
例如,
SELECT user_name as UserName FROM users OR
SELECT column-names
FROM table-name1 LEFT JOIN table-name2
ON column-name1 = column-name2
WHERE condition
参考文献:http://docs.sequelizejs.com/manual/raw-queries.html请指导我。谢谢,
发布于 2019-03-22 04:19:53
actions: {
findRaw() {
return this.adapter.db.query("SELECT * FROM posts WHERE title = 'Hello 2' LIMIT 1")
.then(res => res[0]);
}
},
https://stackoverflow.com/questions/55242554
复制相似问题