dbsqlite

package
v0.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOrganizationParams

type AddOrganizationParams struct {
	ID         int64
	Name       string
	SystemName string
	Status     string
}

type AddPermissionToRoleParams

type AddPermissionToRoleParams struct {
	RoleID     int64
	Permission string
}

type AddRoleParams

type AddRoleParams struct {
	ID             int64
	OrganizationID int64
	Name           string
	SystemName     string
}

type AddRoleToUserParams

type AddRoleToUserParams struct {
	UserID int64
	RoleID int64
}

type AddUserParams

type AddUserParams struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	Verified    bool
	CreatedAt   sql.NullTime
	UpdatedAt   sql.NullTime
}

type AddUserToRoleParams

type AddUserToRoleParams struct {
	UserID int64
	RoleID int64
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetAllUserOrganizationRolesRow added in v0.0.16

type GetAllUserOrganizationRolesRow struct {
	ID                     int64
	Name                   string
	SystemName             string
	OrganizationID         int64
	OrganizationName       string
	OrganizationSystemName string
}

type GetOrganizationRolesRow

type GetOrganizationRolesRow struct {
	ID         int64
	Name       string
	SystemName string
}

type GetOrganizationsRow

type GetOrganizationsRow struct {
	ID         int64
	Name       string
	SystemName string
}

type GetRolesForUserRow added in v0.0.18

type GetRolesForUserRow struct {
	ID         int64
	Name       string
	SystemName string
}

type GetUserByEmailRow added in v0.0.16

type GetUserByEmailRow struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	Verified    bool
}

type GetUserOrganizationPermissionsParams

type GetUserOrganizationPermissionsParams struct {
	UserID         int64
	OrganizationID int64
}

type GetUserOrganizationRolesParams

type GetUserOrganizationRolesParams struct {
	UserID         int64
	OrganizationID int64
}

type GetUserOrganizationRolesRow

type GetUserOrganizationRolesRow struct {
	ID         int64
	Name       string
	SystemName string
}

type GetUserOrganizationsRow

type GetUserOrganizationsRow struct {
	ID         sql.NullInt64
	Name       sql.NullString
	SystemName sql.NullString
}

type GetUserRow added in v0.0.16

type GetUserRow struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	Verified    bool
}

type GetUsersInRoleRow added in v0.0.18

type GetUsersInRoleRow struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	Verified    bool
}

type ListRolesWithUserCountsRow added in v0.0.16

type ListRolesWithUserCountsRow struct {
	ID         int64
	Name       string
	SystemName string
	UserCount  int64
}

type ListUserOrganizationRolesRow

type ListUserOrganizationRolesRow struct {
	OrganizationID         int64
	Organization           string
	OrganizationSystemName string
	RoleID                 int64
	RoleName               string
	RoleSystemName         string
}

type Organization

type Organization struct {
	ID         int64
	Name       string
	SystemName string
	Status     string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddOrganization

func (q *Queries) AddOrganization(ctx context.Context, arg AddOrganizationParams) error

---------------------------------------------------------------------------

Organization Management

---------------------------------------------------------------------------

func (*Queries) AddPermissionToRole

func (q *Queries) AddPermissionToRole(ctx context.Context, arg AddPermissionToRoleParams) error

func (*Queries) AddRole

func (q *Queries) AddRole(ctx context.Context, arg AddRoleParams) error

---------------------------------------------------------------------------

Role Management

---------------------------------------------------------------------------

func (*Queries) AddRoleToUser

func (q *Queries) AddRoleToUser(ctx context.Context, arg AddRoleToUserParams) error

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, arg AddUserParams) error

---------------------------------------------------------------------------

User Management

---------------------------------------------------------------------------

func (*Queries) AddUserToRole

func (q *Queries) AddUserToRole(ctx context.Context, arg AddUserToRoleParams) error

func (*Queries) DeleteRole

func (q *Queries) DeleteRole(ctx context.Context, id int64) error

func (*Queries) GetAllUserOrganizationRoles added in v0.0.16

func (q *Queries) GetAllUserOrganizationRoles(ctx context.Context, userID int64) ([]GetAllUserOrganizationRolesRow, error)

func (*Queries) GetOrganization

func (q *Queries) GetOrganization(ctx context.Context, id int64) (Organization, error)

func (*Queries) GetOrganizationBySystemName

func (q *Queries) GetOrganizationBySystemName(ctx context.Context, systemName string) (Organization, error)

func (*Queries) GetOrganizationRoles

func (q *Queries) GetOrganizationRoles(ctx context.Context, organizationID int64) ([]GetOrganizationRolesRow, error)

func (*Queries) GetOrganizations

func (q *Queries) GetOrganizations(ctx context.Context) ([]GetOrganizationsRow, error)

func (*Queries) GetRolePermissions

func (q *Queries) GetRolePermissions(ctx context.Context, roleID int64) ([]string, error)

func (*Queries) GetRolesForUser added in v0.0.18

