Safe Haskell | None |
---|---|
Language | Haskell2010 |
All types and functions exported from this module are for advanced usage only. They are needed for stackage-server integration with pantry.
Synopsis
- data family Unique record :: Type
- data family EntityField record a :: Type
- data family Key record :: Type
- data SafeFilePath
- newtype ModuleNameP = ModuleNameP {}
- newtype VersionP = VersionP {}
- newtype PackageNameP = PackageNameP {}
- data PantryConfig = PantryConfig {
- pcHackageSecurity :: !HackageSecurityConfig
- 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
- 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
- packageTreeKey :: Package -> TreeKey
- unSafeFilePath :: SafeFilePath -> Text
- mkSafeFilePath :: Text -> Maybe SafeFilePath
- parsePackageName :: String -> Maybe PackageName
- parseVersion :: String -> Maybe Version
- parseVersionThrowing :: MonadThrow m => String -> m Version
- packageNameString :: PackageName -> String
- versionString :: Version -> String
- type ModuleNameId = Key ModuleName
- type TreeEntryId = Key TreeEntry
- data TreeEntry = TreeEntry {
- treeEntryTree :: !(Key Tree)
- treeEntryPath :: !(Key FilePath)
- treeEntryBlob :: !(Key Blob)
- treeEntryType :: !FileType
- type TreeId = Key Tree
- data Tree = Tree {
- treeKey :: !(Key Blob)
- treeCabal :: !(Maybe (Key Blob))
- treeCabalType :: !FileType
- treeName :: !(Key PackageName)
- treeVersion :: !(Key Version)
- type HackageCabalId = Key HackageCabal
- type VersionId = Key Version
- data Version
- type PackageNameId = Key PackageName
- data PackageName
- type BlobId = Key Blob
- migrateAll :: Migration
- 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
- getBlobKey :: BlobId -> ReaderT SqlBackend (RIO env) BlobKey
- getTreeForKey :: TreeKey -> ReaderT SqlBackend (RIO env) (Maybe (Entity Tree))
- data HackageTarballResult = HackageTarballResult {}
- forceUpdateHackageIndex :: (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -> RIO env DidUpdateOccur
- getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult
Documentation
data family Unique record :: Type #
Unique keys besides the Key
.
Instances
Show (Unique Tree) Source # | |
Show (Unique Version) Source # | |
Show (Unique PackageName) Source # | |
Defined in Pantry.Storage | |
data Unique TreeEntry Source # | |
Defined in Pantry.Storage | |
data Unique Tree Source # | |
Defined in Pantry.Storage | |
data Unique Version Source # | |
Defined in Pantry.Storage | |
data Unique PackageName Source # | |
Defined in Pantry.Storage |
data family EntityField record a :: Type #
An EntityField
is parameterised by the Haskell record it belongs to
and the additional type of that field.
Instances
data family Key record :: Type #
By default, a backend will automatically generate the key Instead you can specify a Primary key made up of unique values.
Instances
data SafeFilePath Source #
Instances
Eq SafeFilePath Source # | |
Defined in Pantry.Types (==) :: SafeFilePath -> SafeFilePath -> Bool # (/=) :: SafeFilePath -> SafeFilePath -> Bool # | |
Ord SafeFilePath Source # | |
Defined in Pantry.Types compare :: SafeFilePath -> SafeFilePath -> Ordering # (<) :: SafeFilePath -> SafeFilePath -> Bool # (<=) :: SafeFilePath -> SafeFilePath -> Bool # (>) :: SafeFilePath -> SafeFilePath -> Bool # (>=) :: SafeFilePath -> SafeFilePath -> Bool # max :: SafeFilePath -> SafeFilePath -> SafeFilePath # min :: SafeFilePath -> SafeFilePath -> SafeFilePath # | |
Show SafeFilePath Source # | |
Defined in Pantry.Types showsPrec :: Int -> SafeFilePath -> ShowS # show :: SafeFilePath -> String # showList :: [SafeFilePath] -> ShowS # | |
PersistFieldSql SafeFilePath Source # | |
Defined in Pantry.Types sqlType :: Proxy SafeFilePath -> SqlType # | |
PersistField SafeFilePath Source # | |
Defined in Pantry.Types | |
Display SafeFilePath Source # | |
Defined in Pantry.Types display :: SafeFilePath -> Utf8Builder # textDisplay :: SafeFilePath -> Text # |
newtype ModuleNameP Source #
Instances
Instances
Eq VersionP Source # | |
Ord VersionP Source # | |
Defined in Pantry.Types | |
Read VersionP Source # | |
Show VersionP Source # | |
NFData VersionP Source # | |
Defined in Pantry.Types | |
ToJSON VersionP Source # | |
Defined in Pantry.Types | |
FromJSON VersionP Source # | |
PersistFieldSql VersionP Source # | |
PersistField VersionP Source # | |
Defined in Pantry.Types | |
Display VersionP Source # | |
Defined in Pantry.Types display :: VersionP -> Utf8Builder # textDisplay :: VersionP -> Text # |
newtype PackageNameP Source #
Instances
data PantryConfig Source #
Configuration value used by the entire pantry package. Create one
using withPantryConfig
. See also PantryApp
for a convenience
approach to using pantry.
Since: 0.1.0.0
PantryConfig | |
|
Represents a SQL database connection. This used to be a newtype wrapper around a connection pool. However, when investigating https://github.com/commercialhaskell/stack/issues/4471, it appeared that holding a pool resulted in overly long write locks being held on the database. As a result, we now abstract away whether a pool is used, and the default implementation in Pantry.Storage does not use a pool.
Storage | |
|
packageTreeKey :: Package -> TreeKey Source #
The TreeKey
containing this package.
This is a hash of the binary representation of packageTree
.
Since: 0.1.0.0
unSafeFilePath :: SafeFilePath -> Text Source #
mkSafeFilePath :: Text -> Maybe SafeFilePath Source #
parsePackageName :: String -> Maybe PackageName Source #
Parse a package name from a Value
.
Since: 0.1.0.0
parseVersionThrowing :: MonadThrow m => String -> m Version Source #
Parse a package version from a Value
throwing on failure
Since: 0.1.0.0
packageNameString :: PackageName -> String Source #
Render a package name as a Value
.
Since: 0.1.0.0
type ModuleNameId = Key ModuleName Source #
type TreeEntryId = Key TreeEntry Source #
TreeEntry | |
|
Instances
Tree | |
|
Instances
type HackageCabalId = Key HackageCabal Source #
Instances
type PackageNameId = Key PackageName Source #
data PackageName Source #
Instances
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 #
getBlobKey :: BlobId -> ReaderT SqlBackend (RIO env) BlobKey Source #
getTreeForKey :: TreeKey -> ReaderT SqlBackend (RIO env) (Maybe (Entity Tree)) Source #
data HackageTarballResult Source #
Information returned by getHackageTarball
Since: 0.1.0.0
HackageTarballResult | |
|
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
getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult Source #