lavender/database/roles.sql.go

35 lines
645 B
Go
Raw Normal View History

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
// source: roles.sql
package database
import (
"context"
)
const addRole = `-- name: AddRole :execlastid
INSERT OR IGNORE INTO roles(role)
VALUES (?)
`
func (q *Queries) AddRole(ctx context.Context, role string) (int64, error) {
result, err := q.db.ExecContext(ctx, addRole, role)
if err != nil {
return 0, err
}
return result.LastInsertId()
}
const removeRole = `-- name: RemoveRole :exec
DELETE
FROM roles
WHERE role = ?
`
func (q *Queries) RemoveRole(ctx context.Context, role string) error {
_, err := q.db.ExecContext(ctx, removeRole, role)
return err
}