Documentation
¶
Index ¶
- Constants
- type Config
- type Database
- func (d *Database) Close() error
- func (d *Database) Connect(ctx context.Context) error
- func (d *Database) DeletePkgs(ctx context.Context, where string, args ...any) error
- func (d *Database) GetConn() *sqlx.DB
- func (d *Database) GetPkg(ctx context.Context, where string, args ...any) (*Package, error)
- func (d *Database) GetPkgs(ctx context.Context, where string, args ...any) (*sqlx.Rows, error)
- func (d *Database) GetVersion(ctx context.Context) (int, bool)
- func (d *Database) Init(ctx context.Context) error
- func (d *Database) InsertPackage(ctx context.Context, pkg Package) error
- func (d *Database) IsEmpty(ctx context.Context) bool
- type JSON
- type Package
Constants ¶
View Source
const CurrentVersion = 3
CurrentVersion is the current version of the database. The database is reset if its version doesn't match this.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) DeletePkgs ¶
func (*Database) InsertPackage ¶
type JSON ¶
type JSON[T any] struct { Val T }
JSON represents a JSON value in the database
func (JSON[T]) MarshalYAML ¶
type Package ¶
type Package struct { BasePkgName string `sh:"base" db:"basepkg_name"` Name string `sh:"name,required" db:"name"` Version string `sh:"version,required" db:"version"` Release int `sh:"release,required" db:"release"` Epoch uint `sh:"epoch" db:"epoch"` Description JSON[map[string]string] `db:"description"` Homepage JSON[map[string]string] `db:"homepage"` Maintainer JSON[map[string]string] `db:"maintainer"` Architectures JSON[[]string] `sh:"architectures" db:"architectures"` Licenses JSON[[]string] `sh:"license" db:"licenses"` Provides JSON[[]string] `sh:"provides" db:"provides"` Conflicts JSON[[]string] `sh:"conflicts" db:"conflicts"` Replaces JSON[[]string] `sh:"replaces" db:"replaces"` Depends JSON[map[string][]string] `db:"depends"` BuildDepends JSON[map[string][]string] `db:"builddepends"` OptDepends JSON[map[string][]string] `db:"optdepends"` Repository string `db:"repository"` }
Package is a ALR package's database representation
Click to show internal directories.
Click to hide internal directories.