mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-08 04:45:12 +00:00
fix(db): convert slices to PostgreSQL array literals in queries
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Successful in -32m17s
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Successful in -31m49s
Build , Vet Test, and Lint / Build (push) Successful in -31m53s
Build , Vet Test, and Lint / Lint Code (push) Successful in -31m11s
Tests / Unit Tests (push) Successful in -32m31s
Tests / Integration Tests (push) Failing after -32m46s
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Successful in -32m17s
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Successful in -31m49s
Build , Vet Test, and Lint / Build (push) Successful in -31m53s
Build , Vet Test, and Lint / Lint Code (push) Successful in -31m11s
Tests / Unit Tests (push) Successful in -32m31s
Tests / Integration Tests (push) Failing after -32m46s
This commit is contained in:
@@ -603,7 +603,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
||||
// Standard processing without nested relations
|
||||
query := h.db.NewInsert().Table(tableName)
|
||||
for key, value := range v {
|
||||
query = query.Value(key, value)
|
||||
query = query.Value(key, common.ConvertSliceForBun(value))
|
||||
}
|
||||
result, err := query.Exec(ctx)
|
||||
if err != nil {
|
||||
@@ -669,7 +669,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
||||
for _, item := range v {
|
||||
txQuery := tx.NewInsert().Table(tableName)
|
||||
for key, value := range item {
|
||||
txQuery = txQuery.Value(key, value)
|
||||
txQuery = txQuery.Value(key, common.ConvertSliceForBun(value))
|
||||
}
|
||||
if _, err := txQuery.Exec(ctx); err != nil {
|
||||
return err
|
||||
@@ -747,7 +747,7 @@ func (h *Handler) handleCreate(ctx context.Context, w common.ResponseWriter, dat
|
||||
if itemMap, ok := item.(map[string]interface{}); ok {
|
||||
txQuery := tx.NewInsert().Table(tableName)
|
||||
for key, value := range itemMap {
|
||||
txQuery = txQuery.Value(key, value)
|
||||
txQuery = txQuery.Value(key, common.ConvertSliceForBun(value))
|
||||
}
|
||||
if _, err := txQuery.Exec(ctx); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user