first commit
Made-with: Cursor
This commit is contained in:
34
internal/repository/audit_logs.sql.go
Normal file
34
internal/repository/audit_logs.sql.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.30.0
|
||||
// source: audit_logs.sql
|
||||
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const createAuditLog = `-- name: CreateAuditLog :exec
|
||||
INSERT INTO audit_logs (entity_type, entity_id, action, user_id)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
`
|
||||
|
||||
type CreateAuditLogParams struct {
|
||||
EntityType string `json:"entity_type"`
|
||||
EntityID pgtype.UUID `json:"entity_id"`
|
||||
Action string `json:"action"`
|
||||
UserID pgtype.UUID `json:"user_id"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateAuditLog(ctx context.Context, arg CreateAuditLogParams) error {
|
||||
_, err := q.db.Exec(ctx, createAuditLog,
|
||||
arg.EntityType,
|
||||
arg.EntityID,
|
||||
arg.Action,
|
||||
arg.UserID,
|
||||
)
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user