func (q *Queries) GetRolesForUser(ctx context.Context, userID int64) ([]GetRolesForUserRow, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int64) (GetUserRow, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (GetUserByEmailRow, error)

func (*Queries) GetUserOrganizationPermissions

func (q *Queries) GetUserOrganizationPermissions(ctx context.Context, arg GetUserOrganizationPermissionsParams) ([]string, error)

func (*Queries) GetUserOrganizationRoles

func (q *Queries) GetUserOrganizationRoles(ctx context.Context, arg GetUserOrganizationRolesParams) ([]GetUserOrganizationRolesRow, error)

func (*Queries) GetUserOrganizations

func (q *Queries) GetUserOrganizations(ctx context.Context, userID int64) ([]GetUserOrganizationsRow, error)

func (*Queries) GetUsersInRole added in v0.0.18

func (q *Queries) GetUsersInRole(ctx context.Context, roleID int64) ([]GetUsersInRoleRow, error)

func (*Queries) ListOrganizations

func (q *Queries) ListOrganizations(ctx context.Context) ([]Organization, error)

func (*Queries) ListRolesWithUserCounts added in v0.0.16

func (q *Queries) ListRolesWithUserCounts(ctx context.Context, organizationID int64) ([]ListRolesWithUserCountsRow, error)

func (*Queries) ListUserOrganizationRoles

func (q *Queries) ListUserOrganizationRoles(ctx context.Context, userID int64) ([]ListUserOrganizationRolesRow, error)

func (*Queries) OrganizationsCount added in v0.0.16

func (q *Queries) OrganizationsCount(ctx context.Context) (int64, error)

func (*Queries) RemoveAllRolesFromUser

func (q *Queries) RemoveAllRolesFromUser(ctx context.Context, userID int64) error

func (*Queries) RemovePermissionFromRole

func (q *Queries) RemovePermissionFromRole(ctx context.Context, arg RemovePermissionFromRoleParams) error

func (*Queries) RemoveUserFromRole

func (q *Queries) RemoveUserFromRole(ctx context.Context, arg RemoveUserFromRoleParams) error

func (*Queries) UpdateOrganization

func (q *Queries) UpdateOrganization(ctx context.Context, arg UpdateOrganizationParams) error

func (*Queries) UpdateRole

func (q *Queries) UpdateRole(ctx context.Context, arg UpdateRoleParams) error

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error

func (*Queries) UpdateUserLoginStats added in v0.0.16

func (q *Queries) UpdateUserLoginStats(ctx context.Context, arg UpdateUserLoginStatsParams) error

func (*Queries) UserAddApiKey added in v0.0.18

func (q *Queries) UserAddApiKey(ctx context.Context, arg UserAddApiKeyParams) error

func (*Queries) UserDeleteApiKey added in v0.0.18

func (q *Queries) UserDeleteApiKey(ctx context.Context, arg UserDeleteApiKeyParams) error

func (*Queries) UserGetApiKey added in v0.0.18

func (q *Queries) UserGetApiKey(ctx context.Context, apiKeyHash string) (UserGetApiKeyRow, error)

func (*Queries) UserListApiKeys added in v0.0.18

func (q *Queries) UserListApiKeys(ctx context.Context, userID int64) ([]UserListApiKeysRow, error)

func (*Queries) UserSearch added in v0.0.18

func (q *Queries) UserSearch(ctx context.Context, arg UserSearchParams) ([]UserSearchRow, error)

func (*Queries) UsersCount added in v0.0.16

func (q *Queries) UsersCount(ctx context.Context) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type RemovePermissionFromRoleParams

type RemovePermissionFromRoleParams struct {
	RoleID     int64
	Permission string
}

type RemoveUserFromRoleParams

type RemoveUserFromRoleParams struct {
	UserID int64
	RoleID int64
}

type Role

type Role struct {
	ID             int64
	OrganizationID int64
	Name           string
	SystemName     string
}

type RolePermission

type RolePermission struct {
	RoleID     int64
	Permission string
}

type UpdateOrganizationParams

type UpdateOrganizationParams struct {
	Name       string
	SystemName string
	Status     string
	ID         int64
}

type UpdateRoleParams

type UpdateRoleParams struct {
	Name       string
	SystemName string
	ID         int64
}

type UpdateUserLoginStatsParams added in v0.0.16

type UpdateUserLoginStatsParams struct {
	LastLogin  sql.NullTime
	LoginCount int64
	ID         int64
}

type UpdateUserParams

type UpdateUserParams struct {
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	Verified    bool
	UpdatedAt   sql.NullTime
	ID          int64
}

type User

type User struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	CreatedAt   sql.NullTime
	UpdatedAt   sql.NullTime
	LastLogin   sql.NullTime
	LoginCount  int64
	Verified    bool
}

type UserAddApiKeyParams added in v0.0.18

type UserAddApiKeyParams struct {
	ID             string
	SecretHash     string
	UserID         int64
	OrganizationID int64
	Name           string
	CreatedAt      time.Time
	ExpiresAt      time.Time
}

type UserApiKey added in v0.0.18

type UserApiKey struct {
	ID             string
	SecretHash     string
	Name           string
	OrganizationID int64
	UserID         int64
	CreatedAt      time.Time
	ExpiresAt      time.Time
}

type UserDeleteApiKeyParams added in v0.0.18

type UserDeleteApiKeyParams struct {
	ID     string
	UserID int64
}

type UserGetApiKeyRow added in v0.0.18

type UserGetApiKeyRow struct {
	ID             string
	SecretHash     string
	UserID         int64
	OrganizationID int64
	Name           string
	CreatedAt      time.Time
	ExpiresAt      time.Time
}

type UserListApiKeysRow added in v0.0.18

type UserListApiKeysRow struct {
	ID             string
	UserID         int64
	OrganizationID int64
	Name           string
	CreatedAt      time.Time
	ExpiresAt      time.Time
}

type UserRole

type UserRole struct {
	UserID int64
	RoleID int64
}

type UserSearchParams added in v0.0.18

type UserSearchParams struct {
	Query string
	Start int64
	Count int64
}

type UserSearchRow added in v0.0.18

type UserSearchRow struct {
	ID          int64
	FirstName   string
	LastName    string
	DisplayName string
	Email       string
	Verified    bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL