Flox Package Database 1
CRUD Operations on Nix Package Metadata
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
flox::pkgdb::DbPackage Class Reference

Package metadata loaded from a ‘PkgDb’ cache. More...

#include <db-package.hh>

Inheritance diagram for flox::pkgdb::DbPackage:
flox::RawPackage flox::Package

Public Member Functions

 DbPackage (PkgDbReadOnly &pkgdb, row_id pkgId)
 
 DbPackage (PkgDbReadOnly &pkgdb, const AttrPath &path)
 
row_id getPackageId () const
 
std::filesystem::path getDbPath () const
 
nix::FlakeRef getLockedFlakeRef () const
 
- Public Member Functions inherited from flox::RawPackage
 RawPackage (const AttrPath &path={}, std::string_view name={}, std::string_view pname={}, std::optional< std::string > version=std::nullopt, std::optional< std::string > semver=std::nullopt, std::optional< std::string > license=std::nullopt, const std::vector< std::string > &outputs={ "out" }, const std::vector< std::string > &outputsToInstall={ "out" }, std::optional< bool > broken=std::nullopt, std::optional< bool > unfree=std::nullopt, std::optional< std::string > description=std::nullopt)
 
AttrPath getPathStrs () const override
 
std::string getFullName () const override
 
std::string getPname () const override
 
std::optional< std::string > getVersion () const override
 
std::optional< std::string > getSemver () const override
 
std::optional< std::string > getLicense () const override
 
std::vector< std::string > getOutputs () const override
 
std::vector< std::string > getOutputsToInstall () const override
 
std::optional< bool > isBroken () const override
 
std::optional< bool > isUnfree () const override
 
std::optional< std::string > getDescription () const override
 
- Public Member Functions inherited from flox::Package
 Package (const Package &)=default
 
 Package (Package &&)=default
 
Packageoperator= (const Package &)=default
 
Packageoperator= (Package &&)=default
 
virtual AttrPath getPathStrs () const =0
 
virtual std::string getFullName () const =0
 
virtual std::string getPname () const =0
 
virtual std::optional< std::string > getVersion () const =0
 
virtual std::optional< std::string > getLicense () const =0
 
virtual std::vector< std::string > getOutputs () const =0
 
virtual std::vector< std::string > getOutputsToInstall () const =0
 
virtual std::optional< bool > isBroken () const =0
 
virtual std::optional< bool > isUnfree () const =0
 
virtual std::optional< std::string > getDescription () const =0
 
virtual Subtree getSubtreeType () const
 
virtual nix::DrvName getParsedDrvName () const
 
virtual std::optional< std::string > getSemver () const
 
virtual std::string toURIString (const nix::FlakeRef &ref) const
 Create an installable URI string associated with this package using ref as its input part.
 
virtual nlohmann::json getInfo (bool withDescription=false) const
 Serialize notable package metadata as a JSON object.
 

Protected Attributes

row_id pkgId
 
std::filesystem::path dbPath
 

Private Member Functions

void initRawPackage (PkgDbReadOnly &pkgdb)
 Fill flox::RawPackage fields by reading them from pkgdb.
 

Additional Inherited Members

- Public Attributes inherited from flox::RawPackage
AttrPath path
 
std::string name
 
std::string pname
 
std::optional< std::string > version
 
std::optional< std::string > semver
 
std::optional< std::string > license
 
std::vector< std::string > outputs
 
std::vector< std::string > outputsToInstall
 
std::optional< bool > broken
 
std::optional< bool > unfree
 
std::optional< std::string > description
 

Detailed Description

Package metadata loaded from a ‘PkgDb’ cache.

Member Function Documentation

◆ getDbPath()

std::filesystem::path flox::pkgdb::DbPackage::getDbPath ( ) const
inline
Returns
The path to the database.

◆ getLockedFlakeRef()

nix::FlakeRef flox::pkgdb::DbPackage::getLockedFlakeRef ( ) const
inline
Returns
The locked flake reference where the package is defined.

◆ getPackageId()

row_id flox::pkgdb::DbPackage::getPackageId ( ) const
inline
Returns
The Packages.id of the package.

Member Data Documentation

◆ dbPath

std::filesystem::path flox::pkgdb::DbPackage::dbPath
protected

Path to the database.

◆ pkgId

row_id flox::pkgdb::DbPackage::pkgId
protected

‘Packages.id’ in the database.


The documentation for this class was generated from the following files: