pantry-0.10.1: Content addressable Haskell package management

Safe Haskell | None
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 SafeFilePath
- newtype ModuleNameP = ModuleNameP {
  - unModuleNameP :: ModuleName
  }
- newtype VersionP = VersionP {
  - unVersionP :: Version
  }
- newtype PackageNameP = PackageNameP {
  - unPackageNameP :: PackageName
  }
- data PantryConfig = PantryConfig {
  - pcPackageIndex :: !PackageIndexConfig
  - pcHpackExecutable :: !HpackExecutable
  - pcHpackForce :: !Force
  - 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
  - pcGlobalHintsLocation :: WantedCompiler -> GlobalHintsLocation
  }
- 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
- getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult
- data HackageTarballResult = HackageTarballResult {
  - htrPackage :: !Package
  - htrFreshPackageInfo :: !(Maybe (GenericPackageDescription, TreeId))
  }
- getTreeForKey :: TreeKey -> ReaderT SqlBackend (RIO env) (Maybe (Entity Tree))
- forceUpdateHackageIndex :: (HasPantryConfig env, HasLogFunc env) => Maybe Utf8Builder -> RIO env DidUpdateOccur
- 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
- 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)

# Documentation

data Version Source #

#### Instances

Instances details

PersistEntity Version Source # |

Instance details

Defined in Pantry.Storage

Associated Types

type PersistEntityBackend Version |
Instance details Defined in Pantry.Storage type PersistEntityBackend Version = SqlBackend
newtype Key Version |

Instance details

Defined in Pantry.Storage

newtype Key Version = VersionKey {

- unVersionKey :: BackendKey SqlBackend

}

data EntityField Version typ |

Instance details

Defined in Pantry.Storage

data EntityField Version typ

- = typ ~ VersionId => VersionId
- | typ ~ VersionP => VersionVersion

data Unique Version |
Instance details Defined in Pantry.Storage data Unique Version = UniqueVersion VersionP

Methods

keyToValues :: Key Version -> [PersistValue] Source #

keyFromValues :: [PersistValue] -> Either Text (Key Version) Source #

persistIdField :: EntityField Version (Key Version) Source #

entityDef :: proxy Version -> EntityDef Source #

persistFieldDef :: EntityField Version typ -> FieldDef Source #

toPersistFields :: Version -> [PersistValue] Source #

fromPersistValues :: [PersistValue] -> Either Text Version Source #

tabulateEntityA :: Applicative f => (forall a. EntityField Version a -> f a) -> f (Entity Version) Source #

tabulateEntityApply :: Apply f => (forall a. EntityField Version a -> f a) -> f (Entity Version) Source #

persistUniqueKeys :: Version -> [Unique Version] Source #

persistUniqueToFieldNames :: Unique Version -> NonEmpty (FieldNameHS, FieldNameDB) Source #

persistUniqueToValues :: Unique Version -> [PersistValue] Source #

fieldLens :: EntityField Version field -> forall (f :: Type -> Type). Functor f => (field -> f field) -> Entity Version -> f (Entity Version) Source #

keyFromRecordM :: Maybe (Version -> Key Version) Source #

