Copyright | (c) digitally induced GmbH 2021 |
---|---|
Safe Haskell | None |
Synopsis
- data Field = Field {}
- data DynamicValue
- = IntValue !Int
- | DoubleValue !Double
- | TextValue !Text
- | BoolValue !Bool
- | UUIDValue !UUID
- | DateTimeValue !UTCTime
- | PointValue !Point
- | IntervalValue !PGInterval
- | ArrayValue ![DynamicValue]
- | Null
- newtype UndecodedJSON = UndecodedJSON ByteString
- data DynamicSQLQuery = DynamicSQLQuery {
- table :: !Text
- selectedColumns :: SelectedColumns
- whereCondition :: !(Maybe ConditionExpression)
- orderByClause :: ![OrderByClause]
- distinctOnColumn :: !(Maybe ByteString)
- limit :: !(Maybe Int)
- offset :: !(Maybe Int)
- data OrderByClause
- = OrderByClause { }
- | OrderByTSRank { }
- data ConditionExpression
- = ColumnExpression { }
- | InfixOperatorExpression { }
- | LiteralExpression {
- value :: !DynamicValue
- | CallExpression { }
- | ListExpression {
- values :: ![DynamicValue]
- data FunctionCall = ToTSQuery {}
- data ConditionOperator
- data SelectedColumns
- = SelectAll
- | SelectSpecific [Text]
- recordIds :: [[Field]] -> [UUID]
- transformColumnNamesToFieldNames :: Value -> Value
Documentation
Field | |
|
data DynamicValue Source #
IntValue !Int | |
DoubleValue !Double | |
TextValue !Text | |
BoolValue !Bool | |
UUIDValue !UUID | |
DateTimeValue !UTCTime | |
PointValue !Point | |
IntervalValue !PGInterval | |
ArrayValue ![DynamicValue] | |
Null |
Instances
FromJSON DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery parseJSON :: Value -> Parser DynamicValue # parseJSONList :: Value -> Parser [DynamicValue] # | |
ToJSON DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery toJSON :: DynamicValue -> Value # toEncoding :: DynamicValue -> Encoding # toJSONList :: [DynamicValue] -> Value # toEncodingList :: [DynamicValue] -> Encoding # omitField :: DynamicValue -> Bool # | |
Show DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> DynamicValue -> ShowS # show :: DynamicValue -> String showList :: [DynamicValue] -> ShowS # | |
Eq DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery (==) :: DynamicValue -> DynamicValue -> Bool # (/=) :: DynamicValue -> DynamicValue -> Bool # | |
FromField DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery fromField :: FieldParser DynamicValue | |
ToField DynamicValue | |
Defined in IHP.DataSync.DynamicQueryCompiler toField :: DynamicValue -> Action |
newtype UndecodedJSON Source #
Instances
ToJSON UndecodedJSON Source # | |
Defined in IHP.DataSync.REST.Controller toJSON :: UndecodedJSON -> Value # toEncoding :: UndecodedJSON -> Encoding # toJSONList :: [UndecodedJSON] -> Value # toEncodingList :: [UndecodedJSON] -> Encoding # omitField :: UndecodedJSON -> Bool # | |
Show UndecodedJSON Source # | |
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> UndecodedJSON -> ShowS # show :: UndecodedJSON -> String showList :: [UndecodedJSON] -> ShowS # | |
Eq UndecodedJSON Source # | |
Defined in IHP.DataSync.DynamicQuery (==) :: UndecodedJSON -> UndecodedJSON -> Bool # (/=) :: UndecodedJSON -> UndecodedJSON -> Bool # | |
FromField UndecodedJSON Source # | |
Defined in IHP.DataSync.DynamicQuery fromField :: FieldParser UndecodedJSON |
data DynamicSQLQuery Source #
Similiar to IHP.QueryBuilder.SQLQuery, but is designed to be accessed by external users
When compiling to SQL we have to be extra careful to escape all identifers and variables in the query. The normal IHP.QueryBuilder doesn't need to be that careful as parts of the input are derived from generated code from the Schema.sql.
DynamicSQLQuery | |
|
Instances
FromJSON DynamicSQLQuery Source # | |
Defined in IHP.DataSync.DynamicQuery parseJSON :: Value -> Parser DynamicSQLQuery # parseJSONList :: Value -> Parser [DynamicSQLQuery] # | |
Show DynamicSQLQuery Source # | |
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> DynamicSQLQuery -> ShowS # show :: DynamicSQLQuery -> String showList :: [DynamicSQLQuery] -> ShowS # | |
Eq DynamicSQLQuery Source # | |
Defined in IHP.DataSync.DynamicQuery (==) :: DynamicSQLQuery -> DynamicSQLQuery -> Bool # (/=) :: DynamicSQLQuery -> DynamicSQLQuery -> Bool # |
data OrderByClause Source #
Instances
FromJSON OrderByClause Source # | |||||
Defined in IHP.DataSync.DynamicQuery parseJSON :: Value -> Parser OrderByClause # parseJSONList :: Value -> Parser [OrderByClause] # | |||||
Generic OrderByClause Source # | |||||
Defined in IHP.DataSync.DynamicQuery
from :: OrderByClause -> Rep OrderByClause x to :: Rep OrderByClause x -> OrderByClause | |||||
Show OrderByClause Source # | |||||
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> OrderByClause -> ShowS # show :: OrderByClause -> String showList :: [OrderByClause] -> ShowS # | |||||
NFData OrderByClause Source # | |||||
Defined in IHP.DataSync.DynamicQuery rnf :: OrderByClause -> () # | |||||
Eq OrderByClause Source # | |||||
Defined in IHP.DataSync.DynamicQuery (==) :: OrderByClause -> OrderByClause -> Bool # (/=) :: OrderByClause -> OrderByClause -> Bool # | |||||
ParamReader OrderByClause Source # | |||||
type Rep OrderByClause Source # | |||||
Defined in IHP.DataSync.DynamicQuery type Rep OrderByClause = D1 ('MetaData "OrderByClause" "IHP.DataSync.DynamicQuery" "main" 'False) (C1 ('MetaCons "OrderByClause" 'PrefixI 'True) (S1 ('MetaSel ('Just "orderByColumn") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "orderByDirection") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OrderByDirection)) :+: C1 ('MetaCons "OrderByTSRank" 'PrefixI 'True) (S1 ('MetaSel ('Just "tsvector") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "tsquery") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) |
data ConditionExpression Source #
Represents a WHERE conditions of a DynamicSQLQuery
Instances
FromJSON ConditionExpression Source # | |
Defined in IHP.DataSync.DynamicQuery parseJSON :: Value -> Parser ConditionExpression # parseJSONList :: Value -> Parser [ConditionExpression] # | |
Show ConditionExpression Source # | |
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> ConditionExpression -> ShowS # show :: ConditionExpression -> String showList :: [ConditionExpression] -> ShowS # | |
Eq ConditionExpression Source # | |
Defined in IHP.DataSync.DynamicQuery (==) :: ConditionExpression -> ConditionExpression -> Bool # (/=) :: ConditionExpression -> ConditionExpression -> Bool # |
data FunctionCall Source #
Instances
FromJSON FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery parseJSON :: Value -> Parser FunctionCall # parseJSONList :: Value -> Parser [FunctionCall] # | |||||
Generic FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery
from :: FunctionCall -> Rep FunctionCall x to :: Rep FunctionCall x -> FunctionCall | |||||
Show FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> FunctionCall -> ShowS # show :: FunctionCall -> String showList :: [FunctionCall] -> ShowS # | |||||
NFData FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery rnf :: FunctionCall -> () # | |||||
Eq FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery (==) :: FunctionCall -> FunctionCall -> Bool # (/=) :: FunctionCall -> FunctionCall -> Bool # | |||||
type Rep FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery type Rep FunctionCall = D1 ('MetaData "FunctionCall" "IHP.DataSync.DynamicQuery" "main" 'False) (C1 ('MetaCons "ToTSQuery" 'PrefixI 'True) (S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) |
data ConditionOperator Source #
Operators available in WHERE conditions
OpEqual | a = b |
OpGreaterThan | a > b |
OpLessThan | a < b |
OpGreaterThanOrEqual | a >= b |
OpLessThanOrEqual | a <= b |
OpNotEqual | a <> b |
OpAnd | a AND b |
OpOr | a OR b |
OpIs | a IS b |
OpIsNot | a IS NOT b |
OpTSMatch | tsvec_a @@ tsvec_b |
OpIn | a IN b |
Instances
FromJSON ConditionOperator Source # | |
Defined in IHP.DataSync.DynamicQuery parseJSON :: Value -> Parser ConditionOperator # parseJSONList :: Value -> Parser [ConditionOperator] # | |
Show ConditionOperator Source # | |
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> ConditionOperator -> ShowS # show :: ConditionOperator -> String showList :: [ConditionOperator] -> ShowS # | |
Eq ConditionOperator Source # | |
Defined in IHP.DataSync.DynamicQuery (==) :: ConditionOperator -> ConditionOperator -> Bool # (/=) :: ConditionOperator -> ConditionOperator -> Bool # |
data SelectedColumns Source #
SelectAll | SELECT * FROM table |
SelectSpecific [Text] | SELECT a, b, c FROM table |
Instances
FromJSON SelectedColumns Source # | |
Defined in IHP.DataSync.DynamicQuery parseJSON :: Value -> Parser SelectedColumns # parseJSONList :: Value -> Parser [SelectedColumns] # | |
Show SelectedColumns Source # | |
Defined in IHP.DataSync.DynamicQuery showsPrec :: Int -> SelectedColumns -> ShowS # show :: SelectedColumns -> String showList :: [SelectedColumns] -> ShowS # | |
Eq SelectedColumns Source # | |
Defined in IHP.DataSync.DynamicQuery (==) :: SelectedColumns -> SelectedColumns -> Bool # (/=) :: SelectedColumns -> SelectedColumns -> Bool # | |
ParamReader SelectedColumns Source # | |
transformColumnNamesToFieldNames :: Value -> Value Source #
Transforms the keys of a JSON object from field name to column name
>>>
transformColumnNamesToFieldNames [json|{"isCompleted": true}|]
[json|{"is_completed": true}|]
Orphan instances
FromJSON ByteString Source # | |
parseJSON :: Value -> Parser ByteString # parseJSONList :: Value -> Parser [ByteString] # | |
FromJSON Condition Source # | |
FromJSON Join Source # | |
FromJSON OrderByClause Source # | |
parseJSON :: Value -> Parser OrderByClause # parseJSONList :: Value -> Parser [OrderByClause] # | |
FromJSON OrderByDirection Source # | |
parseJSON :: Value -> Parser OrderByDirection # parseJSONList :: Value -> Parser [OrderByDirection] # | |
FromJSON Action Source # | |
parseJSON :: Value -> Parser Action # parseJSONList :: Value -> Parser [Action] # omittedField :: Maybe Action # |