Copyright | (c) digitally induced GmbH 2021 |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
IHP.DataSync.DynamicQuery
Contents
Description
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
Constructors
Field | |
Fields
|
data DynamicValue Source #
Constructors
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 Methods parseJSON :: Value -> Parser DynamicValue Source # parseJSONList :: Value -> Parser [DynamicValue] Source # | |
ToJSON DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery Methods toJSON :: DynamicValue -> Value Source # toEncoding :: DynamicValue -> Encoding Source # toJSONList :: [DynamicValue] -> Value Source # toEncodingList :: [DynamicValue] -> Encoding Source # omitField :: DynamicValue -> Bool Source # | |
Show DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery Methods showsPrec :: Int -> DynamicValue -> ShowS # show :: DynamicValue -> String # showList :: [DynamicValue] -> ShowS # | |
Eq DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery | |
FromField DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQuery Methods | |
ToField DynamicValue Source # | |
Defined in IHP.DataSync.DynamicQueryCompiler Methods toField :: DynamicValue -> Action Source # |
newtype UndecodedJSON Source #
Constructors
UndecodedJSON ByteString |
Instances
ToJSON UndecodedJSON Source # | |
Defined in IHP.DataSync.REST.Controller Methods toJSON :: UndecodedJSON -> Value Source # toEncoding :: UndecodedJSON -> Encoding Source # toJSONList :: [UndecodedJSON] -> Value Source # toEncodingList :: [UndecodedJSON] -> Encoding Source # omitField :: UndecodedJSON -> Bool Source # | |
Show UndecodedJSON Source # | |
Defined in IHP.DataSync.DynamicQuery Methods showsPrec :: Int -> UndecodedJSON -> ShowS # show :: UndecodedJSON -> String # showList :: [UndecodedJSON] -> ShowS # | |
Eq UndecodedJSON Source # | |
Defined in IHP.DataSync.DynamicQuery Methods (==) :: UndecodedJSON -> UndecodedJSON -> Bool # (/=) :: UndecodedJSON -> UndecodedJSON -> Bool # | |
FromField UndecodedJSON Source # | |
Defined in IHP.DataSync.DynamicQuery Methods |
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.
Constructors
DynamicSQLQuery | |
Fields
|
Instances
FromJSON DynamicSQLQuery Source # | |
Defined in IHP.DataSync.DynamicQuery Methods parseJSON :: Value -> Parser DynamicSQLQuery Source # parseJSONList :: Value -> Parser [DynamicSQLQuery] Source # | |
Show DynamicSQLQuery Source # | |
Defined in IHP.DataSync.DynamicQuery Methods showsPrec :: Int -> DynamicSQLQuery -> ShowS # show :: DynamicSQLQuery -> String # showList :: [DynamicSQLQuery] -> ShowS # | |
Eq DynamicSQLQuery Source # | |
Defined in IHP.DataSync.DynamicQuery Methods (==) :: DynamicSQLQuery -> DynamicSQLQuery -> Bool # (/=) :: DynamicSQLQuery -> DynamicSQLQuery -> Bool # |
data OrderByClause Source #
Constructors
OrderByClause | |
Fields | |
OrderByTSRank | |
Instances
data ConditionExpression Source #
Represents a WHERE conditions of a DynamicSQLQuery
Constructors
ColumnExpression | |
InfixOperatorExpression | |
Fields
| |
LiteralExpression | |
Fields
| |
CallExpression | |
Fields | |
ListExpression | |
Fields
|
Instances
FromJSON ConditionExpression Source # | |
Defined in IHP.DataSync.DynamicQuery Methods parseJSON :: Value -> Parser ConditionExpression Source # parseJSONList :: Value -> Parser [ConditionExpression] Source # | |
Show ConditionExpression Source # | |
Defined in IHP.DataSync.DynamicQuery Methods showsPrec :: Int -> ConditionExpression -> ShowS # show :: ConditionExpression -> String # showList :: [ConditionExpression] -> ShowS # | |
Eq ConditionExpression Source # | |
Defined in IHP.DataSync.DynamicQuery Methods (==) :: ConditionExpression -> ConditionExpression -> Bool # (/=) :: ConditionExpression -> ConditionExpression -> Bool # |
data FunctionCall Source #
Instances
FromJSON FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery Methods parseJSON :: Value -> Parser FunctionCall Source # parseJSONList :: Value -> Parser [FunctionCall] Source # | |||||
Generic FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery Associated Types
| |||||
Show FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery Methods showsPrec :: Int -> FunctionCall -> ShowS # show :: FunctionCall -> String # showList :: [FunctionCall] -> ShowS # | |||||
NFData FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery Methods rnf :: FunctionCall -> () # | |||||
Eq FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery | |||||
type Rep FunctionCall Source # | |||||
Defined in IHP.DataSync.DynamicQuery type Rep FunctionCall = D1 ('MetaData "FunctionCall" "IHP.DataSync.DynamicQuery" "ihp-1.3.0-2ylG2KCt2mR26AiTNFcRYf" 'False) (C1 ('MetaCons "ToTSQuery" 'PrefixI 'True) (S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) |
data ConditionOperator Source #
Operators available in WHERE conditions
Constructors
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 Methods parseJSON :: Value -> Parser ConditionOperator Source # parseJSONList :: Value -> Parser [ConditionOperator] Source # | |
Show ConditionOperator Source # | |
Defined in IHP.DataSync.DynamicQuery Methods showsPrec :: Int -> ConditionOperator -> ShowS # show :: ConditionOperator -> String # showList :: [ConditionOperator] -> ShowS # | |
Eq ConditionOperator Source # | |
Defined in IHP.DataSync.DynamicQuery Methods (==) :: ConditionOperator -> ConditionOperator -> Bool # (/=) :: ConditionOperator -> ConditionOperator -> Bool # |
data SelectedColumns Source #
Constructors
SelectAll | SELECT * FROM table |
SelectSpecific [Text] | SELECT a, b, c FROM table |
Instances
FromJSON SelectedColumns Source # | |
Defined in IHP.DataSync.DynamicQuery Methods parseJSON :: Value -> Parser SelectedColumns Source # parseJSONList :: Value -> Parser [SelectedColumns] Source # | |
Show SelectedColumns Source # | |
Defined in IHP.DataSync.DynamicQuery Methods showsPrec :: Int -> SelectedColumns -> ShowS # show :: SelectedColumns -> String # showList :: [SelectedColumns] -> ShowS # | |
Eq SelectedColumns Source # | |
Defined in IHP.DataSync.DynamicQuery Methods (==) :: SelectedColumns -> SelectedColumns -> Bool # (/=) :: SelectedColumns -> SelectedColumns -> Bool # | |
ParamReader SelectedColumns Source # | |
Defined in IHP.DataSync.REST.Controller Methods readParameter :: ByteString -> Either ByteString SelectedColumns Source # readParameterJSON :: Value -> Either ByteString 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 # | |
Methods parseJSON :: Value -> Parser ByteString Source # parseJSONList :: Value -> Parser [ByteString] Source # | |
FromJSON Condition Source # | |
FromJSON Join Source # | |
FromJSON OrderByClause Source # | |
Methods parseJSON :: Value -> Parser OrderByClause Source # parseJSONList :: Value -> Parser [OrderByClause] Source # | |
FromJSON OrderByDirection Source # | |
Methods parseJSON :: Value -> Parser OrderByDirection Source # parseJSONList :: Value -> Parser [OrderByDirection] Source # | |
FromJSON Action Source # | |