nidus-sync/db/query/arcgis/user_privileges.go
Eli Ribble a95e44cf42
Use transactions to set the communication status changes
Not doing it yet, but soon we'll do log entries for them.
2026-05-04 20:57:50 +00:00

22 lines
764 B
Go

package arcgis
import (
"context"
"github.com/Gleipnir-Technology/bob"
"github.com/Gleipnir-Technology/nidus-sync/db"
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/arcgis/model"
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/arcgis/table"
"github.com/go-jet/jet/v2/postgres"
)
func UserPrivilegesDeleteByUserID(ctx context.Context, txn bob.Tx, id string) error {
statement := table.User.DELETE().
WHERE(table.User.ID.EQ(postgres.String(id)))
return db.ExecuteNoneTxBob(ctx, txn, statement)
}
func UserPrivilegeInsert(ctx context.Context, txn bob.Tx, m *model.UserPrivilege) error {
statement := table.UserPrivilege.INSERT(table.UserPrivilege.MutableColumns).
MODEL(m)
return db.ExecuteNoneTxBob(ctx, txn, statement)
}