From ca6d2deff6929c4ad2e1a416d8e078a9654ff5d8 Mon Sep 17 00:00:00 2001 From: Hein Date: Thu, 20 Nov 2025 10:11:26 +0200 Subject: [PATCH] Fixed insert statement bug --- pkg/common/adapters/database/bun.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/common/adapters/database/bun.go b/pkg/common/adapters/database/bun.go index 7a5cc50..67e9c62 100644 --- a/pkg/common/adapters/database/bun.go +++ b/pkg/common/adapters/database/bun.go @@ -343,9 +343,9 @@ func (b *BunInsertQuery) Returning(columns ...string) common.InsertQuery { func (b *BunInsertQuery) Exec(ctx context.Context) (common.Result, error) { 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 { - b.query = b.query.Set("? = ?", bun.Ident(k), v) + b.query = b.query.Value(k, "?", v) } } result, err := b.query.Exec(ctx)