go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
36.76k stars 3.93k forks source link

Is it possible to determine/control the order of arguments when making a query using Save? #6614

Open felipe-cg opened 1 year ago

felipe-cg commented 1 year ago

Your Question

Is it possible to determine/control the order of arguments when making a query using .Save()? I am utilizing GORM alongside sqlmock for testing, and one of my tests sporadically fails as it expects an insert statement's arguments to be in a particular order. Unfortunately, each time I execute an insert via .Save(), GORM seems to randomize the argument order.

The document you expected this should be explained

https://gorm.io/docs/update.html

Expected answer

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days