mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2025-12-06 14:26:22 +00:00
Fixed insert statement bug
This commit is contained in:
parent
1481443516
commit
ca6d2deff6
@ -343,9 +343,9 @@ func (b *BunInsertQuery) Returning(columns ...string) common.InsertQuery {
|
|||||||
|
|
||||||
func (b *BunInsertQuery) Exec(ctx context.Context) (common.Result, error) {
|
func (b *BunInsertQuery) Exec(ctx context.Context) (common.Result, error) {
|
||||||
if b.values != nil {
|
if b.values != nil {
|
||||||
// For Bun, we need to handle this differently
|
// Use Value() for INSERT queries to set column values
|
||||||
for k, v := range b.values {
|
for k, v := range b.values {
|
||||||
b.query = b.query.Set("? = ?", bun.Ident(k), v)
|
b.query = b.query.Value(k, "?", v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result, err := b.query.Exec(ctx)
|
result, err := b.query.Exec(ctx)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user