db

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 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 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 GetPayloadCacheRow

type GetPayloadCacheRow struct {
	PluginID  string
	Payload   string
	FetchedAt int64
}

type InsertPageParams

type InsertPageParams struct {
	Name string
	Ord  int64
}

type InsertPageWithIDParams

type InsertPageWithIDParams struct {
	ID   int64
	Name string
	Ord  int64
}

type InsertZoneParams

type InsertZoneParams struct {
	ID          string
	PageID      int64
	Ord         int64
	WidthPx     int64
	Plugin      string
	RefreshMs   int64
	Align       string
	OnTap       string
	ChoicesJson string
	ConfigJson  string
	ThemeJson   string
}

type ListZonesForPageRow

type ListZonesForPageRow struct {
	ID          string
	PageID      int64
	Ord         int64
	WidthPx     int64
	Plugin      string
	RefreshMs   int64
	Align       string
	OnTap       string
	ChoicesJson string
	ConfigJson  string
	ThemeJson   string
}

type Page

type Page struct {
	ID   int64
	Name string
	Ord  int64
}

type PayloadCache

type PayloadCache struct {
	ZoneID    string
	PluginID  string
	Payload   string
	FetchedAt int64
}

type Querier

type Querier interface {
	CountPages(ctx context.Context) (int64, error)
	DeleteAllPages(ctx context.Context) error
	DeletePage(ctx context.Context, id int64) error
	DeletePayloadCache(ctx context.Context, zoneID string) error
	DeleteZone(ctx context.Context, id string) error
	GetAllSettings(ctx context.Context) ([]Setting, error)
	GetPayloadCache(ctx context.Context, zoneID string) (GetPayloadCacheRow, error)
	GetSetting(ctx context.Context, key string) (string, error)
	GetZoneConfigJSON(ctx context.Context, id string) (string, error)
	GetZonePageID(ctx context.Context, id string) (int64, error)
	InsertPage(ctx context.Context, arg InsertPageParams) (int64, error)
	InsertPageWithID(ctx context.Context, arg InsertPageWithIDParams) error
	InsertZone(ctx context.Context, arg InsertZoneParams) error
	ListPages(ctx context.Context) ([]Page, error)
	ListZonesForPage(ctx context.Context, pageID int64) ([]ListZonesForPageRow, error)
	UpdatePage(ctx context.Context, arg UpdatePageParams) error
	UpdatePageOrd(ctx context.Context, arg UpdatePageOrdParams) error
	UpdateZone(ctx context.Context, arg UpdateZoneParams) (sql.Result, error)
	UpdateZoneConfigJSON(ctx context.Context, arg UpdateZoneConfigJSONParams) error
	UpdateZoneOrd(ctx context.Context, arg UpdateZoneOrdParams) error
	UpdateZonePlugin(ctx context.Context, arg UpdateZonePluginParams) error
	UpsertPayloadCache(ctx context.Context, arg UpsertPayloadCacheParams) error
	UpsertSetting(ctx context.Context, arg UpsertSettingParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CountPages

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

func (*Queries) DeleteAllPages

func (q *Queries) DeleteAllPages(ctx context.Context) error

func (*Queries) DeletePage

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

func (*Queries) DeletePayloadCache

func (q *Queries) DeletePayloadCache(ctx context.Context, zoneID string) error

func (*Queries) DeleteZone

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

func (*Queries) GetAllSettings

func (q *Queries) GetAllSettings(ctx context.Context) ([]Setting, error)

func (*Queries) GetPayloadCache

func (q *Queries) GetPayloadCache(ctx context.Context, zoneID string) (GetPayloadCacheRow, error)

func (*Queries) GetSetting

func (q *Queries) GetSetting(ctx context.Context, key string) (string, error)

func (*Queries) GetZoneConfigJSON

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

func (*Queries) GetZonePageID

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

func (*Queries) InsertPage

func (q *Queries) InsertPage(ctx context.Context, arg InsertPageParams) (int64, error)

func (*Queries) InsertPageWithID

func (q *Queries) InsertPageWithID(ctx context.Context, arg InsertPageWithIDParams) error

func (*Queries) InsertZone

func (q *Queries) InsertZone(ctx context.Context, arg InsertZoneParams) error

func (*Queries) ListPages

func (q *Queries) ListPages(ctx context.Context) ([]Page, error)

func (*Queries) ListZonesForPage

func (q *Queries) ListZonesForPage(ctx context.Context, pageID int64) ([]ListZonesForPageRow, error)

func (*Queries) UpdatePage

func (q *Queries) UpdatePage(ctx context.Context, arg UpdatePageParams) error

func (*Queries) UpdatePageOrd

func (q *Queries) UpdatePageOrd(ctx context.Context, arg UpdatePageOrdParams) error

func (*Queries) UpdateZone

func (q *Queries) UpdateZone(ctx context.Context, arg UpdateZoneParams) (sql.Result, error)

func (*Queries) UpdateZoneConfigJSON

func (q *Queries) UpdateZoneConfigJSON(ctx context.Context, arg UpdateZoneConfigJSONParams) error

func (*Queries) UpdateZoneOrd

func (q *Queries) UpdateZoneOrd(ctx context.Context, arg UpdateZoneOrdParams) error

func (*Queries) UpdateZonePlugin

func (q *Queries) UpdateZonePlugin(ctx context.Context, arg UpdateZonePluginParams) error

func (*Queries) UpsertPayloadCache

func (q *Queries) UpsertPayloadCache(ctx context.Context, arg UpsertPayloadCacheParams) error

func (*Queries) UpsertSetting

func (q *Queries) UpsertSetting(ctx context.Context, arg UpsertSettingParams) error

func (*Queries) WithTx

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

type SchemaVersion

type SchemaVersion struct {
	Version int64
}

type Setting

type Setting struct {
	Key   string
	Value string
}

type UpdatePageOrdParams

type UpdatePageOrdParams struct {
	Ord int64
	ID  int64
}

type UpdatePageParams

type UpdatePageParams struct {
	Name string
	Ord  int64
	ID   int64
}

type UpdateZoneConfigJSONParams

type UpdateZoneConfigJSONParams struct {
	ConfigJson string
	ID         string
}

type UpdateZoneOrdParams

type UpdateZoneOrdParams struct {
	Ord    int64
	ID     string
	PageID int64
}

type UpdateZoneParams

type UpdateZoneParams struct {
	PageID      int64
	Ord         int64
	WidthPx     int64
	Plugin      string
	RefreshMs   int64
	Align       string
	OnTap       string
	ChoicesJson string
	ConfigJson  string
	ThemeJson   string
	ID          string
}

type UpdateZonePluginParams

type UpdateZonePluginParams struct {
	Plugin string
	ID     string
}

type UpsertPayloadCacheParams

type UpsertPayloadCacheParams struct {
	ZoneID    string
	PluginID  string
	Payload   string
	FetchedAt int64
}

type UpsertSettingParams

type UpsertSettingParams struct {
	Key   string
	Value string
}

type Zone

type Zone struct {
	ID          string
	PageID      int64
	Ord         int64
	WidthPx     int64
	Plugin      string
	RefreshMs   int64
	Align       string
	ConfigJson  string
	ThemeJson   string
	OnTap       string
	ChoicesJson string
}

Jump to

Keyboard shortcuts

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