nidus-sync/db/query/arcgis/user_privileges.go
Eli Ribble 7237f5f666
Some checks failed
/ golint (push) Failing after 3m50s
Move internal references to new source hosting
2026-05-19 15:33:57 +00:00

23 lines
834 B
Go

package arcgis
import (
"context"
"github.com/Gleipnir-Technology/bob"
"github.com/Gleipnir-Technology/jet/postgres"
"source.gleipnir.technology/Gleipnir/nidus-sync/db"
"source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/arcgis/model"
"source.gleipnir.technology/Gleipnir/nidus-sync/db/gen/nidus-sync/arcgis/table"
)
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).
RETURNING(table.UserPrivilege.AllColumns)
return db.ExecuteNoneTxBob(ctx, txn, statement)
}