sqlcmysql

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                string         `json:"id"`
	UserID            string         `json:"user_id"`
	Provider          string         `json:"provider"`
	ProviderAccountID sql.NullString `json:"provider_account_id"`
	PasswordHash      sql.NullString `json:"password_hash"`
	AccessToken       sql.NullString `json:"access_token"`
	RefreshToken      sql.NullString `json:"refresh_token"`
	ExpiresAt         sql.NullString `json:"expires_at"`
	CreatedAt         string         `json:"created_at"`
	UpdatedAt         string         `json:"updated_at"`
}

type BanUserParams

type BanUserParams struct {
	BanReason sql.NullString `json:"ban_reason"`
	BanExpiry sql.NullString `json:"ban_expiry"`
	UpdatedAt string         `json:"updated_at"`
	ID        string         `json:"id"`
}

type CreateUserParams

type CreateUserParams struct {
	ID         string         `json:"id"`
	Avatar     sql.NullString `json:"avatar"`
	Name       string         `json:"name"`
	Email      sql.NullString `json:"email"`
	CreatedAt  string         `json:"created_at"`
	UpdatedAt  string         `json:"updated_at"`
	Disabled   int8           `json:"disabled"`
	Role       sql.NullString `json:"role"`
	Banned     int8           `json:"banned"`
	BanReason  sql.NullString `json:"ban_reason"`
	BanExpiry  sql.NullString `json:"ban_expiry"`
	BanCounter int32          `json:"ban_counter"`
}

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 DeleteUserParams

type DeleteUserParams struct {
	UpdatedAt string `json:"updated_at"`
	ID        string `json:"id"`
}

type GetUserRawRow

type GetUserRawRow struct {
	ID        string `json:"id"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
	Email     string `json:"email"`
	Role      string `json:"role"`
	Disabled  int8   `json:"disabled"`
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListUsersRawParams

type ListUsersRawParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type ListUsersRawRow

type ListUsersRawRow struct {
	ID        string `json:"id"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
	Email     string `json:"email"`
	Role      string `json:"role"`
	Disabled  int8   `json:"disabled"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) BanUser

func (q *Queries) BanUser(ctx context.Context, arg BanUserParams) error

func (*Queries) CountUsers

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

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error

User queries

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, arg DeleteUserParams) error

func (*Queries) GetAdmins

func (q *Queries) GetAdmins(ctx context.Context) ([]User, error)

func (*Queries) GetRole

func (q *Queries) GetRole(ctx context.Context, id string) (string, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email sql.NullString) (User, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id string) (User, error)

func (*Queries) GetUserRaw

func (q *Queries) GetUserRaw(ctx context.Context, id string) (GetUserRawRow, error)

func (*Queries) GetUsersByRole

func (q *Queries) GetUsersByRole(ctx context.Context, role sql.NullString) ([]User, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

func (*Queries) ListUsersRaw

func (q *Queries) ListUsersRaw(ctx context.Context, arg ListUsersRawParams) ([]ListUsersRawRow, error)

func (*Queries) UnbanUser

func (q *Queries) UnbanUser(ctx context.Context, arg UnbanUserParams) error

func (*Queries) UpdateUser

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

func (*Queries) UpdateUserRole

func (q *Queries) UpdateUserRole(ctx context.Context, arg UpdateUserRoleParams) error

func (*Queries) WithTx

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

type Session

type Session struct {
	ID           string         `json:"id"`
	UserID       string         `json:"user_id"`
	Token        string         `json:"token"`
	RefreshToken sql.NullString `json:"refresh_token"`
	ExpiresAt    string         `json:"expires_at"`
	CreatedAt    string         `json:"created_at"`
	IpAddress    sql.NullString `json:"ip_address"`
	UserAgent    sql.NullString `json:"user_agent"`
}

type UnbanUserParams

type UnbanUserParams struct {
	UpdatedAt string `json:"updated_at"`
	ID        string `json:"id"`
}

type UpdateUserParams

type UpdateUserParams struct {
	Avatar    sql.NullString `json:"avatar"`
	Name      string         `json:"name"`
	Email     sql.NullString `json:"email"`
	UpdatedAt string         `json:"updated_at"`
	Disabled  int8           `json:"disabled"`
	ID        string         `json:"id"`
}

type UpdateUserRoleParams

type UpdateUserRoleParams struct {
	Role      sql.NullString `json:"role"`
	UpdatedAt string         `json:"updated_at"`
	ID        string         `json:"id"`
}

type User

type User struct {
	ID         string         `json:"id"`
	Avatar     sql.NullString `json:"avatar"`
	Name       string         `json:"name"`
	Email      sql.NullString `json:"email"`
	CreatedAt  string         `json:"created_at"`
	UpdatedAt  string         `json:"updated_at"`
	Disabled   int8           `json:"disabled"`
	Role       sql.NullString `json:"role"`
	Banned     int8           `json:"banned"`
	BanReason  sql.NullString `json:"ban_reason"`
	BanExpiry  sql.NullString `json:"ban_expiry"`
	BanCounter int32          `json:"ban_counter"`
}

type Verification

type Verification struct {
	ID         string `json:"id"`
	Identifier string `json:"identifier"`
	Token      string `json:"token"`
	Type       string `json:"type"`
	ExpiresAt  string `json:"expires_at"`
	CreatedAt  string `json:"created_at"`
}

Jump to

Keyboard shortcuts

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