Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Pantry.Internal.Stackage
Description
All types and functions exported from this module are for advanced usage only. They are needed for stackage-server integration with pantry and some are needed for stack testing.
Synopsis
- data Version
- data PackageName
- data family Key record
- data family Unique record
- data Tree = Tree {
- treeKey :: !BlobId
- treeCabal :: !(Maybe BlobId)
- treeCabalType :: !FileType
- treeName :: !PackageNameId
- treeVersion :: !VersionId
- data family EntityField record :: Type -> Type
- data PantryConfig = PantryConfig {
- pcPackageIndex :: !PackageIndexConfig
- pcHpackExecutable :: !HpackExecutable
- pcRootDir :: !(Path Abs Dir)
- pcStorage :: !Storage
- pcUpdateRef :: !(MVar Bool)
- pcParsedCabalFilesRawImmutable :: !(IORef (Map RawPackageLocationImmutable GenericPackageDescription))
- pcParsedCabalFilesMutable :: !(IORef (Map (Path Abs Dir) (PrintWarnings -> IO GenericPackageDescription, PackageName, Path Abs File)))
- pcConnectionCount :: !Int
- pcCasaConfig :: !(Maybe (CasaRepoPrefix, Int))
- pcSnapshotLocation :: SnapName -> RawSnapshotLocation
- data SafeFilePath
- data Storage = Storage {
- withStorage_ :: forall env a. HasLogFunc env => ReaderT SqlBackend (RIO env) a -> RIO env a
- withWriteLock_ :: forall env a. HasLogFunc env => RIO env a -> RIO env a
- data HackageTarballResult = HackageTarballResult {}
- type BlobId = Key Blob
- type HackageCabalId = Key HackageCabal
- type ModuleNameId = Key ModuleName
- type PackageNameId = Key PackageName
- type TreeEntryId = Key TreeEntry
- type TreeId = Key Tree
- type VersionId = Key Version
- newtype ModuleNameP = ModuleNameP {}
- newtype PackageNameP = PackageNameP {}
- newtype VersionP = VersionP {}
- mkSafeFilePath :: Text -> Maybe SafeFilePath
- getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult
- getTreeForKey :: TreeKey -> ReaderT SqlBackend (RIO env) (Maybe (Entity Tree))
- unSafeFilePath :: SafeFilePath -> Text
- forceUpdateHackageIndex :: (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -> RIO env DidUpdateOccur
- allBlobsCount :: Maybe BlobId -> ReaderT SqlBackend (RIO env) Int
- allBlobsSource :: HasResourceMap env => Maybe BlobId -> ConduitT () (BlobId, ByteString) (ReaderT SqlBackend (RIO env)) ()
- allHackageCabalCount :: Maybe HackageCabalId -> ReaderT SqlBackend (RIO env) Int
- allHackageCabalRawPackageLocations :: HasResourceMap env => Maybe HackageCabalId -> ReaderT SqlBackend (RIO env) (Map HackageCabalId RawPackageLocationImmutable)
- getBlobKey :: BlobId -> ReaderT SqlBackend (RIO env) BlobKey
- getPackageNameById :: PackageNameId -> ReaderT SqlBackend (RIO env) (Maybe PackageName)
- getPackageNameId :: PackageName -> ReaderT SqlBackend (RIO env) PackageNameId
- getVersionId :: Version -> ReaderT SqlBackend (RIO env) VersionId
- loadBlobById :: BlobId -> ReaderT SqlBackend (RIO env) ByteString
- migrateAll :: Migration
- storeBlob :: ByteString -> ReaderT SqlBackend (RIO env) (BlobId, BlobKey)
- packageTreeKey :: Package -> TreeKey
Documentation
Instances
data PackageName Source #
Instances
data family Key record Source #
By default, a backend will automatically generate the key Instead you can specify a Primary key made up of unique values.
Instances
data family Unique record Source #
Unique keys besides the Key
.
Instances
data Unique PackageName Source # | |
Defined in Pantry.Storage | |
data Unique Tree Source # | |
Defined in Pantry.Storage | |
data Unique Version Source # | |
Defined in Pantry.Storage |
Constructors
Tree | |
Fields
|
Instances
data family EntityField record :: Type -> Type Source #
An EntityField
is parameterised by the Haskell record it belongs to
and the additional type of that field.
As of persistent-2.11.0.0
, it's possible to use the OverloadedLabels
language extension to refer to EntityField
values polymorphically. See
the documentation on SymbolToField
for more information.
Instances
SymbolToField sym rec typ => IsLabel sym (EntityField rec typ) | This instance delegates to Since: persistent-2.11.0.0 |
Defined in Database.Persist.Class.PersistEntity Methods fromLabel :: EntityField rec typ Source # | |
data EntityField PackageName typ Source # | |
Defined in Pantry.Storage data EntityField PackageName typ
| |
data EntityField Tree typ Source # | |
Defined in Pantry.Storage | |
data EntityField Version typ Source # | |
Defined in Pantry.Storage |
data PantryConfig Source #
Configuration value used by the entire pantry package. Create one using
withPantryConfig
or withPantryConfig'
. See also PantryApp
for a
convenience approach to using pantry.
Since: 0.1.0.0
Constructors
PantryConfig | |
Fields
|
data SafeFilePath Source #
Instances
Show SafeFilePath Source # | |
Defined in Pantry.Types | |
Eq SafeFilePath Source # | |
Defined in Pantry.Types Methods (==) :: SafeFilePath -> SafeFilePath -> Bool Source # (/=) :: SafeFilePath -> SafeFilePath -> Bool Source # | |
Ord SafeFilePath Source # | |
Defined in Pantry.Types Methods compare :: SafeFilePath -> SafeFilePath -> Ordering Source # (<) :: SafeFilePath -> SafeFilePath -> Bool Source # (<=) :: SafeFilePath -> SafeFilePath -> Bool Source # (>) :: SafeFilePath -> SafeFilePath -> Bool Source # (>=) :: SafeFilePath -> SafeFilePath -> Bool Source # max :: SafeFilePath -> SafeFilePath -> SafeFilePath Source # min :: SafeFilePath -> SafeFilePath -> SafeFilePath Source # | |
PersistField SafeFilePath Source # | |
Defined in Pantry.Types Methods toPersistValue :: SafeFilePath -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text SafeFilePath Source # | |
PersistFieldSql SafeFilePath Source # | |
Defined in Pantry.Types | |
Display SafeFilePath Source # | |
Defined in Pantry.Types |
Represents a SQL database connection.
Constructors
Storage | |
Fields
|
data HackageTarballResult Source #
Information returned by getHackageTarball
Since: 0.1.0.0
Constructors
HackageTarballResult | |
Fields
|
type HackageCabalId = Key HackageCabal Source #
type ModuleNameId = Key ModuleName Source #
type PackageNameId = Key PackageName Source #
type TreeEntryId = Key TreeEntry Source #
newtype ModuleNameP Source #
Constructors
ModuleNameP | |
Fields |
Instances
newtype PackageNameP Source #
Constructors
PackageNameP | |
Fields |
Instances
Constructors
VersionP | |
Fields |
Instances
FromJSON VersionP Source # | |
ToJSON VersionP Source # | |
Read VersionP Source # | |
Show VersionP Source # | |
NFData VersionP Source # | |
Defined in Pantry.Types | |
Eq VersionP Source # | |
Ord VersionP Source # | |
Defined in Pantry.Types | |
PersistField VersionP Source # | |
Defined in Pantry.Types Methods toPersistValue :: VersionP -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text VersionP Source # | |
PersistFieldSql VersionP Source # | |
Display VersionP Source # | |
Defined in Pantry.Types | |
SymbolToField "version" Version VersionP Source # | |
Defined in Pantry.Storage Methods |
mkSafeFilePath :: Text -> Maybe SafeFilePath Source #
getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult Source #
getTreeForKey :: TreeKey -> ReaderT SqlBackend (RIO env) (Maybe (Entity Tree)) Source #
unSafeFilePath :: SafeFilePath -> Text Source #
forceUpdateHackageIndex :: (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -> RIO env DidUpdateOccur Source #
Same as updateHackageIndex
, but force the database update even if hackage
security tells that there is no change. This can be useful in order to make
sure the database is in sync with the locally downloaded tarball
Since: 0.1.0.0
allBlobsCount :: Maybe BlobId -> ReaderT SqlBackend (RIO env) Int Source #
Arguments
:: HasResourceMap env | |
=> Maybe BlobId | For some x, yield blob whose id>x. |
-> ConduitT () (BlobId, ByteString) (ReaderT SqlBackend (RIO env)) () |
allHackageCabalCount :: Maybe HackageCabalId -> ReaderT SqlBackend (RIO env) Int Source #
allHackageCabalRawPackageLocations Source #
Arguments
:: HasResourceMap env | |
=> Maybe HackageCabalId | For some x, yield cabals whose id>x. |
-> ReaderT SqlBackend (RIO env) (Map HackageCabalId RawPackageLocationImmutable) |
Pull all hackage cabal entries from the database as
RawPackageLocationImmutable
. We do a manual join rather than dropping to
raw SQL, and Esqueleto would add more deps.
getBlobKey :: BlobId -> ReaderT SqlBackend (RIO env) BlobKey Source #
getPackageNameById :: PackageNameId -> ReaderT SqlBackend (RIO env) (Maybe PackageName) Source #
getPackageNameId :: PackageName -> ReaderT SqlBackend (RIO env) PackageNameId Source #
getVersionId :: Version -> ReaderT SqlBackend (RIO env) VersionId Source #
loadBlobById :: BlobId -> ReaderT SqlBackend (RIO env) ByteString Source #
storeBlob :: ByteString -> ReaderT SqlBackend (RIO env) (BlobId, BlobKey) Source #
packageTreeKey :: Package -> TreeKey Source #
The TreeKey
containing this package.
This is a hash of the binary representation of packageTree
.
Since: 0.1.0.0