-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
升级gorm 使用postgres后报错 LastInsertId is not supported by this driver #6926
Comments
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
Upgrade GORM to v1.25.9 |
|
如果使用的是 Postgresql 检查是否设置 WithoutReturning true 这回导致插入记录后 不会返回生成ID,导致插入失败. 这是我遇到的LastInsertId 问题 |
原来使用正常,版本为
gorm.io/gorm v1.23.8
gorm.io/driver/postgres v1.3.9
升级后
gorm.io/gorm v1.25.8
gorm.io/driver/postgres v1.5.7
就报错了LastInsertId is not supported by this driver,
无法插入数据
The text was updated successfully, but these errors were encountered: