在 Sequelize.js 中调用存储过程 [英] Calling stored procedures in Sequelize.js

查看:97
本文介绍了在 Sequelize.js 中调用存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了文档并尝试使用谷歌搜索,但我没有找到问题的直接答案:

I have searched documentation and tried google that, but I did not find a straight answer to the question:

如何在 Sequelize 中调用存储过程?

我已经搜索了 Sequelize 的文档,但我什至没有在其中找到程序"一词的痕迹.

I have searched the documentation of Sequelize but I have even not found a trace of the word "procedure" in that.

我得到的最接近的是这个 bug-report-turned-feature-request:https://github.com/sequelize/sequelize/issues/959

The closest I got was this bug-report-turned-feature-request: https://github.com/sequelize/sequelize/issues/959

引用链接:

我想象的会很棒:

sequelize.query('CALL calculateFees();').success(
    function (settingName1, settingName2, settingName3, users) {
});

他们提到可以调用存储过程,但没有提供语法.

They mention that it is possible to call stored procedures, but the syntax is not provided.

谁能给我一个语法正确的例子?

谢谢.

推荐答案

success 更改为 spread 就可以了.请注意,这仅适用于 sequelize 2.0

Change success to spread and you're good to go. Note that this will only work on sequlize 2.0

这篇关于在 Sequelize.js 中调用存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