queries

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 GetTrustParams

type GetTrustParams struct {
	RepoOwner string
	RepoName  string
	Source    string
	Name      string
}

type GetTrustRow

type GetTrustRow struct {
	Sha256    string
	Command   string
	GrantedAt time.Time
}

type InsertUserScriptParams

type InsertUserScriptParams struct {
	Name       string
	Command    string
	Icon       string
	Scope      string
	ScopeRepos string
	RunsIn     string
	Confirm    int64
	Position   int64
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteUserScript

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

DeleteUserScript deletes a saved script.

func (*Queries) GetTrust

func (q *Queries) GetTrust(ctx context.Context, arg GetTrustParams) (GetTrustRow, error)

GetTrust returns the command the user trusted under a repository, a source, and a name, or sql.ErrNoRows when they never did.

func (*Queries) GetUserScript

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

GetUserScript returns one saved script, or sql.ErrNoRows when it was deleted.

func (*Queries) InsertUserScript

func (q *Queries) InsertUserScript(ctx context.Context, arg InsertUserScriptParams) (int64, error)

InsertUserScript saves a new script at a place in the order, and returns its ID.

func (*Queries) ListUserScripts

func (q *Queries) ListUserScripts(ctx context.Context) ([]UserScript, error)

ListUserScripts returns every script the user saved, in the order they put them in.

func (*Queries) RepoTrust

func (q *Queries) RepoTrust(ctx context.Context, arg RepoTrustParams) ([]RepoTrustRow, error)

RepoTrust returns every command the user trusted in a repository, for the page.

func (*Queries) SetTrust

func (q *Queries) SetTrust(ctx context.Context, arg SetTrustParams) error

SetTrust records that the user trusted a command, in place of what they trusted before under the same repository, source, and name.

func (*Queries) SetUserScriptPosition

func (q *Queries) SetUserScriptPosition(ctx context.Context, arg SetUserScriptPositionParams) error

SetUserScriptPosition puts a script at a place in the order.

func (*Queries) UpdateUserScript

func (q *Queries) UpdateUserScript(ctx context.Context, arg UpdateUserScriptParams) (int64, error)

UpdateUserScript saves a script's fields as edited, leaving its place in the order.

func (*Queries) WithTx

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

type RepoTrustParams

type RepoTrustParams struct {
	RepoOwner string
	RepoName  string
}

type RepoTrustRow

type RepoTrustRow struct {
	Source    string
	Name      string
	Sha256    string
	Command   string
	GrantedAt time.Time
}

type SetTrustParams

type SetTrustParams struct {
	RepoOwner string
	RepoName  string
	Source    string
	Name      string
	Sha256    string
	Command   string
	GrantedAt time.Time
}

type SetUserScriptPositionParams

type SetUserScriptPositionParams struct {
	Position int64
	ID       int64
}

type UpdateUserScriptParams

type UpdateUserScriptParams struct {
	Name       string
	Command    string
	Icon       string
	Scope      string
	ScopeRepos string
	RunsIn     string
	Confirm    int64
	UpdatedAt  time.Time
	ID         int64
}

type UserScript

type UserScript struct {
	ID         int64
	Name       string
	Command    string
	Icon       string
	Scope      string
	ScopeRepos string
	RunsIn     string
	Confirm    int64
	Position   int64
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

Jump to

Keyboard shortcuts

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