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.
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
- forceUpdateHackageIndex :: (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -> RIO env DidUpdateOccur
- getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult
- 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
- getTreeForKey :: TreeKey -> ReaderT SqlBackend (RIO env) (Maybe (Entity Tree))
- 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
- unSafeFilePath :: SafeFilePath -> Text
Documentation
Instances
data PackageName Source #
Instances
Instances
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 #
Instances
SymbolToField sym rec typ => IsLabel sym (EntityField rec typ) | |
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 fromPersistValue :: PersistValue -> Either Text SafeFilePath | |
PersistFieldSql SafeFilePath Source # | |
Defined in Pantry.Types Methods sqlType :: Proxy SafeFilePath -> SqlType | |
Display SafeFilePath Source # | |
Defined in Pantry.Types |
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.
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 fromPersistValue :: PersistValue -> Either Text VersionP | |
PersistFieldSql VersionP Source # | |
Defined in Pantry.Types | |
Display VersionP Source # | |
Defined in Pantry.Types | |
SymbolToField "version" Version VersionP | |
Defined in Pantry.Storage Methods |
mkSafeFilePath :: Text -> Maybe SafeFilePath 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
getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult 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.
getPackageNameById :: PackageNameId -> ReaderT SqlBackend (RIO env) (Maybe PackageName) Source #
getPackageNameId :: PackageName -> ReaderT SqlBackend (RIO env) PackageNameId Source #
loadBlobById :: BlobId -> ReaderT SqlBackend (RIO env) ByteString Source #
migrateAll :: Migration 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
unSafeFilePath :: SafeFilePath -> Text Source #