Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type ColumnSet a = [(Maybe (RTableRef a), [RColumnRef a])]
- data Bindings a = Bindings {
- boundCTEs :: [(TableAlias a, [RColumnRef a])]
- boundColumns :: ColumnSet a
- emptyBindings :: Bindings a
- data SelectScope a = SelectScope {
- bindForHaving :: forall r m. MonadReader (ResolverInfo a) m => m r -> m r
- bindForWhere :: forall r m. MonadReader (ResolverInfo a) m => m r -> m r
- bindForOrder :: forall r m. MonadReader (ResolverInfo a) m => m r -> m r
- bindForGroup :: forall r m. MonadReader (ResolverInfo a) m => m r -> m r
- bindForNamedWindow :: forall r m. MonadReader (ResolverInfo a) m => m r -> m r
- type FromColumns a = ColumnSet a
- type SelectionAliases a = [RColumnRef a]
- data ResolverInfo a = ResolverInfo {
- catalog :: Catalog
- onCTECollision :: forall x. (x -> x) -> x -> x
- bindings :: Bindings a
- selectScope :: FromColumns a -> SelectionAliases a -> SelectScope a
- lcolumnsAreVisibleInLateralViews :: Bool
- mapBindings :: (Bindings a -> Bindings a) -> ResolverInfo a -> ResolverInfo a
- bindColumns :: MonadReader (ResolverInfo a) m => ColumnSet a -> m r -> m r
- bindFromColumns :: MonadReader (ResolverInfo a) m => FromColumns a -> m r -> m r
- bindAliasedColumns :: MonadReader (ResolverInfo a) m => SelectionAliases a -> m r -> m r
- bindBothColumns :: MonadReader (ResolverInfo a) m => FromColumns a -> SelectionAliases a -> m r -> m r
- data RawNames
- data ResolvedNames
- newtype StarColumnNames a = StarColumnNames [RColumnRef a]
- newtype ColumnAliasList a = ColumnAliasList [ColumnAlias a]
- type Resolver r a = StateT Integer (ReaderT (ResolverInfo a) (CatalogObjectResolver a)) (r a)
- data SchemaMember = SchemaMember {
- tableType :: TableType
- persistence :: Persistence ()
- columnsList :: [UQColumnName ()]
- viewQuery :: Maybe (Query ResolvedNames ())
- persistentTable :: [UQColumnName ()] -> SchemaMember
- type SchemaMap = HashMap (UQTableName ()) SchemaMember
- type DatabaseMap = HashMap (UQSchemaName ()) SchemaMap
- type CatalogMap = HashMap (DatabaseName ()) DatabaseMap
- type Path = [UQSchemaName ()]
- type CurrentDatabase = DatabaseName ()
- data Catalog = Catalog {
- catalogResolveSchemaName :: forall a. OQSchemaName a -> CatalogObjectResolver a (FQSchemaName a)
- catalogResolveTableName :: forall a. OQTableName a -> CatalogObjectResolver a (RTableName a)
- catalogHasDatabase :: DatabaseName () -> Existence
- catalogHasSchema :: UQSchemaName () -> Existence
- catalogHasTable :: UQTableName () -> Existence
- catalogResolveTableRef :: forall a. [(TableAlias a, [RColumnRef a])] -> OQTableName a -> CatalogObjectResolver a (WithColumns RTableRef a)
- catalogResolveCreateSchemaName :: forall a. OQSchemaName a -> CatalogObjectResolver a (RCreateSchemaName a)
- catalogResolveCreateTableName :: forall a. OQTableName a -> CatalogObjectResolver a (RCreateTableName a)
- catalogResolveColumnName :: forall a. [(Maybe (RTableRef a), [RColumnRef a])] -> OQColumnName a -> CatalogObjectResolver a (RColumnRef a)
- overCatalogMap :: forall a. (CatalogMap -> (CatalogMap, a)) -> (Catalog, a)
- catalogMap :: !CatalogMap
- catalogWithPath :: Path -> Catalog
- catalogWithDatabase :: CurrentDatabase -> Catalog
- type CatalogObjectResolver a = ExceptT (ResolutionError a) (Writer [Either (ResolutionError a) (ResolutionSuccess a)])
- data ResolutionError a
- = MissingDatabase (DatabaseName a)
- | MissingSchema (OQSchemaName a)
- | MissingTable (OQTableName a)
- | AmbiguousTable (OQTableName a)
- | MissingColumn (OQColumnName a)
- | AmbiguousColumn (OQColumnName a)
- | UnintroducedTable (OQTableName a)
- | UnexpectedTable (FQTableName a)
- | UnexpectedSchema (FQSchemaName a)
- | BadPositionalReference a Int
- data ResolutionSuccess a
- = TableNameResolved (OQTableName a) (RTableName a)
- | TableNameDefaulted (OQTableName a) (RTableName a)
- | CreateTableNameResolved (OQTableName a) (RCreateTableName a)
- | CreateSchemaNameResolved (OQSchemaName a) (RCreateSchemaName a)
- | TableRefResolved (OQTableName a) (RTableRef a)
- | TableRefDefaulted (OQTableName a) (RTableRef a)
- | ColumnRefResolved (OQColumnName a) (RColumnRef a)
- | ColumnRefDefaulted (OQColumnName a) (RColumnRef a)
- isGuess :: ResolutionSuccess a -> Bool
- isCertain :: ResolutionSuccess a -> Bool
- data WithColumns r a = WithColumns {
- withColumnsValue :: r a
- withColumnsColumns :: ColumnSet a
- data WithColumnsAndOrders r a = WithColumnsAndOrders (r a) (ColumnSet a) [Order ResolvedNames a]
- data RTableRef a
- = RTableRef (FQTableName a) SchemaMember
- | RTableAlias (TableAlias a)
- resolvedTableHasName :: QTableName f a -> RTableRef a -> Bool
- resolvedTableHasSchema :: QSchemaName f a -> RTableRef a -> Bool
- resolvedTableHasDatabase :: DatabaseName a -> RTableRef a -> Bool
- data RTableName a = RTableName (FQTableName a) SchemaMember
- data RDropTableName a
- data RCreateTableName a = RCreateTableName (FQTableName a) Existence
- data RCreateSchemaName a = RCreateSchemaName (FQSchemaName a) Existence
- shrinkHashMap :: (Eq k, Hashable k) => forall v. HashMap k v -> [HashMap k v]
Documentation
type ColumnSet a = [(Maybe (RTableRef a), [RColumnRef a])] Source #
A ColumnSet records the table-bindings (if any) of columns.
Can be used to represent columns that are in ambient scope, which can be referenced, based on arcane and dialect specific rules. The fst component will be Nothing for collections of column aliases bound in a containing select statement (which thus have no corresponding Tablish), or for subqueries/lateral views with no table alias.
Can also be used to represent "what stars expand into".
Bindings | |
|
emptyBindings :: Bindings a Source #
data SelectScope a Source #
SelectScope | |
|
type FromColumns a = ColumnSet a Source #
type SelectionAliases a = [RColumnRef a] Source #
data ResolverInfo a Source #
ResolverInfo | |
|
mapBindings :: (Bindings a -> Bindings a) -> ResolverInfo a -> ResolverInfo a Source #
bindColumns :: MonadReader (ResolverInfo a) m => ColumnSet a -> m r -> m r Source #
bindFromColumns :: MonadReader (ResolverInfo a) m => FromColumns a -> m r -> m r Source #
bindAliasedColumns :: MonadReader (ResolverInfo a) m => SelectionAliases a -> m r -> m r Source #
bindBothColumns :: MonadReader (ResolverInfo a) m => FromColumns a -> SelectionAliases a -> m r -> m r Source #
Data RawNames Source # | |
Resolution RawNames Source # | |
type TableRef RawNames Source # | |
type TableName RawNames Source # | |
type CreateTableName RawNames Source # | |
type DropTableName RawNames Source # | |
type SchemaName RawNames Source # | |
type CreateSchemaName RawNames Source # | |
type ColumnRef RawNames Source # | |
type NaturalColumns RawNames Source # | |
type UsingColumn RawNames Source # | |
type StarReferents RawNames Source # | |
type PositionExpr RawNames Source # | |
type ComposedQueryColumns RawNames Source # | |
data ResolvedNames Source #
newtype StarColumnNames a Source #
Functor StarColumnNames Source # | |
Eq a => Eq (StarColumnNames a) Source # | |
Data a => Data (StarColumnNames a) Source # | |
Ord a => Ord (StarColumnNames a) Source # | |
Show a => Show (StarColumnNames a) Source # | |
Generic (StarColumnNames a) Source # | |
ToJSON a => ToJSON (StarColumnNames a) Source # | |
HasColumns (StarColumnNames a) Source # | |
type Rep (StarColumnNames a) Source # | |
newtype ColumnAliasList a Source #
Functor ColumnAliasList Source # | |
Eq a => Eq (ColumnAliasList a) Source # | |
Data a => Data (ColumnAliasList a) Source # | |
Ord a => Ord (ColumnAliasList a) Source # | |
Show a => Show (ColumnAliasList a) Source # | |
Generic (ColumnAliasList a) Source # | |
ToJSON a => ToJSON (ColumnAliasList a) Source # | |
type Rep (ColumnAliasList a) Source # | |
type Resolver r a = StateT Integer (ReaderT (ResolverInfo a) (CatalogObjectResolver a)) (r a) Source #
data SchemaMember Source #
SchemaMember | |
|
persistentTable :: [UQColumnName ()] -> SchemaMember Source #
type SchemaMap = HashMap (UQTableName ()) SchemaMember Source #
type DatabaseMap = HashMap (UQSchemaName ()) SchemaMap Source #
type CatalogMap = HashMap (DatabaseName ()) DatabaseMap Source #
type Path = [UQSchemaName ()] Source #
type CurrentDatabase = DatabaseName () Source #
type CatalogObjectResolver a = ExceptT (ResolutionError a) (Writer [Either (ResolutionError a) (ResolutionSuccess a)]) Source #
data ResolutionError a Source #
Functor ResolutionError Source # | |
Eq a => Eq (ResolutionError a) Source # | |
Show a => Show (ResolutionError a) Source # | |
HasSchemaChange (ResolutionError a) Source # | |
data ResolutionSuccess a Source #
TableNameResolved (OQTableName a) (RTableName a) | |
TableNameDefaulted (OQTableName a) (RTableName a) | |
CreateTableNameResolved (OQTableName a) (RCreateTableName a) | |
CreateSchemaNameResolved (OQSchemaName a) (RCreateSchemaName a) | |
TableRefResolved (OQTableName a) (RTableRef a) | |
TableRefDefaulted (OQTableName a) (RTableRef a) | |
ColumnRefResolved (OQColumnName a) (RColumnRef a) | |
ColumnRefDefaulted (OQColumnName a) (RColumnRef a) |
Functor ResolutionSuccess Source # | |
Eq a => Eq (ResolutionSuccess a) Source # | |
Show a => Show (ResolutionSuccess a) Source # | |
HasSchemaChange (ResolutionSuccess a) Source # | |
isGuess :: ResolutionSuccess a -> Bool Source #
isCertain :: ResolutionSuccess a -> Bool Source #
data WithColumns r a Source #
WithColumns | |
|
data WithColumnsAndOrders r a Source #
WithColumnsAndOrders (r a) (ColumnSet a) [Order ResolvedNames a] |
Functor RTableRef Source # | |
Foldable RTableRef Source # | |
Traversable RTableRef Source # | |
Eq a => Eq (RTableRef a) Source # | |
Data a => Data (RTableRef a) Source # | |
Ord a => Ord (RTableRef a) Source # | |
Show a => Show (RTableRef a) Source # | |
Generic (RTableRef a) Source # | |
ToJSON a => ToJSON (RTableRef a) Source # | |
Semigroup a => HasInfo (RTableRef a) Source # | |
type Rep (RTableRef a) Source # | |
type Info (RTableRef a) Source # | |
resolvedTableHasName :: QTableName f a -> RTableRef a -> Bool Source #
resolvedTableHasSchema :: QSchemaName f a -> RTableRef a -> Bool Source #
resolvedTableHasDatabase :: DatabaseName a -> RTableRef a -> Bool Source #
data RTableName a Source #
Functor RTableName Source # | |
Foldable RTableName Source # | |
Traversable RTableName Source # | |
Eq a => Eq (RTableName a) Source # | |
Data a => Data (RTableName a) Source # | |
Ord a => Ord (RTableName a) Source # | |
Show a => Show (RTableName a) Source # | |
Generic (RTableName a) Source # | |
ToJSON a => ToJSON (RTableName a) Source # | |
HasTables (RTableName a) Source # | |
Semigroup a => HasInfo (RTableName a) Source # | |
type Rep (RTableName a) Source # | |
type Info (RTableName a) Source # | |
data RDropTableName a Source #
Functor RDropTableName Source # | |
Foldable RDropTableName Source # | |
Traversable RDropTableName Source # | |
Eq a => Eq (RDropTableName a) Source # | |
Data a => Data (RDropTableName a) Source # | |
Ord a => Ord (RDropTableName a) Source # | |
Show a => Show (RDropTableName a) Source # | |
Generic (RDropTableName a) Source # | |
ToJSON a => ToJSON (RDropTableName a) Source # | |
type Rep (RDropTableName a) Source # | |
data RCreateTableName a Source #
Functor RCreateTableName Source # | |
Foldable RCreateTableName Source # | |
Traversable RCreateTableName Source # | |
Eq a => Eq (RCreateTableName a) Source # | |
Data a => Data (RCreateTableName a) Source # | |
Ord a => Ord (RCreateTableName a) Source # | |
Show a => Show (RCreateTableName a) Source # | |
Generic (RCreateTableName a) Source # | |
ToJSON a => ToJSON (RCreateTableName a) Source # | |
type Rep (RCreateTableName a) Source # | |
data RCreateSchemaName a Source #
Functor RCreateSchemaName Source # | |
Foldable RCreateSchemaName Source # | |
Traversable RCreateSchemaName Source # | |
Eq a => Eq (RCreateSchemaName a) Source # | |
Data a => Data (RCreateSchemaName a) Source # | |
Ord a => Ord (RCreateSchemaName a) Source # | |
Show a => Show (RCreateSchemaName a) Source # | |
Generic (RCreateSchemaName a) Source # | |
ToJSON a => ToJSON (RCreateSchemaName a) Source # | |
type Rep (RCreateSchemaName a) Source # | |