53 lines
1.2 KiB
Go
53 lines
1.2 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
// source: audit_logs.sql
|
|
|
|
package db
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const createConfigAuditLog = `-- name: CreateConfigAuditLog :one
|
|
INSERT INTO config_audit_logs (
|
|
id, admin_id, target_type, target_id, action, before_json, after_json
|
|
)
|
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
RETURNING id, admin_id, target_type, target_id, "action", before_json, after_json, created_at
|
|
`
|
|
|
|
type CreateConfigAuditLogParams struct {
|
|
ID string `json:"id"`
|
|
AdminID string `json:"admin_id"`
|
|
TargetType string `json:"target_type"`
|
|
TargetID string `json:"target_id"`
|
|
Action string `json:"action"`
|
|
BeforeJson string `json:"before_json"`
|
|
AfterJson string `json:"after_json"`
|
|
}
|
|
|
|
func (q *Queries) CreateConfigAuditLog(ctx context.Context, arg CreateConfigAuditLogParams) (ConfigAuditLog, error) {
|
|
row := q.db.QueryRowContext(ctx, createConfigAuditLog,
|
|
arg.ID,
|
|
arg.AdminID,
|
|
arg.TargetType,
|
|
arg.TargetID,
|
|
arg.Action,
|
|
arg.BeforeJson,
|
|
arg.AfterJson,
|
|
)
|
|
var i ConfigAuditLog
|
|
err := row.Scan(
|
|
&i.ID,
|
|
&i.AdminID,
|
|
&i.TargetType,
|
|
&i.TargetID,
|
|
&i.Action,
|
|
&i.BeforeJson,
|
|
&i.AfterJson,
|
|
&i.CreatedAt,
|
|
)
|
|
return i, err
|
|
}
|