-
-
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
Models with composite keys cannot be successfully removed using Delete(...) #4879
Labels
type:with reproduction steps
with reproduction steps
Comments
github-actions
bot
added
the
type:with reproduction steps
with reproduction steps
label
Nov 27, 2021
also refer #3585 |
might need to replace the where clause for sqlite. |
This is also biting us for testing. |
Is this still an issue? If so maybe only in SQLite? I am using postgres where it works as expected. |
I ran the test from the above playground link and it passed for sqlite. diff --git a/go.mod b/go.mod
index 28f863c..f57a261 100644
--- a/go.mod
b/go.mod
@@ -3,16 3,19 @@ module gorm.io/playground
go 1.16
require (
github.com/denisenkom/go-mssqldb v0.12.2 // indirect
github.com/go-kit/kit v0.10.0 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/hashicorp/go-secure-stdlib/base62 v0.1.2 // indirect
- github.com/jackc/pgx/v4 v4.14.0 // indirect
- golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
github.com/jackc/pgx/v4 v4.17.2 // indirect
github.com/mattn/go-sqlite3 v1.14.15 // indirect
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
- gorm.io/driver/mysql v1.2.0
- gorm.io/driver/postgres v1.2.2
- gorm.io/driver/sqlite v1.2.6
- gorm.io/driver/sqlserver v1.2.1
- gorm.io/gorm v1.22.3
gorm.io/driver/mysql v1.3.6
gorm.io/driver/postgres v1.3.9
gorm.io/driver/sqlite v1.3.6
gorm.io/driver/sqlserver v1.3.2
gorm.io/gorm v1.23.8
)
replace gorm.io/gorm => ./gorm
test log
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GORM Playground Link
go-gorm/playground#405
Description
I think, Gorm should generate valid sql and be able to delete resources with composite primary keys.
Thanks for all your amazing work on Gorm!
If I have time, I may do a bit of digging on the issue and see about opening a PR to fix it. No promises about the PR but I'll see if I can mange it next week.
The text was updated successfully, but these errors were encountered: