Safe Haskell | None |
---|---|
Language | Haskell2010 |
MSSQL Plan
Planning T-SQL queries and subscription by translating IR to MSSQL-specific SQL query types.
Synopsis
- planQuery :: MonadError QErr m => SessionVariables -> QueryDB 'MSSQL Void (UnpreparedValue 'MSSQL) -> m Select
- planSourceRelationship :: MonadError QErr m => SessionVariables -> NonEmpty Object -> HashMap FieldName (ColumnName, ScalarType) -> FieldName -> (FieldName, SourceRelationshipSelection 'MSSQL Void UnpreparedValue) -> m Select
- runIrWrappingRoot :: MonadError QErr m => FromIr Select -> m Select
- prepareValueQuery :: MonadError QErr m => SessionVariables -> UnpreparedValue 'MSSQL -> m Expression
- planSubscription :: MonadError QErr m => InsOrdHashMap Name (QueryDB 'MSSQL Void (UnpreparedValue 'MSSQL)) -> SessionVariables -> m (Reselect, PrepareState)
- collapseMap :: InsOrdHashMap Name Select -> Reselect
- data PrepareState = PrepareState {
- positionalArguments :: [ColumnValue 'MSSQL]
- namedArguments :: HashMap Name (ColumnValue 'MSSQL)
- sessionVariables :: HashSet SessionVariable
- emptyPrepareState :: PrepareState
- prepareValueSubscription :: (MonadState PrepareState m, MonadError QErr m) => HashSet SessionVariable -> UnpreparedValue 'MSSQL -> m Expression
- resultIdAlias :: Text
- resultVarsAlias :: Text
- resultAlias :: Text
- rowAlias :: Text
Documentation
planQuery :: MonadError QErr m => SessionVariables -> QueryDB 'MSSQL Void (UnpreparedValue 'MSSQL) -> m Select Source #
planSourceRelationship Source #
:: MonadError QErr m | |
=> SessionVariables | |
-> NonEmpty Object | List of json objects, each of which becomes a row of the table |
-> HashMap FieldName (ColumnName, ScalarType) | The above objects have this schema |
-> FieldName | |
-> (FieldName, SourceRelationshipSelection 'MSSQL Void UnpreparedValue) | |
-> m Select |
For more information, see the module/documentation of Source
.
runIrWrappingRoot :: MonadError QErr m => FromIr Select -> m Select Source #
prepareValueQuery :: MonadError QErr m => SessionVariables -> UnpreparedValue 'MSSQL -> m Expression Source #
Prepare a value without any query planning; we just execute the query with the values embedded.
planSubscription :: MonadError QErr m => InsOrdHashMap Name (QueryDB 'MSSQL Void (UnpreparedValue 'MSSQL)) -> SessionVariables -> m (Reselect, PrepareState) Source #
collapseMap :: InsOrdHashMap Name Select -> Reselect Source #
Collapse a set of selects into a single select that projects these as subselects.
data PrepareState Source #
PrepareState | |
|
prepareValueSubscription :: (MonadState PrepareState m, MonadError QErr m) => HashSet SessionVariable -> UnpreparedValue 'MSSQL -> m Expression Source #
Prepare a value for multiplexed queries.
resultIdAlias :: Text Source #
resultVarsAlias :: Text Source #
resultAlias :: Text Source #