| Copyright | (c) Dmitry Olshansky |
|---|---|
| License | BSD-3-Clause |
| Maintainer | olshanskydr@gmail.com, dima@typeable.io |
| Stability | experimental |
| Safe Haskell | None |
| Language | GHC2021 |
PgSchema.Generation
Description
Generation of type-level database schema definitions
Typically you build an executable that imports this module and run it to emit the schema definition.
Synopsis
- updateSchemaFile :: Bool -> String -> Either String ByteString -> Text -> Text -> GenNames -> IO Bool
- data GenNames = GenNames {
- schemas :: [Text]
- tables :: [NameNS]
- addRelations :: [AddRelation]
- data AddRelation = AddRelation {}
- data NameNS' s = NameNS {
- nnsNamespace :: s
- nnsName :: s
- type NameNS = NameNS' Text
- (->>) :: Text -> Text -> NameNS
Documentation
Arguments
| :: Bool | verbose mode |
| -> String | file name |
| -> Either String ByteString | name of environment variable with connection string, or the connection string itself. When this environment variable is not set or the connection string is empty, we do nothing. |
| -> Text | haskell module name to generate |
| -> Text | name of generated haskell type for schema |
| -> GenNames | names of schemas in database or tables to generate |
| -> IO Bool |
Update (or create) the Haskell file containing the schema definition
Constructors
| GenNames | |
Fields
| |
data AddRelation Source #
Qualified PostgreSQL name: namespace (schema) + local name.
Constructors
| NameNS | |
Fields
| |