在 Sequelize.js 中调用存储过程

编程入门 行业动态 更新时间:2024-10-28 00:15:38
本文介绍了在 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:github/sequelize/sequelize/issues/959

The closest I got was this bug-report-turned-feature-request: github/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 中调用存储过程

本文发布于:2023-10-23 08:14:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1520288.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:存储过程   Sequelize   js

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!