Safe Haskell | None |
---|---|
Language | Haskell2010 |
Metadata related types, functions and helpers.
Provides a single function which loads the MSSQL database metadata.
See the file at src-rsrmssqlmssql_table_metadata.sql for the SQL we use to build
this metadata.
See DBTableMetadata
for the Haskell type we use forall
storing this metadata.
Synopsis
- loadDBMetadata :: MonadIO m => TxET QErr m (DBTablesMetadata 'MSSQL)
- data SysTable = SysTable {}
- newtype SysPrimaryKeyColumn = SysPrimaryKeyColumn {
- spkcName :: Text
- data SysPrimaryKey = SysPrimaryKey {
- spkName :: Text
- spkIndexId :: Int
- spkColumns :: NESeq SysPrimaryKeyColumn
- data SysSchema = SysSchema {
- ssName :: Text
- ssSchemaId :: Int
- data SysColumn = SysColumn {
- scName :: Text
- scColumnId :: Int
- scUserTypeId :: Int
- scIsNullable :: Bool
- scIsIdentity :: Bool
- scIsComputed :: Bool
- scJoinedSysType :: SysType
- scJoinedForeignKeyColumns :: [SysForeignKeyColumn]
- data SysType = SysType {
- styName :: Text
- stySchemaId :: Int
- styUserTypeId :: Int
- data SysForeignKeyColumn = SysForeignKeyColumn {}
- transformTable :: SysTable -> (TableName, DBTableMetadata 'MSSQL)
- transformColumn :: SysColumn -> (RawColumnInfo 'MSSQL, [ForeignKey 'MSSQL])
- transformPrimaryKey :: SysPrimaryKey -> PrimaryKey 'MSSQL (Column 'MSSQL)
- coalesceKeys :: [ForeignKey 'MSSQL] -> [ForeignKey 'MSSQL]
- parseScalarType :: Text -> ScalarType
Loader
loadDBMetadata :: MonadIO m => TxET QErr m (DBTablesMetadata 'MSSQL) Source #
Local types
SysTable | |
|
newtype SysPrimaryKeyColumn Source #
SysPrimaryKeyColumn | |
|
data SysPrimaryKey Source #
SysPrimaryKey | |
|
SysColumn | |
|
SysType | |
|
Transform
transformTable :: SysTable -> (TableName, DBTableMetadata 'MSSQL) Source #
transformColumn :: SysColumn -> (RawColumnInfo 'MSSQL, [ForeignKey 'MSSQL]) Source #
transformPrimaryKey :: SysPrimaryKey -> PrimaryKey 'MSSQL (Column 'MSSQL) Source #
Helpers
coalesceKeys :: [ForeignKey 'MSSQL] -> [ForeignKey 'MSSQL] Source #
parseScalarType :: Text -> ScalarType Source #