Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

原始查询,插入后返回自增ID? #50

Closed
qq578023708 opened this issue Jul 14, 2020 · 1 comment
Closed

原始查询,插入后返回自增ID? #50

qq578023708 opened this issue Jul 14, 2020 · 1 comment

Comments

@qq578023708
Copy link

当前使用的 Node.js 版本 (node -v)
(可用 node -v 命令 查看)

当前使用的 sequelize 版本
(package.json 所指定的版本)

问题描述
(描述出现的或寻求解决的问题)

使用原始查询后, 执行插入数据命令, 如何返回插入后的自增ID ?

代码片段

// 相关代码或报错信息
@demopark
Copy link
Owner

@qq578023708 原始查询不会像create等查找器一样自动返回 INSERT 后的数据. 原始查询只会严格按照你输入的SQL语句执行.如果使用原始查询插入数据,需要手动拼写进行结果查询.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants