-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]插入数据成功后,返回的数据id和数据库不一致 #395
Comments
什么数据库?id 字段类型是什么 |
@cyjake SQLite,字段是STRING类型,通过UUID生成: id: {
type: STRING,
primaryKey: true,
} |
知道了,sqlite 数据库有个自带的自增 id,leoric 执行完 insert 默认会用返回的自增 id 去设置对应的 id 字段,一般如果表结构里面 id 类型符合 biginit unsigned,会默认对应到这个自增 id 去 但是在你这个例子里面,这个 id 是不对应的,所以搞错了,我想想怎么处理 |
这个其实没错的,update() 本身返回的是 Spell 实例,等同于 Promise,await 之后拿到的是 number,也就是 affectedRows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
当使用create方法插入一条数据:
返回的数据
数据库里面的id是
e32639c7-9573-4f90-828b-be410d58f272
,而create方法返回的是一个索引值The text was updated successfully, but these errors were encountered: