repo_settings

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	ModelID   uuid.NullUUID `db:"model_id" json:"model_id"`
	ModelType pgtype.Text   `db:"model_type" json:"model_type"`
	Name      string        `db:"name" json:"name"`
	Value     string        `db:"value" json:"value"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Querier

type Querier interface {
	Create(ctx context.Context, arg CreateParams) (*models.Setting, error)
	GetGlobalByName(ctx context.Context, name string) (*models.Setting, error)
	SetGlobal(ctx context.Context, name string, value string) (*models.Setting, error)
	Update(ctx context.Context, arg UpdateParams) (*models.Setting, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, arg CreateParams) (*models.Setting, error)

func (*Queries) GetGlobalByName

func (q *Queries) GetGlobalByName(ctx context.Context, name string) (*models.Setting, error)

func (*Queries) SetGlobal

func (q *Queries) SetGlobal(ctx context.Context, name string, value string) (*models.Setting, error)

func (*Queries) Update

func (q *Queries) Update(ctx context.Context, arg UpdateParams) (*models.Setting, error)

func (*Queries) WithTx

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

type UpdateParams

type UpdateParams struct {
	ModelID   uuid.NullUUID      `db:"model_id" json:"model_id"`
	ModelType pgtype.Text        `db:"model_type" json:"model_type"`
	Name      string             `db:"name" json:"name"`
	Value     string             `db:"value" json:"value"`
	UpdatedAt pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	ID        uuid.UUID          `db:"id" json:"id"`
}

Jump to

Keyboard shortcuts

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