Audit with AI

This commit is contained in:
2025-11-16 11:37:02 +05:30
parent 551e2123bc
commit 29cddb6389
24 changed files with 1286 additions and 79 deletions

View File

@@ -1,4 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd vdev on 2025-11-16 04:05:43 DO NOT EDIT.
package branchuser

View File

@@ -1,4 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd vdev on 2025-11-16 04:05:43 DO NOT EDIT.
package comment

View File

@@ -1,4 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd vdev on 2025-11-16 04:05:43 DO NOT EDIT.
package employee

View File

@@ -1,4 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd vdev on 2025-11-16 04:05:43 DO NOT EDIT.
package post

View File

@@ -1,4 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd vdev on 2025-11-16 04:05:43 DO NOT EDIT.
package db

View File

@@ -1,4 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd vdev on 2025-11-16 04:05:43 DO NOT EDIT.
package user

View File

@@ -1,4 +1,4 @@
// Code generated by code.patial.tech/go/pgm/cmd DO NOT EDIT.
// Code generated by code.patial.tech/go/pgm/cmd vdev on 2025-11-16 04:05:43 DO NOT EDIT.
package usersession

View File

@@ -1,6 +1,8 @@
package playground
import (
"context"
"strings"
"testing"
"code.patial.tech/go/pgm/playground/db"
@@ -26,6 +28,21 @@ func TestUpdateQuery(t *testing.T) {
}
}
func TestUpdateQueryValidation(t *testing.T) {
// Test that UPDATE without Set() returns error
err := db.User.Update().
Where(user.Email.Eq("aa@aa.com")).
Exec(context.Background())
if err == nil {
t.Error("Expected error when calling Exec() without Set(), got nil")
}
if !strings.Contains(err.Error(), "no columns to update") {
t.Errorf("Expected error message to contain 'no columns to update', got: %v", err)
}
}
// BenchmarkUpdateQuery-12 2004985 592.2 ns/op 1176 B/op 20 allocs/op
func BenchmarkUpdateQuery(b *testing.B) {
for b.Loop() {