SafeToInsert Version Source # |
Instance details Defined in Pantry.Storage
PersistField Version Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Version -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text Version Source #
AtLeastOneUniqueKey Version Source # |
Instance details Defined in Pantry.Storage Methods requireUniquesP :: Version -> NonEmpty (Unique Version) Source #
OnlyOneUniqueKey Version Source # |
Instance details Defined in Pantry.Storage Methods onlyUniqueP :: Version -> Unique Version Source #
PersistFieldSql Version Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy Version -> SqlType Source #
ToBackendKey SqlBackend Version Source # |
Instance details Defined in Pantry.Storage Methods toBackendKey :: Key Version -> BackendKey SqlBackend Source # fromBackendKey :: BackendKey SqlBackend -> Key Version Source #
SymbolToField "version" Tree VersionId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree VersionId Source #
SymbolToField "version" Version VersionP Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Version VersionP Source #
SymbolToField "id" Version (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Version (Key Version) Source #
FromJSON (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods parseJSON :: Value -> Parser (Key Version) Source # parseJSONList :: Value -> Parser [Key Version] Source # omittedField :: Maybe (Key Version) Source #
ToJSON (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods toJSON :: Key Version -> Value Source # toEncoding :: Key Version -> Encoding Source # toJSONList :: [Key Version] -> Value Source # toEncodingList :: [Key Version] -> Encoding Source # omitField :: Key Version -> Bool Source #
Read (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods readsPrec :: Int -> ReadS (Key Version) Source # readList :: ReadS [Key Version] Source # readPrec :: ReadPrec (Key Version) Source # readListPrec :: ReadPrec [Key Version] Source #
Show (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods showsPrec :: Int -> Key Version -> ShowS Source # show :: Key Version -> String Source # showList :: [Key Version] -> ShowS Source #
Eq (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods (==) :: Key Version -> Key Version -> Bool Source # (/=) :: Key Version -> Key Version -> Bool Source #
Ord (Key Version) Source # |

Instance details

Defined in Pantry.Storage

Methods

compare :: Key Version -> Key Version -> Ordering Source #

(<) :: Key Version -> Key Version -> Bool Source #

(<=) :: Key Version -> Key Version -> Bool Source #

(>) :: Key Version -> Key Version -> Bool Source #

(>=) :: Key Version -> Key Version -> Bool Source #

max :: Key Version -> Key Version -> Key Version Source #

min :: Key Version -> Key Version -> Key Version Source #

FromHttpApiData (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods parseUrlPiece :: Text -> Either Text (Key Version) parseHeader :: ByteString -> Either Text (Key Version) parseQueryParam :: Text -> Either Text (Key Version)
ToHttpApiData (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods toUrlPiece :: Key Version -> Text toEncodedUrlPiece :: Key Version -> Builder toHeader :: Key Version -> ByteString toQueryParam :: Key Version -> Text toEncodedQueryParam :: Key Version -> Builder
PathPiece (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods fromPathPiece :: Text -> Maybe (Key Version) toPathPiece :: Key Version -> Text
PersistField (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Key Version -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text (Key Version) Source #
PersistFieldSql (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy (Key Version) -> SqlType Source #
data EntityField Version typ Source # |

Instance details

Defined in Pantry.Storage

data EntityField Version typ

- = typ ~ VersionId => VersionId
- | typ ~ VersionP => VersionVersion

newtype Key Version Source # |

Instance details

Defined in Pantry.Storage

newtype Key Version = VersionKey {

- unVersionKey :: BackendKey SqlBackend

}

type PersistEntityBackend Version Source # |
Instance details Defined in Pantry.Storage type PersistEntityBackend Version = SqlBackend
data Unique Version Source # |
Instance details Defined in Pantry.Storage data Unique Version = UniqueVersion VersionP

data PackageName Source #

#### Instances

Instances details

PersistEntity PackageName Source # |

Instance details

Defined in Pantry.Storage

Associated Types

type PersistEntityBackend PackageName |
Instance details Defined in Pantry.Storage type PersistEntityBackend PackageName = SqlBackend
newtype Key PackageName |

Instance details

Defined in Pantry.Storage

newtype Key PackageName = PackageNameKey {

- unPackageNameKey :: BackendKey SqlBackend

}

data EntityField PackageName typ |

Instance details

Defined in Pantry.Storage

data EntityField PackageName typ

- = typ ~ PackageNameId => PackageNameId
- | typ ~ PackageNameP => PackageNameName

data Unique PackageName |
Instance details Defined in Pantry.Storage data Unique PackageName = UniquePackageName PackageNameP

Methods

keyToValues :: Key PackageName -> [PersistValue] Source #

keyFromValues :: [PersistValue] -> Either Text (Key PackageName) Source #

persistIdField :: EntityField PackageName (Key PackageName) Source #

entityDef :: proxy PackageName -> EntityDef Source #

persistFieldDef :: EntityField PackageName typ -> FieldDef Source #

toPersistFields :: PackageName -> [PersistValue] Source #

fromPersistValues :: [PersistValue] -> Either Text PackageName Source #

tabulateEntityA :: Applicative f => (forall a. EntityField PackageName a -> f a) -> f (Entity PackageName) Source #

tabulateEntityApply :: Apply f => (forall a. EntityField PackageName a -> f a) -> f (Entity PackageName) Source #

persistUniqueKeys :: PackageName -> [Unique PackageName] Source #

persistUniqueToFieldNames :: Unique PackageName -> NonEmpty (FieldNameHS, FieldNameDB) Source #

persistUniqueToValues :: Unique PackageName -> [PersistValue] Source #

fieldLens :: EntityField PackageName field -> forall (f :: Type -> Type). Functor f => (field -> f field) -> Entity PackageName -> f (Entity PackageName) Source #

keyFromRecordM :: Maybe (PackageName -> Key PackageName) Source #

SafeToInsert PackageName Source # |
Instance details Defined in Pantry.Storage
PersistField PackageName Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: PackageName -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text PackageName Source #
AtLeastOneUniqueKey PackageName Source # |
Instance details Defined in Pantry.Storage Methods requireUniquesP :: PackageName -> NonEmpty (Unique PackageName) Source #
OnlyOneUniqueKey PackageName Source # |
Instance details Defined in Pantry.Storage Methods onlyUniqueP :: PackageName -> Unique PackageName Source #
PersistFieldSql PackageName Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy PackageName -> SqlType Source #
ToBackendKey SqlBackend PackageName Source # |
Instance details Defined in Pantry.Storage Methods toBackendKey :: Key PackageName -> BackendKey SqlBackend Source # fromBackendKey :: BackendKey SqlBackend -> Key PackageName Source #
SymbolToField "name" PackageName PackageNameP Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField PackageName PackageNameP Source #
SymbolToField "name" Tree PackageNameId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree PackageNameId Source #
SymbolToField "id" PackageName (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField PackageName (Key PackageName) Source #
FromJSON (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods parseJSON :: Value -> Parser (Key PackageName) Source # parseJSONList :: Value -> Parser [Key PackageName] Source # omittedField :: Maybe (Key PackageName) Source #
ToJSON (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods toJSON :: Key PackageName -> Value Source # toEncoding :: Key PackageName -> Encoding Source # toJSONList :: [Key PackageName] -> Value Source # toEncodingList :: [Key PackageName] -> Encoding Source # omitField :: Key PackageName -> Bool Source #
Read (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods readsPrec :: Int -> ReadS (Key PackageName) Source # readList :: ReadS [Key PackageName] Source # readPrec :: ReadPrec (Key PackageName) Source # readListPrec :: ReadPrec [Key PackageName] Source #
Show (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods showsPrec :: Int -> Key PackageName -> ShowS Source # show :: Key PackageName -> String Source # showList :: [Key PackageName] -> ShowS Source #
Eq (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods (==) :: Key PackageName -> Key PackageName -> Bool Source # (/=) :: Key PackageName -> Key PackageName -> Bool Source #
Ord (Key PackageName) Source # |

Instance details

Defined in Pantry.Storage

Methods

compare :: Key PackageName -> Key PackageName -> Ordering Source #

(<) :: Key PackageName -> Key PackageName -> Bool Source #

(<=) :: Key PackageName -> Key PackageName -> Bool Source #

(>) :: Key PackageName -> Key PackageName -> Bool Source #

(>=) :: Key PackageName -> Key PackageName -> Bool Source #

max :: Key PackageName -> Key PackageName -> Key PackageName Source #

min :: Key PackageName -> Key PackageName -> Key PackageName Source #

FromHttpApiData (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods parseUrlPiece :: Text -> Either Text (Key PackageName) parseHeader :: ByteString -> Either Text (Key PackageName) parseQueryParam :: Text -> Either Text (Key PackageName)
ToHttpApiData (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods toUrlPiece :: Key PackageName -> Text toEncodedUrlPiece :: Key PackageName -> Builder toHeader :: Key PackageName -> ByteString toQueryParam :: Key PackageName -> Text toEncodedQueryParam :: Key PackageName -> Builder
PathPiece (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods fromPathPiece :: Text -> Maybe (Key PackageName) toPathPiece :: Key PackageName -> Text
PersistField (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Key PackageName -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text (Key PackageName) Source #
PersistFieldSql (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy (Key PackageName) -> SqlType Source #
data EntityField PackageName typ Source # |

Instance details

Defined in Pantry.Storage

data EntityField PackageName typ

- = typ ~ PackageNameId => PackageNameId
- | typ ~ PackageNameP => PackageNameName

newtype Key PackageName Source # |

Instance details

Defined in Pantry.Storage

newtype Key PackageName = PackageNameKey {

- unPackageNameKey :: BackendKey SqlBackend

}

type PersistEntityBackend PackageName Source # |
Instance details Defined in Pantry.Storage type PersistEntityBackend PackageName = SqlBackend
data Unique PackageName Source # |
Instance details Defined in Pantry.Storage data Unique PackageName = UniquePackageName PackageNameP

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

Instances details

SymbolToField "key" Tree BlobId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree BlobId Source #
SymbolToField "name" Tree PackageNameId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree PackageNameId Source #
SymbolToField "version" Tree VersionId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree VersionId Source #
SymbolToField "cabal" Tree (Maybe BlobId) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree (Maybe BlobId) Source #
SymbolToField "id" PackageName (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField PackageName (Key PackageName) Source #
SymbolToField "id" Tree (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree (Key Tree) Source #
SymbolToField "id" Version (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Version (Key Version) Source #
FromJSON (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods parseJSON :: Value -> Parser (Key PackageName) Source # parseJSONList :: Value -> Parser [Key PackageName] Source # omittedField :: Maybe (Key PackageName) Source #
FromJSON (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods parseJSON :: Value -> Parser (Key Tree) Source # parseJSONList :: Value -> Parser [Key Tree] Source # omittedField :: Maybe (Key Tree) Source #
FromJSON (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods parseJSON :: Value -> Parser (Key Version) Source # parseJSONList :: Value -> Parser [Key Version] Source # omittedField :: Maybe (Key Version) Source #
ToJSON (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods toJSON :: Key PackageName -> Value Source # toEncoding :: Key PackageName -> Encoding Source # toJSONList :: [Key PackageName] -> Value Source # toEncodingList :: [Key PackageName] -> Encoding Source # omitField :: Key PackageName -> Bool Source #
ToJSON (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods toJSON :: Key Tree -> Value Source # toEncoding :: Key Tree -> Encoding Source # toJSONList :: [Key Tree] -> Value Source # toEncodingList :: [Key Tree] -> Encoding Source # omitField :: Key Tree -> Bool Source #
ToJSON (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods toJSON :: Key Version -> Value Source # toEncoding :: Key Version -> Encoding Source # toJSONList :: [Key Version] -> Value Source # toEncodingList :: [Key Version] -> Encoding Source # omitField :: Key Version -> Bool Source #
Read (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods readsPrec :: Int -> ReadS (Key PackageName) Source # readList :: ReadS [Key PackageName] Source # readPrec :: ReadPrec (Key PackageName) Source # readListPrec :: ReadPrec [Key PackageName] Source #
Read (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods readsPrec :: Int -> ReadS (Key Tree) Source # readList :: ReadS [Key Tree] Source # readPrec :: ReadPrec (Key Tree) Source # readListPrec :: ReadPrec [Key Tree] Source #
Read (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods readsPrec :: Int -> ReadS (Key Version) Source # readList :: ReadS [Key Version] Source # readPrec :: ReadPrec (Key Version) Source # readListPrec :: ReadPrec [Key Version] Source #
Show (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods showsPrec :: Int -> Key PackageName -> ShowS Source # show :: Key PackageName -> String Source # showList :: [Key PackageName] -> ShowS Source #
Show (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods showsPrec :: Int -> Key Tree -> ShowS Source # show :: Key Tree -> String Source # showList :: [Key Tree] -> ShowS Source #
Show (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods showsPrec :: Int -> Key Version -> ShowS Source # show :: Key Version -> String Source # showList :: [Key Version] -> ShowS Source #
Eq (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods (==) :: Key PackageName -> Key PackageName -> Bool Source # (/=) :: Key PackageName -> Key PackageName -> Bool Source #
Eq (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods (==) :: Key Tree -> Key Tree -> Bool Source # (/=) :: Key Tree -> Key Tree -> Bool Source #
Eq (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods (==) :: Key Version -> Key Version -> Bool Source # (/=) :: Key Version -> Key Version -> Bool Source #
Ord (Key PackageName) Source # |

Instance details

Defined in Pantry.Storage

Methods

compare :: Key PackageName -> Key PackageName -> Ordering Source #

(<) :: Key PackageName -> Key PackageName -> Bool Source #

(<=) :: Key PackageName -> Key PackageName -> Bool Source #

(>) :: Key PackageName -> Key PackageName -> Bool Source #

(>=) :: Key PackageName -> Key PackageName -> Bool Source #

max :: Key PackageName -> Key PackageName -> Key PackageName Source #

min :: Key PackageName -> Key PackageName -> Key PackageName Source #

Ord (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods compare :: Key Tree -> Key Tree -> Ordering Source # (<) :: Key Tree -> Key Tree -> Bool Source # (<=) :: Key Tree -> Key Tree -> Bool Source # (>) :: Key Tree -> Key Tree -> Bool Source # (>=) :: Key Tree -> Key Tree -> Bool Source # max :: Key Tree -> Key Tree -> Key Tree Source # min :: Key Tree -> Key Tree -> Key Tree Source #
Ord (Key Version) Source # |

Instance details

Defined in Pantry.Storage

Methods

compare :: Key Version -> Key Version -> Ordering Source #

(<) :: Key Version -> Key Version -> Bool Source #

(<=) :: Key Version -> Key Version -> Bool Source #

(>) :: Key Version -> Key Version -> Bool Source #

(>=) :: Key Version -> Key Version -> Bool Source #

max :: Key Version -> Key Version -> Key Version Source #

min :: Key Version -> Key Version -> Key Version Source #

FromHttpApiData (Key PackageName) |
Instance details Defined in Pantry.Storage Methods parseUrlPiece :: Text -> Either Text (Key PackageName) parseHeader :: ByteString -> Either Text (Key PackageName) parseQueryParam :: Text -> Either Text (Key PackageName)
FromHttpApiData (Key Tree) |
Instance details Defined in Pantry.Storage Methods parseUrlPiece :: Text -> Either Text (Key Tree) parseHeader :: ByteString -> Either Text (Key Tree) parseQueryParam :: Text -> Either Text (Key Tree)
FromHttpApiData (Key Version) |
Instance details Defined in Pantry.Storage Methods parseUrlPiece :: Text -> Either Text (Key Version) parseHeader :: ByteString -> Either Text (Key Version) parseQueryParam :: Text -> Either Text (Key Version)
ToHttpApiData (Key PackageName) |
Instance details Defined in Pantry.Storage Methods toUrlPiece :: Key PackageName -> Text toEncodedUrlPiece :: Key PackageName -> Builder toHeader :: Key PackageName -> ByteString toQueryParam :: Key PackageName -> Text toEncodedQueryParam :: Key PackageName -> Builder
ToHttpApiData (Key Tree) |
Instance details Defined in Pantry.Storage Methods toUrlPiece :: Key Tree -> Text toEncodedUrlPiece :: Key Tree -> Builder toHeader :: Key Tree -> ByteString toQueryParam :: Key Tree -> Text toEncodedQueryParam :: Key Tree -> Builder
ToHttpApiData (Key Version) |
Instance details Defined in Pantry.Storage Methods toUrlPiece :: Key Version -> Text toEncodedUrlPiece :: Key Version -> Builder toHeader :: Key Version -> ByteString toQueryParam :: Key Version -> Text toEncodedQueryParam :: Key Version -> Builder
PathPiece (Key PackageName) |
Instance details Defined in Pantry.Storage Methods fromPathPiece :: Text -> Maybe (Key PackageName) toPathPiece :: Key PackageName -> Text
PathPiece (Key Tree) |
Instance details Defined in Pantry.Storage Methods fromPathPiece :: Text -> Maybe (Key Tree) toPathPiece :: Key Tree -> Text
PathPiece (Key Version) |
Instance details Defined in Pantry.Storage Methods fromPathPiece :: Text -> Maybe (Key Version) toPathPiece :: Key Version -> Text
PersistField (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Key PackageName -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text (Key PackageName) Source #
PersistField (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Key Tree -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text (Key Tree) Source #
PersistField (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Key Version -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text (Key Version) Source #
PersistFieldSql (Key PackageName) Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy (Key PackageName) -> SqlType Source #
PersistFieldSql (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy (Key Tree) -> SqlType Source #
PersistFieldSql (Key Version) Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy (Key Version) -> SqlType Source #
(PersistEntity a, PersistEntityBackend a ~ backend, IsPersistBackend backend) => RawSql (Key a) |
Instance details Defined in Database.Persist.Sql.Class Methods rawSqlCols :: (Text -> Text) -> Key a -> (Int, [Text]) Source # rawSqlColCountReason :: Key a -> String Source # rawSqlProcessRow :: [PersistValue] -> Either Text (Key a) Source #
newtype Key PackageName Source # |

Instance details

Defined in Pantry.Storage

newtype Key PackageName = PackageNameKey {

- unPackageNameKey :: BackendKey SqlBackend

}

newtype Key Tree Source # |

Instance details

Defined in Pantry.Storage

newtype Key Tree = TreeKey' {

- unTreeKey :: BackendKey SqlBackend

}

newtype Key Version Source # |

Instance details

Defined in Pantry.Storage

newtype Key Version = VersionKey {

- unVersionKey :: BackendKey SqlBackend

}

data family Unique record Source #

Unique keys besides the `Key`.

#### Instances

Instances details

data Unique PackageName Source # |
Instance details Defined in Pantry.Storage data Unique PackageName = UniquePackageName PackageNameP
data Unique Tree Source # |
Instance details Defined in Pantry.Storage data Unique Tree = UniqueTree BlobId
data Unique Version Source # |
Instance details Defined in Pantry.Storage data Unique Version = UniqueVersion VersionP

data Tree Source #

Constructors

Tree |

Fields

- treeKey :: !BlobId
- treeCabal :: !(Maybe BlobId)
- treeCabalType :: !FileType
- treeName :: !PackageNameId
- treeVersion :: !VersionId

#### Instances

Instances details

PersistEntity Tree Source # |

Instance details

Defined in Pantry.Storage

Associated Types

type PersistEntityBackend Tree |
Instance details Defined in Pantry.Storage type PersistEntityBackend Tree = SqlBackend
newtype Key Tree |

Instance details

Defined in Pantry.Storage

newtype Key Tree = TreeKey' {

- unTreeKey :: BackendKey SqlBackend

}

data EntityField Tree typ |

Instance details

Defined in Pantry.Storage

data EntityField Tree typ

- = typ ~ TreeId => TreeId
- | typ ~ BlobId => TreeKey
- | typ ~ Maybe BlobId => TreeCabal
- | typ ~ FileType => TreeCabalType
- | typ ~ PackageNameId => TreeName
- | typ ~ VersionId => TreeVersion

data Unique Tree |
Instance details Defined in Pantry.Storage data Unique Tree = UniqueTree BlobId

Methods

keyToValues :: Key Tree -> [PersistValue] Source #

keyFromValues :: [PersistValue] -> Either Text (Key Tree) Source #

persistIdField :: EntityField Tree (Key Tree) Source #

entityDef :: proxy Tree -> EntityDef Source #

persistFieldDef :: EntityField Tree typ -> FieldDef Source #

toPersistFields :: Tree -> [PersistValue] Source #

fromPersistValues :: [PersistValue] -> Either Text Tree Source #

tabulateEntityA :: Applicative f => (forall a. EntityField Tree a -> f a) -> f (Entity Tree) Source #

tabulateEntityApply :: Apply f => (forall a. EntityField Tree a -> f a) -> f (Entity Tree) Source #

persistUniqueKeys :: Tree -> [Unique Tree] Source #

persistUniqueToFieldNames :: Unique Tree -> NonEmpty (FieldNameHS, FieldNameDB) Source #

persistUniqueToValues :: Unique Tree -> [PersistValue] Source #

fieldLens :: EntityField Tree field -> forall (f :: Type -> Type). Functor f => (field -> f field) -> Entity Tree -> f (Entity Tree) Source #

keyFromRecordM :: Maybe (Tree -> Key Tree) Source #

SafeToInsert Tree Source # |
Instance details Defined in Pantry.Storage
PersistField Tree Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Tree -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text Tree Source #
AtLeastOneUniqueKey Tree Source # |
Instance details Defined in Pantry.Storage Methods requireUniquesP :: Tree -> NonEmpty (Unique Tree) Source #
OnlyOneUniqueKey Tree Source # |
Instance details Defined in Pantry.Storage Methods onlyUniqueP :: Tree -> Unique Tree Source #
PersistFieldSql Tree Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy Tree -> SqlType Source #
ToBackendKey SqlBackend Tree Source # |
Instance details Defined in Pantry.Storage Methods toBackendKey :: Key Tree -> BackendKey SqlBackend Source # fromBackendKey :: BackendKey SqlBackend -> Key Tree Source #
SymbolToField "cabalType" Tree FileType Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree FileType Source #
SymbolToField "key" Tree BlobId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree BlobId Source #
SymbolToField "name" Tree PackageNameId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree PackageNameId Source #
SymbolToField "version" Tree VersionId Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree VersionId Source #
SymbolToField "cabal" Tree (Maybe BlobId) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree (Maybe BlobId) Source #
SymbolToField "id" Tree (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Tree (Key Tree) Source #
FromJSON (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods parseJSON :: Value -> Parser (Key Tree) Source # parseJSONList :: Value -> Parser [Key Tree] Source # omittedField :: Maybe (Key Tree) Source #
ToJSON (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods toJSON :: Key Tree -> Value Source # toEncoding :: Key Tree -> Encoding Source # toJSONList :: [Key Tree] -> Value Source # toEncodingList :: [Key Tree] -> Encoding Source # omitField :: Key Tree -> Bool Source #
Read (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods readsPrec :: Int -> ReadS (Key Tree) Source # readList :: ReadS [Key Tree] Source # readPrec :: ReadPrec (Key Tree) Source # readListPrec :: ReadPrec [Key Tree] Source #
Show (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods showsPrec :: Int -> Key Tree -> ShowS Source # show :: Key Tree -> String Source # showList :: [Key Tree] -> ShowS Source #
Eq (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods (==) :: Key Tree -> Key Tree -> Bool Source # (/=) :: Key Tree -> Key Tree -> Bool Source #
Ord (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods compare :: Key Tree -> Key Tree -> Ordering Source # (<) :: Key Tree -> Key Tree -> Bool Source # (<=) :: Key Tree -> Key Tree -> Bool Source # (>) :: Key Tree -> Key Tree -> Bool Source # (>=) :: Key Tree -> Key Tree -> Bool Source # max :: Key Tree -> Key Tree -> Key Tree Source # min :: Key Tree -> Key Tree -> Key Tree Source #
FromHttpApiData (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods parseUrlPiece :: Text -> Either Text (Key Tree) parseHeader :: ByteString -> Either Text (Key Tree) parseQueryParam :: Text -> Either Text (Key Tree)
ToHttpApiData (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods toUrlPiece :: Key Tree -> Text toEncodedUrlPiece :: Key Tree -> Builder toHeader :: Key Tree -> ByteString toQueryParam :: Key Tree -> Text toEncodedQueryParam :: Key Tree -> Builder
PathPiece (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods fromPathPiece :: Text -> Maybe (Key Tree) toPathPiece :: Key Tree -> Text
PersistField (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods toPersistValue :: Key Tree -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text (Key Tree) Source #
PersistFieldSql (Key Tree) Source # |
Instance details Defined in Pantry.Storage Methods sqlType :: Proxy (Key Tree) -> SqlType Source #
data EntityField Tree typ Source # |

Instance details

Defined in Pantry.Storage

data EntityField Tree typ

- = typ ~ TreeId => TreeId
- | typ ~ BlobId => TreeKey
- | typ ~ Maybe BlobId => TreeCabal
- | typ ~ FileType => TreeCabalType
- | typ ~ PackageNameId => TreeName
- | typ ~ VersionId => TreeVersion

newtype Key Tree Source # |

Instance details

Defined in Pantry.Storage

newtype Key Tree = TreeKey' {

- unTreeKey :: BackendKey SqlBackend

}

type PersistEntityBackend Tree Source # |
Instance details Defined in Pantry.Storage type PersistEntityBackend Tree = SqlBackend
data Unique Tree Source # |
Instance details Defined in Pantry.Storage data Unique Tree = UniqueTree BlobId

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

Instances details

SymbolToField sym rec typ => IsLabel sym (EntityField rec typ) | This instance delegates to `SymbolToField` to provide `OverloadedLabels` support to the `EntityField` type. Since: persistent-2.11.0.0
Instance details Defined in Database.Persist.Class.PersistEntity Methods fromLabel :: EntityField rec typ Source #
data EntityField PackageName typ Source # |

Instance details

Defined in Pantry.Storage

data EntityField PackageName typ

- = typ ~ PackageNameId => PackageNameId
- | typ ~ PackageNameP => PackageNameName

data EntityField Tree typ Source # |

Instance details

Defined in Pantry.Storage

data EntityField Tree typ

- = typ ~ TreeId => TreeId
- | typ ~ BlobId => TreeKey
- | typ ~ Maybe BlobId => TreeCabal
- | typ ~ FileType => TreeCabalType
- | typ ~ PackageNameId => TreeName
- | typ ~ VersionId => TreeVersion

data EntityField Version typ Source # |

Instance details

Defined in Pantry.Storage

data EntityField Version typ

- = typ ~ VersionId => VersionId
- | typ ~ VersionP => VersionVersion

data SafeFilePath Source #

#### Instances

Instances details

Show SafeFilePath |
Instance details Defined in Pantry.Types Methods showsPrec :: Int -> SafeFilePath -> ShowS Source # show :: SafeFilePath -> String Source # showList :: [SafeFilePath] -> ShowS Source #
Eq SafeFilePath |
Instance details Defined in Pantry.Types Methods (==) :: SafeFilePath -> SafeFilePath -> Bool Source # (/=) :: SafeFilePath -> SafeFilePath -> Bool Source #
Ord SafeFilePath |

Instance details

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 |
Instance details Defined in Pantry.Types Methods toPersistValue :: SafeFilePath -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text SafeFilePath Source #
PersistFieldSql SafeFilePath |
Instance details Defined in Pantry.Types Methods sqlType :: Proxy SafeFilePath -> SqlType Source #
Display SafeFilePath |
Instance details Defined in Pantry.Types Methods display :: SafeFilePath -> Utf8Builder Source # textDisplay :: SafeFilePath -> Text Source #

newtype ModuleNameP Source #

Constructors

ModuleNameP |

Fields

- unModuleNameP :: ModuleName

#### Instances

Instances details

NFData ModuleNameP |
Instance details Defined in Pantry.Types Methods rnf :: ModuleNameP -> () Source #
Show ModuleNameP |
Instance details Defined in Pantry.Types Methods showsPrec :: Int -> ModuleNameP -> ShowS Source # show :: ModuleNameP -> String Source # showList :: [ModuleNameP] -> ShowS Source #
Eq ModuleNameP |
Instance details Defined in Pantry.Types Methods (==) :: ModuleNameP -> ModuleNameP -> Bool Source # (/=) :: ModuleNameP -> ModuleNameP -> Bool Source #
Ord ModuleNameP |

Instance details

Defined in Pantry.Types

Methods

compare :: ModuleNameP -> ModuleNameP -> Ordering Source #

(<) :: ModuleNameP -> ModuleNameP -> Bool Source #

(<=) :: ModuleNameP -> ModuleNameP -> Bool Source #

(>) :: ModuleNameP -> ModuleNameP -> Bool Source #

(>=) :: ModuleNameP -> ModuleNameP -> Bool Source #

max :: ModuleNameP -> ModuleNameP -> ModuleNameP Source #

min :: ModuleNameP -> ModuleNameP -> ModuleNameP Source #

PersistField ModuleNameP |
Instance details Defined in Pantry.Types Methods toPersistValue :: ModuleNameP -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text ModuleNameP Source #
PersistFieldSql ModuleNameP |
Instance details Defined in Pantry.Types Methods sqlType :: Proxy ModuleNameP -> SqlType Source #
Display ModuleNameP |
Instance details Defined in Pantry.Types Methods display :: ModuleNameP -> Utf8Builder Source # textDisplay :: ModuleNameP -> Text Source #

newtype VersionP Source #

Constructors

VersionP |

Fields

- unVersionP :: Version

#### Instances

Instances details

FromJSON VersionP |
Instance details Defined in Pantry.Types Methods parseJSON :: Value -> Parser VersionP Source # parseJSONList :: Value -> Parser [VersionP] Source # omittedField :: Maybe VersionP Source #
ToJSON VersionP |
Instance details Defined in Pantry.Types Methods toJSON :: VersionP -> Value Source # toEncoding :: VersionP -> Encoding Source # toJSONList :: [VersionP] -> Value Source # toEncodingList :: [VersionP] -> Encoding Source # omitField :: VersionP -> Bool Source #
NFData VersionP |
Instance details Defined in Pantry.Types Methods rnf :: VersionP -> () Source #
Read VersionP |
Instance details Defined in Pantry.Types Methods readsPrec :: Int -> ReadS VersionP Source # readList :: ReadS [VersionP] Source # readPrec :: ReadPrec VersionP Source # readListPrec :: ReadPrec [VersionP] Source #
Show VersionP |
Instance details Defined in Pantry.Types Methods showsPrec :: Int -> VersionP -> ShowS Source # show :: VersionP -> String Source # showList :: [VersionP] -> ShowS Source #
Eq VersionP |
Instance details Defined in Pantry.Types Methods (==) :: VersionP -> VersionP -> Bool Source # (/=) :: VersionP -> VersionP -> Bool Source #
Ord VersionP |
Instance details Defined in Pantry.Types Methods compare :: VersionP -> VersionP -> Ordering Source # (<) :: VersionP -> VersionP -> Bool Source # (<=) :: VersionP -> VersionP -> Bool Source # (>) :: VersionP -> VersionP -> Bool Source # (>=) :: VersionP -> VersionP -> Bool Source # max :: VersionP -> VersionP -> VersionP Source # min :: VersionP -> VersionP -> VersionP Source #
PersistField VersionP |
Instance details Defined in Pantry.Types Methods toPersistValue :: VersionP -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text VersionP Source #
PersistFieldSql VersionP |
Instance details Defined in Pantry.Types Methods sqlType :: Proxy VersionP -> SqlType Source #
Display VersionP |
Instance details Defined in Pantry.Types Methods display :: VersionP -> Utf8Builder Source # textDisplay :: VersionP -> Text Source #
SymbolToField "version" Version VersionP Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField Version VersionP Source #

newtype PackageNameP Source #

Constructors

PackageNameP |

Fields

- unPackageNameP :: PackageName

#### Instances

Instances details

FromJSON PackageNameP |
Instance details Defined in Pantry.Types Methods parseJSON :: Value -> Parser PackageNameP Source # parseJSONList :: Value -> Parser [PackageNameP] Source # omittedField :: Maybe PackageNameP Source #
FromJSONKey PackageNameP |
Instance details Defined in Pantry.Types Methods fromJSONKey :: FromJSONKeyFunction PackageNameP Source # fromJSONKeyList :: FromJSONKeyFunction [PackageNameP] Source #
ToJSON PackageNameP |
Instance details Defined in Pantry.Types Methods toJSON :: PackageNameP -> Value Source # toEncoding :: PackageNameP -> Encoding Source # toJSONList :: [PackageNameP] -> Value Source # toEncodingList :: [PackageNameP] -> Encoding Source # omitField :: PackageNameP -> Bool Source #
ToJSONKey PackageNameP |
Instance details Defined in Pantry.Types Methods toJSONKey :: ToJSONKeyFunction PackageNameP Source # toJSONKeyList :: ToJSONKeyFunction [PackageNameP] Source #
NFData PackageNameP |
Instance details Defined in Pantry.Types Methods rnf :: PackageNameP -> () Source #
Read PackageNameP |
Instance details Defined in Pantry.Types Methods readsPrec :: Int -> ReadS PackageNameP Source # readList :: ReadS [PackageNameP] Source # readPrec :: ReadPrec PackageNameP Source # readListPrec :: ReadPrec [PackageNameP] Source #
Show PackageNameP |
Instance details Defined in Pantry.Types Methods showsPrec :: Int -> PackageNameP -> ShowS Source # show :: PackageNameP -> String Source # showList :: [PackageNameP] -> ShowS Source #
Eq PackageNameP |
Instance details Defined in Pantry.Types Methods (==) :: PackageNameP -> PackageNameP -> Bool Source # (/=) :: PackageNameP -> PackageNameP -> Bool Source #
Ord PackageNameP |

Instance details

Defined in Pantry.Types

Methods

compare :: PackageNameP -> PackageNameP -> Ordering Source #

(<) :: PackageNameP -> PackageNameP -> Bool Source #

(<=) :: PackageNameP -> PackageNameP -> Bool Source #

(>) :: PackageNameP -> PackageNameP -> Bool Source #

(>=) :: PackageNameP -> PackageNameP -> Bool Source #

max :: PackageNameP -> PackageNameP -> PackageNameP Source #

min :: PackageNameP -> PackageNameP -> PackageNameP Source #

PersistField PackageNameP |
Instance details Defined in Pantry.Types Methods toPersistValue :: PackageNameP -> PersistValue Source # fromPersistValue :: PersistValue -> Either Text PackageNameP Source #
PersistFieldSql PackageNameP |
Instance details Defined in Pantry.Types Methods sqlType :: Proxy PackageNameP -> SqlType Source #
Display PackageNameP |
Instance details Defined in Pantry.Types Methods display :: PackageNameP -> Utf8Builder Source # textDisplay :: PackageNameP -> Text Source #
SymbolToField "name" PackageName PackageNameP Source # |
Instance details Defined in Pantry.Storage Methods symbolToField :: EntityField PackageName PackageNameP Source #

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

- pcPackageIndex :: !PackageIndexConfig
- pcHpackExecutable :: !HpackExecutable
- pcHpackForce :: !Force
- pcRootDir :: !(Path Abs Dir)
- pcStorage :: !Storage
- pcUpdateRef :: !(MVar Bool)

  Want to try updating the index once during a single run for missing package identifiers. We also want to ensure we only update once at a time. Start at `True`.

- pcParsedCabalFilesRawImmutable :: !(IORef (Map RawPackageLocationImmutable GenericPackageDescription))

  Cache of previously parsed cabal files, to save on slow parsing time.

- pcParsedCabalFilesMutable :: !(IORef (Map (Path Abs Dir) (PrintWarnings -> IO GenericPackageDescription, PackageName, Path Abs File)))

  Cache for mutable packages. We want to allow for an optimization: deferring parsing of the `GenericPackageDescription` until its actually needed. Therefore, we keep the filepath and the `PackageName` derived from that filepath. When the `IO GenericPackageDescription` is run, it will ensure that the `PackageName` matches the value inside the cabal file, and print out any warnings that still need to be printed.

- pcConnectionCount :: !Int

  concurrently open downloads

- pcCasaConfig :: !(Maybe (CasaRepoPrefix, Int))

  Optionally, the Casa pull URL e.g. `https://casa.stackage.org` and the maximum number of Casa keys to pull per request.

- pcSnapshotLocation :: SnapName -> RawSnapshotLocation

  The location of snapshot synonyms

- pcGlobalHintsLocation :: WantedCompiler -> GlobalHintsLocation

  The location of global hints

data Storage Source #

Represents a SQL database connection.

Constructors

Storage |

Fields

- 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 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 #

getHackageTarball :: (HasPantryConfig env, HasLogFunc env, HasProcessContext env) => PackageIdentifierRevision -> Maybe TreeKey -> RIO env HackageTarballResult Source #

data HackageTarballResult Source #

Information returned by `getHackageTarball`

Since: 0.1.0.0

Constructors

HackageTarballResult |

Fields

- htrPackage :: !Package

  Package that was loaded from Hackage tarball

- htrFreshPackageInfo :: !(Maybe (GenericPackageDescription, TreeId))

  This information is only available whenever package was just loaded into pantry.

getTreeForKey :: TreeKey -> ReaderT SqlBackend (RIO env) (Maybe (Entity Tree)) 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

type BlobId = Key Blob Source #

type HackageCabalId = Key HackageCabal Source #

type ModuleNameId = Key ModuleName Source #

type PackageNameId = Key PackageName Source #

type TreeEntryId = Key TreeEntry Source #

type TreeId = Key Tree Source #

type VersionId = Key Version Source #

allBlobsCount :: Maybe BlobId -> ReaderT SqlBackend (RIO env) Int Source #

allBlobsSource 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 #

migrateAll :: Migration Source #

storeBlob :: ByteString -> ReaderT SqlBackend (RIO env) (BlobId, BlobKey) Source #