There are some case it's hard to write a sql with generated query builder, it also doesn't need to get return value, so it's more reasonable to just use db.Exec.
Is is possible to get db from query.Query so we can execute some raw sql?
Normally we can just use gorm.DB, but when in txn (q.Transaction(func(tx *query.Query) error {})), we should get db from Query.
Describe the feature
There are some case it's hard to write a sql with generated query builder, it also doesn't need to get return value, so it's more reasonable to just use
db.Exec
.Is is possible to get db from
query.Query
so we can execute some raw sql?Normally we can just use
gorm.DB
, but when in txn (q.Transaction(func(tx *query.Query) error {})
), we should get db from Query.Motivation
Related Issues