-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Connection layer between beam and postgres -- -- Beam driver for PostgreSQL, an advanced open-source RDBMS @package beam-postgres @version 0.3.2.2 -- | Data types for Postgres syntax. Access is given mainly for extension -- modules. The types and definitions here are likely to change. module Database.Beam.Postgres.Syntax data PgSyntaxF f [EmitByteString] :: ByteString -> f -> PgSyntaxF f [EmitBuilder] :: Builder -> f -> PgSyntaxF f [EscapeString] :: ByteString -> f -> PgSyntaxF f [EscapeBytea] :: ByteString -> f -> PgSyntaxF f [EscapeIdentifier] :: ByteString -> f -> PgSyntaxF f type PgSyntaxM = F PgSyntaxF -- | A piece of Postgres SQL syntax, which may contain embedded escaped -- byte and text sequences. PgSyntax composes monoidally, and may -- be created with emit, emitBuilder, escapeString, -- escapBytea, and escapeIdentifier. newtype PgSyntax PgSyntax :: PgSyntaxM () -> PgSyntax [buildPgSyntax] :: PgSyntax -> PgSyntaxM () emit :: ByteString -> PgSyntax emitBuilder :: Builder -> PgSyntax escapeString :: ByteString -> PgSyntax escapeBytea :: ByteString -> PgSyntax escapeIdentifier :: ByteString -> PgSyntax pgParens :: PgSyntax -> PgSyntax nextSyntaxStep :: PgSyntaxF f -> f -- | Representation of an arbitrary Postgres command. This is the -- combination of the command syntax (repesented by PgSyntax), as -- well as the type of command (represented by PgCommandType). The -- command type is necessary for us to know how to retrieve results from -- the database. data PgCommandSyntax PgCommandSyntax :: PgCommandType -> PgSyntax -> PgCommandSyntax [pgCommandType] :: PgCommandSyntax -> PgCommandType [fromPgCommand] :: PgCommandSyntax -> PgSyntax data PgCommandType PgCommandTypeQuery :: PgCommandType PgCommandTypeDdl :: PgCommandType PgCommandTypeDataUpdate :: PgCommandType PgCommandTypeDataUpdateReturning :: PgCommandType -- | IsSql92SelectSyntax for Postgres newtype PgSelectSyntax PgSelectSyntax :: PgSyntax -> PgSelectSyntax [fromPgSelect] :: PgSelectSyntax -> PgSyntax newtype PgSelectSetQuantifierSyntax PgSelectSetQuantifierSyntax :: PgSyntax -> PgSelectSetQuantifierSyntax [fromPgSelectSetQuantifier] :: PgSelectSetQuantifierSyntax -> PgSyntax -- | IsSql92InsertSyntax for Postgres newtype PgInsertSyntax PgInsertSyntax :: PgSyntax -> PgInsertSyntax [fromPgInsert] :: PgInsertSyntax -> PgSyntax -- | IsSql92DeleteSyntax for Postgres newtype PgDeleteSyntax PgDeleteSyntax :: PgSyntax -> PgDeleteSyntax [fromPgDelete] :: PgDeleteSyntax -> PgSyntax -- | IsSql92UpdateSyntax for Postgres newtype PgUpdateSyntax PgUpdateSyntax :: PgSyntax -> PgUpdateSyntax [fromPgUpdate] :: PgUpdateSyntax -> PgSyntax newtype PgExpressionSyntax PgExpressionSyntax :: PgSyntax -> PgExpressionSyntax [fromPgExpression] :: PgExpressionSyntax -> PgSyntax newtype PgFromSyntax PgFromSyntax :: PgSyntax -> PgFromSyntax [fromPgFrom] :: PgFromSyntax -> PgSyntax newtype PgComparisonQuantifierSyntax PgComparisonQuantifierSyntax :: PgSyntax -> PgComparisonQuantifierSyntax [fromPgComparisonQuantifier] :: PgComparisonQuantifierSyntax -> PgSyntax newtype PgExtractFieldSyntax PgExtractFieldSyntax :: PgSyntax -> PgExtractFieldSyntax [fromPgExtractField] :: PgExtractFieldSyntax -> PgSyntax newtype PgProjectionSyntax PgProjectionSyntax :: PgSyntax -> PgProjectionSyntax [fromPgProjection] :: PgProjectionSyntax -> PgSyntax newtype PgGroupingSyntax PgGroupingSyntax :: PgSyntax -> PgGroupingSyntax [fromPgGrouping] :: PgGroupingSyntax -> PgSyntax data PgOrderingSyntax PgOrderingSyntax :: PgSyntax -> Maybe PgNullOrdering -> PgOrderingSyntax [pgOrderingSyntax] :: PgOrderingSyntax -> PgSyntax [pgOrderingNullOrdering] :: PgOrderingSyntax -> Maybe PgNullOrdering newtype PgValueSyntax PgValueSyntax :: PgSyntax -> PgValueSyntax [fromPgValue] :: PgValueSyntax -> PgSyntax newtype PgTableSourceSyntax PgTableSourceSyntax :: PgSyntax -> PgTableSourceSyntax [fromPgTableSource] :: PgTableSourceSyntax -> PgSyntax newtype PgFieldNameSyntax PgFieldNameSyntax :: PgSyntax -> PgFieldNameSyntax [fromPgFieldName] :: PgFieldNameSyntax -> PgSyntax newtype PgAggregationSetQuantifierSyntax PgAggregationSetQuantifierSyntax :: PgSyntax -> PgAggregationSetQuantifierSyntax [fromPgAggregationSetQuantifier] :: PgAggregationSetQuantifierSyntax -> PgSyntax newtype PgInsertValuesSyntax PgInsertValuesSyntax :: PgSyntax -> PgInsertValuesSyntax [fromPgInsertValues] :: PgInsertValuesSyntax -> PgSyntax newtype PgInsertOnConflictSyntax PgInsertOnConflictSyntax :: PgSyntax -> PgInsertOnConflictSyntax [fromPgInsertOnConflict] :: PgInsertOnConflictSyntax -> PgSyntax newtype PgInsertOnConflictTargetSyntax PgInsertOnConflictTargetSyntax :: PgSyntax -> PgInsertOnConflictTargetSyntax [fromPgInsertOnConflictTarget] :: PgInsertOnConflictTargetSyntax -> PgSyntax newtype PgConflictActionSyntax PgConflictActionSyntax :: PgSyntax -> PgConflictActionSyntax [fromPgConflictAction] :: PgConflictActionSyntax -> PgSyntax newtype PgCreateTableSyntax PgCreateTableSyntax :: PgSyntax -> PgCreateTableSyntax [fromPgCreateTable] :: PgCreateTableSyntax -> PgSyntax data PgTableOptionsSyntax PgTableOptionsSyntax :: PgSyntax -> PgSyntax -> PgTableOptionsSyntax newtype PgColumnSchemaSyntax PgColumnSchemaSyntax :: PgSyntax -> PgColumnSchemaSyntax [fromPgColumnSchema] :: PgColumnSchemaSyntax -> PgSyntax data PgDataTypeSyntax PgDataTypeSyntax :: PgDataTypeDescr -> PgSyntax -> BeamSerializedDataType -> PgDataTypeSyntax [pgDataTypeDescr] :: PgDataTypeSyntax -> PgDataTypeDescr [fromPgDataType] :: PgDataTypeSyntax -> PgSyntax [pgDataTypeSerialized] :: PgDataTypeSyntax -> BeamSerializedDataType data PgColumnConstraintDefinitionSyntax PgColumnConstraintDefinitionSyntax :: PgSyntax -> BeamSerializedConstraintDefinition -> PgColumnConstraintDefinitionSyntax [fromPgColumnConstraintDefinition] :: PgColumnConstraintDefinitionSyntax -> PgSyntax [pgColumnConstraintDefinitionSerialized] :: PgColumnConstraintDefinitionSyntax -> BeamSerializedConstraintDefinition data PgColumnConstraintSyntax PgColumnConstraintSyntax :: PgSyntax -> BeamSerializedConstraint -> PgColumnConstraintSyntax [fromPgColumnConstraint] :: PgColumnConstraintSyntax -> PgSyntax [pgColumnConstraintSerialized] :: PgColumnConstraintSyntax -> BeamSerializedConstraint newtype PgTableConstraintSyntax PgTableConstraintSyntax :: PgSyntax -> PgTableConstraintSyntax [fromPgTableConstraint] :: PgTableConstraintSyntax -> PgSyntax data PgMatchTypeSyntax PgMatchTypeSyntax :: PgSyntax -> BeamSerializedMatchType -> PgMatchTypeSyntax [fromPgMatchType] :: PgMatchTypeSyntax -> PgSyntax [pgMatchTypeSerialized] :: PgMatchTypeSyntax -> BeamSerializedMatchType data PgReferentialActionSyntax PgReferentialActionSyntax :: PgSyntax -> BeamSerializedReferentialAction -> PgReferentialActionSyntax [fromPgReferentialAction] :: PgReferentialActionSyntax -> PgSyntax [pgReferentialActionSerialized] :: PgReferentialActionSyntax -> BeamSerializedReferentialAction newtype PgAlterTableSyntax PgAlterTableSyntax :: PgSyntax -> PgAlterTableSyntax [fromPgAlterTable] :: PgAlterTableSyntax -> PgSyntax newtype PgAlterTableActionSyntax PgAlterTableActionSyntax :: PgSyntax -> PgAlterTableActionSyntax [fromPgAlterTableAction] :: PgAlterTableActionSyntax -> PgSyntax newtype PgAlterColumnActionSyntax PgAlterColumnActionSyntax :: PgSyntax -> PgAlterColumnActionSyntax [fromPgAlterColumnAction] :: PgAlterColumnActionSyntax -> PgSyntax newtype PgWindowFrameSyntax PgWindowFrameSyntax :: PgSyntax -> PgWindowFrameSyntax [fromPgWindowFrame] :: PgWindowFrameSyntax -> PgSyntax newtype PgWindowFrameBoundsSyntax PgWindowFrameBoundsSyntax :: PgSyntax -> PgWindowFrameBoundsSyntax [fromPgWindowFrameBounds] :: PgWindowFrameBoundsSyntax -> PgSyntax newtype PgWindowFrameBoundSyntax PgWindowFrameBoundSyntax :: ByteString -> PgSyntax -> PgWindowFrameBoundSyntax [fromPgWindowFrameBound] :: PgWindowFrameBoundSyntax -> ByteString -> PgSyntax data PgSelectLockingClauseSyntax PgSelectLockingClauseSyntax :: PgSelectLockingStrength -> [Text] -> Maybe PgSelectLockingOptions -> PgSelectLockingClauseSyntax [pgSelectLockingClauseStrength] :: PgSelectLockingClauseSyntax -> PgSelectLockingStrength [pgSelectLockingTables] :: PgSelectLockingClauseSyntax -> [Text] [pgSelectLockingClauseOptions] :: PgSelectLockingClauseSyntax -> Maybe PgSelectLockingOptions -- | Specifies the level of lock that will be taken against a row. See -- the manual section for more information. data PgSelectLockingStrength -- |
--   UPDATE
--   
PgSelectLockingStrengthUpdate :: PgSelectLockingStrength -- |
--   NO KEY UPDATE
--   
PgSelectLockingStrengthNoKeyUpdate :: PgSelectLockingStrength -- |
--   SHARE
--   
PgSelectLockingStrengthShare :: PgSelectLockingStrength -- |
--   KEY SHARE
--   
PgSelectLockingStrengthKeyShare :: PgSelectLockingStrength -- | Specifies how we should handle lock conflicts. -- -- See the manual section for more information data PgSelectLockingOptions -- | NOWAIT. Report an error rather than waiting for the lock PgSelectLockingOptionsNoWait :: PgSelectLockingOptions -- | SKIP LOCKED. Rather than wait for a lock, skip the row -- instead PgSelectLockingOptionsSkipLocked :: PgSelectLockingOptions fromPgSelectLockingClause :: PgSelectLockingClauseSyntax -> PgSyntax pgSelectStmt :: PgSelectTableSyntax -> [PgOrderingSyntax] -> Maybe Integer -> Maybe Integer -> Maybe PgSelectLockingClauseSyntax -> PgSelectSyntax data PgDataTypeDescr PgDataTypeDescrOid :: Oid -> (Maybe Int32) -> PgDataTypeDescr PgDataTypeDescrDomain :: Text -> PgDataTypeDescr pgCreateExtensionSyntax :: Text -> PgCommandSyntax pgDropExtensionSyntax :: Text -> PgCommandSyntax insertDefaults :: SqlInsertValues PgInsertValuesSyntax tbl pgSimpleMatchSyntax :: PgMatchTypeSyntax pgSelectSetQuantifierDistinctOn :: [PgExpressionSyntax] -> PgSelectSetQuantifierSyntax pgDataTypeJSON :: Value -> BeamSerializedDataType pgTsQueryType :: PgDataTypeSyntax pgTsVectorType :: PgDataTypeSyntax pgJsonType :: PgDataTypeSyntax pgJsonbType :: PgDataTypeSyntax pgUuidType :: PgDataTypeSyntax pgMoneyType :: PgDataTypeSyntax pgTsQueryTypeInfo :: TypeInfo -- | Postgres TypeInfo for tsvector TODO Is the Oid stable from postgres -- instance to postgres instance? pgTsVectorTypeInfo :: TypeInfo pgByteaType :: PgDataTypeSyntax pgTextType :: PgDataTypeSyntax pgUnboundedArrayType :: PgDataTypeSyntax -> PgDataTypeSyntax pgSerialType :: PgDataTypeSyntax pgSmallSerialType :: PgDataTypeSyntax pgBigSerialType :: PgDataTypeSyntax pgQuotedIdentifier :: Text -> PgSyntax pgSepBy :: PgSyntax -> [PgSyntax] -> PgSyntax pgDebugRenderSyntax :: PgSyntax -> IO () pgRenderSyntaxScript :: PgSyntax -> ByteString pgBuildAction :: [Action] -> PgSyntax pgBinOp :: ByteString -> PgExpressionSyntax -> PgExpressionSyntax -> PgExpressionSyntax pgCompOp :: ByteString -> Maybe PgComparisonQuantifierSyntax -> PgExpressionSyntax -> PgExpressionSyntax -> PgExpressionSyntax pgUnOp :: ByteString -> PgExpressionSyntax -> PgExpressionSyntax pgPostFix :: ByteString -> PgExpressionSyntax -> PgExpressionSyntax pgTestSyntax :: PgSyntax -> [PgSyntaxPrim] data PostgresInaccessible instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgSyntaxPrim instance GHC.Enum.Bounded Database.Beam.Postgres.Syntax.PgEscapeType instance GHC.Enum.Enum Database.Beam.Postgres.Syntax.PgEscapeType instance GHC.Classes.Ord Database.Beam.Postgres.Syntax.PgEscapeType instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgEscapeType instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgEscapeType instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgColumnConstraintDefinitionSyntax instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax instance GHC.Generics.Generic Database.Beam.Postgres.Syntax.PgDataTypeDescr instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgDataTypeDescr instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgDataTypeDescr instance GHC.Generics.Generic Database.Beam.Postgres.Syntax.PgSelectLockingOptions instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgSelectLockingOptions instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgSelectLockingOptions instance GHC.Generics.Generic Database.Beam.Postgres.Syntax.PgSelectLockingStrength instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgSelectLockingStrength instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgSelectLockingStrength instance GHC.Generics.Generic Database.Beam.Postgres.Syntax.PgNullOrdering instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgNullOrdering instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgNullOrdering instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgExpressionSyntax instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgCommandType instance GHC.Base.Semigroup (Database.Beam.Query.CustomSQL.CustomSqlSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax) instance GHC.Base.Monoid (Database.Beam.Query.CustomSQL.CustomSqlSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax) instance GHC.Base.Functor Database.Beam.Postgres.Syntax.PgSyntaxF instance Data.String.IsString Database.Beam.Postgres.Syntax.PgSyntaxPrim instance Database.Beam.Backend.SQL.SQL2003.IsSql2003WindowFrameBoundsSyntax Database.Beam.Postgres.Syntax.PgWindowFrameBoundsSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003WindowFrameBoundSyntax Database.Beam.Postgres.Syntax.PgWindowFrameBoundSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003WindowFrameSyntax Database.Beam.Postgres.Syntax.PgWindowFrameSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003ExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92AlterTableActionSyntax Database.Beam.Postgres.Syntax.PgAlterTableActionSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92AlterColumnActionSyntax Database.Beam.Postgres.Syntax.PgAlterColumnActionSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92AlterTableSyntax Database.Beam.Postgres.Syntax.PgAlterTableSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92DdlCommandSyntax Database.Beam.Postgres.Syntax.PgCommandSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92DropTableSyntax Database.Beam.Postgres.Syntax.PgDropTableSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92ReferentialActionSyntax Database.Beam.Postgres.Syntax.PgReferentialActionSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92ColumnConstraintSyntax Database.Beam.Postgres.Syntax.PgColumnConstraintSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92MatchTypeSyntax Database.Beam.Postgres.Syntax.PgMatchTypeSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92CreateTableSyntax Database.Beam.Postgres.Syntax.PgCreateTableSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92TableConstraintSyntax Database.Beam.Postgres.Syntax.PgTableConstraintSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92ColumnConstraintDefinitionSyntax Database.Beam.Postgres.Syntax.PgColumnConstraintDefinitionSyntax instance Database.Beam.Migrate.SQL.SQL92.Sql92DisplaySyntax Database.Beam.Postgres.Syntax.PgColumnConstraintDefinitionSyntax instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgColumnConstraintDefinitionSyntax instance Database.Beam.Migrate.SQL.SQL92.IsSql92ColumnSchemaSyntax Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax instance Data.Hashable.Class.Hashable Database.Beam.Postgres.Syntax.PgColumnConstraintDefinitionSyntax instance Database.Beam.Migrate.SQL.SQL92.Sql92SerializableConstraintDefinitionSyntax Database.Beam.Postgres.Syntax.PgColumnConstraintDefinitionSyntax instance Database.Beam.Migrate.SQL.SQL92.Sql92DisplaySyntax Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance Data.Hashable.Class.Hashable Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92DataTypeSyntax Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance Database.Beam.Backend.SQL.SQL99.IsSql99DataTypeSyntax Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2008BigIntDataTypeSyntax Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance Database.Beam.Migrate.SQL.SQL92.Sql92SerializableDataTypeSyntax Database.Beam.Postgres.Syntax.PgDataTypeSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92ExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataType Database.Beam.Postgres.Syntax.PgDataTypeSyntax Data.ByteString.Internal.ByteString instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataType Database.Beam.Postgres.Syntax.PgDataTypeSyntax Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataType Database.Beam.Postgres.Syntax.PgDataTypeSyntax (Database.Beam.Backend.SQL.Types.SqlSerial GHC.Types.Int) instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataType Database.Beam.Postgres.Syntax.PgDataTypeSyntax Data.UUID.Types.Internal.UUID instance Database.Beam.Migrate.SQL.SQL92.Sql92DisplaySyntax Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax instance Data.Hashable.Class.Hashable Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataTypeConstraints Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax Data.ByteString.Internal.ByteString instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataTypeConstraints Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataTypeConstraints Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax (Database.Beam.Backend.SQL.Types.SqlSerial GHC.Types.Int) instance Database.Beam.Migrate.Generics.Tables.HasDefaultSqlDataTypeConstraints Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax Data.UUID.Types.Internal.UUID instance Data.Hashable.Class.Hashable Database.Beam.Postgres.Syntax.PgDataTypeDescr instance Database.Beam.Backend.SQL.SQL92.IsSql92SelectSyntax Database.Beam.Postgres.Syntax.PgSelectSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92OrderingSyntax Database.Beam.Postgres.Syntax.PgOrderingSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003OrderingElementaryOLAPOperationsSyntax Database.Beam.Postgres.Syntax.PgOrderingSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92InsertSyntax Database.Beam.Postgres.Syntax.PgInsertSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92InsertValuesSyntax Database.Beam.Postgres.Syntax.PgInsertValuesSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92UpdateSyntax Database.Beam.Postgres.Syntax.PgUpdateSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92FieldNameSyntax Database.Beam.Postgres.Syntax.PgFieldNameSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92FromSyntax Database.Beam.Postgres.Syntax.PgFromSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92TableSourceSyntax Database.Beam.Postgres.Syntax.PgTableSourceSyntax instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Types.Bool instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Types.Double instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Types.Float instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Types.Int instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Int.Int8 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Int.Int16 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Int.Int32 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Int.Int64 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Integer.Type.Integer instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Types.Word instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Word.Word8 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Word.Word16 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Word.Word32 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax GHC.Word.Word64 instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Text.Internal.Text instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Text.Internal.Lazy.Text instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Time.Clock.Internal.UTCTime.UTCTime instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Aeson.Types.Internal.Value instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.LibPQ.Oid instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Time.LocalTime.Internal.ZonedTime.ZonedTime instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Time.Calendar.Days.Day instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.UUID.Types.Internal.UUID instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax [GHC.Types.Char] instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.Simple.HStore.Implementation.HStoreMap instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.Simple.HStore.Implementation.HStoreList instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.Simple.HStore.Implementation.HStoreBuilder instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.Simple.Time.Implementation.Date instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.Simple.Time.Implementation.ZonedTimestamp instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.Simple.Time.Implementation.LocalTimestamp instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.PostgreSQL.Simple.Time.Implementation.UTCTimestamp instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.Scientific.Scientific instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Text) instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Lazy.Text) instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Database.Beam.Backend.SQL.Types.SqlNull instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax x => Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax (GHC.Base.Maybe x) instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.ByteString.Internal.ByteString instance Database.Beam.Backend.SQL.SQL92.HasSqlValueSyntax Database.Beam.Postgres.Syntax.PgValueSyntax Data.ByteString.Lazy.Internal.ByteString instance Database.Beam.Backend.SQL.SQL92.IsSql92SelectTableSyntax Database.Beam.Postgres.Syntax.PgSelectTableSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92GroupingSyntax Database.Beam.Postgres.Syntax.PgGroupingSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92ProjectionSyntax Database.Beam.Postgres.Syntax.PgProjectionSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92QuantifierSyntax Database.Beam.Postgres.Syntax.PgComparisonQuantifierSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92FromOuterJoinSyntax Database.Beam.Postgres.Syntax.PgFromSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92AggregationSetQuantifierSyntax Database.Beam.Postgres.Syntax.PgSelectSetQuantifierSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92AggregationExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92AggregationSetQuantifierSyntax Database.Beam.Postgres.Syntax.PgAggregationSetQuantifierSyntax instance Database.Beam.Backend.SQL.SQL92.IsSql92DeleteSyntax Database.Beam.Postgres.Syntax.PgDeleteSyntax instance Database.Beam.Query.CustomSQL.IsCustomSqlSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Data.String.IsString (Database.Beam.Query.CustomSQL.CustomSqlSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax) instance Database.Beam.Backend.SQL.SQL92.IsSqlExpressionSyntaxStringType Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Base.String instance Database.Beam.Backend.SQL.SQL92.IsSqlExpressionSyntaxStringType Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Text.Internal.Text instance Database.Beam.Backend.SQL.SQL99.IsSql99ExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL99.IsSql99ConcatExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003EnhancedNumericFunctionsExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003ExpressionAdvancedOLAPOperationsSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003ExpressionElementaryOLAPOperationsSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003EnhancedNumericFunctionsAggregationExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003NtileExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003LeadAndLagExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003FirstValueAndLastValueExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL2003.IsSql2003NthValueExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Backend.SQL.SQL99.IsSql99AggregationExpressionSyntax Database.Beam.Postgres.Syntax.PgExpressionSyntax instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Bool instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Bool instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Double instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Double instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Float instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Float instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Int instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Int instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int8 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int8 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int16 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int16 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int32 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int32 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int64 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Int.Int64 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Integer.Type.Integer instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Integer.Type.Integer instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Word instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Types.Word instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word8 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word8 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word16 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word16 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word32 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word32 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word64 instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax GHC.Word.Word64 instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Text.Internal.Text instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Text.Internal.Text instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Text.Internal.Lazy.Text instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Text.Internal.Lazy.Text instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.Clock.Internal.UTCTime.UTCTime instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.Clock.Internal.UTCTime.UTCTime instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Aeson.Types.Internal.Value instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Aeson.Types.Internal.Value instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.LibPQ.Oid instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.LibPQ.Oid instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.LocalTime.Internal.LocalTime.LocalTime instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.LocalTime.Internal.ZonedTime.ZonedTime instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.LocalTime.Internal.ZonedTime.ZonedTime instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.LocalTime.Internal.TimeOfDay.TimeOfDay instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.Clock.Internal.NominalDiffTime.NominalDiffTime instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.Calendar.Days.Day instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Time.Calendar.Days.Day instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.UUID.Types.Internal.UUID instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.UUID.Types.Internal.UUID instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax [GHC.Types.Char] instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax [GHC.Types.Char] instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.HStore.Implementation.HStoreMap instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.HStore.Implementation.HStoreMap instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.HStore.Implementation.HStoreList instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.HStore.Implementation.HStoreList instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.Date instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.Date instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.ZonedTimestamp instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.ZonedTimestamp instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.LocalTimestamp instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.LocalTimestamp instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.UTCTimestamp instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Database.PostgreSQL.Simple.Time.Implementation.UTCTimestamp instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Scientific.Scientific instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.Scientific.Scientific instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.ByteString.Internal.ByteString instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.ByteString.Internal.ByteString instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.ByteString.Lazy.Internal.ByteString instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax Data.ByteString.Lazy.Internal.ByteString instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.Vector.Vector a) instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.Vector.Vector a) instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Text) instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Text) instance Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Lazy.Text) instance Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.CaseInsensitive.Internal.CI Data.Text.Internal.Lazy.Text) instance forall k a (t :: k). Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax a => Database.Beam.Query.Ord.HasSqlEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.Tagged.Tagged t a) instance forall k a (t :: k). Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax a => Database.Beam.Query.Ord.HasSqlQuantifiedEqualityCheck Database.Beam.Postgres.Syntax.PgExpressionSyntax (Data.Tagged.Tagged t a) instance Database.Beam.Backend.SQL.SQL92.IsSql92Syntax Database.Beam.Postgres.Syntax.PgCommandSyntax instance Database.Beam.Query.Types.HasQBuilder Database.Beam.Postgres.Syntax.PgSelectSyntax instance Data.Hashable.Class.Hashable Database.Beam.Postgres.Syntax.PgSyntax instance Database.Beam.Migrate.SQL.SQL92.Sql92DisplaySyntax Database.Beam.Postgres.Syntax.PgSyntax instance GHC.Base.Semigroup Database.Beam.Postgres.Syntax.PgSyntax instance GHC.Base.Monoid Database.Beam.Postgres.Syntax.PgSyntax instance GHC.Classes.Eq Database.Beam.Postgres.Syntax.PgSyntax instance GHC.Show.Show Database.Beam.Postgres.Syntax.PgSyntax instance Data.Functor.Classes.Eq1 Database.Beam.Postgres.Syntax.PgSyntaxF instance GHC.Classes.Eq f => GHC.Classes.Eq (Database.Beam.Postgres.Syntax.PgSyntaxF f) -- | Module providing (almost) full support for Postgres query and data -- manipulation statements. These functions shadow the functions in -- Database.Beam.Query and provide a strict superset of -- functionality. They map 1-to-1 with the underlying Postgres support. module Database.Beam.Postgres.Full -- | Combines the result of a query along with a set of locked tables. Used -- as a return value for the lockingFor_ function. data PgWithLocking s a -- | An explicit lock against some tables. You can create a value of this -- type using the locked_ function. You can combine these values -- monoidally to combine multiple locks for use with the -- withLocks_ function. data PgLockedTables s -- | Specifies the level of lock that will be taken against a row. See -- the manual section for more information. data PgSelectLockingStrength -- |
--   UPDATE
--   
PgSelectLockingStrengthUpdate :: PgSelectLockingStrength -- |
--   NO KEY UPDATE
--   
PgSelectLockingStrengthNoKeyUpdate :: PgSelectLockingStrength -- |
--   SHARE
--   
PgSelectLockingStrengthShare :: PgSelectLockingStrength -- |
--   KEY SHARE
--   
PgSelectLockingStrengthKeyShare :: PgSelectLockingStrength -- | Specifies how we should handle lock conflicts. -- -- See the manual section for more information data PgSelectLockingOptions -- | NOWAIT. Report an error rather than waiting for the lock PgSelectLockingOptionsNoWait :: PgSelectLockingOptions -- | SKIP LOCKED. Rather than wait for a lock, skip the row -- instead PgSelectLockingOptionsSkipLocked :: PgSelectLockingOptions -- | Like lockingFor_, but does not require an explicit set of -- locked tables. This produces an empty FOR .. OF clause. lockingAllTablesFor_ :: (Database Postgres db, Projectible PgExpressionSyntax a) => PgSelectLockingStrength -> Maybe PgSelectLockingOptions -> Q PgSelectSyntax db (QNested s) a -> Q PgSelectSyntax db s a -- | Lock some tables during the execution of a query. This is rather -- complicated, and there are several usage examples in the user -- guide -- -- The Postgres locking clause is rather complex, and beam currently does -- not check several pre-conditions. It is assumed you kinda know what -- you're doing. -- -- Things which postgres doesn't like, but beam will do -- -- -- -- See here for more details. -- -- This function accepts a locking strength (UPDATE, -- SHARE, KEY SHARE, etc), an optional locking option -- (NOWAIT or SKIP LOCKED), and a query whose rows to -- lock. The query should return its result wrapped in -- PgWithLocking, via the withLocks_ or lockAll_ -- function. -- -- If you want to use the most common behavior (lock all rows in every -- table mentioned), the lockingAllTablesFor_ function may be what -- you're after. lockingFor_ :: (Database Postgres db, Projectible PgExpressionSyntax a) => PgSelectLockingStrength -> Maybe PgSelectLockingOptions -> Q PgSelectSyntax db (QNested s) (PgWithLocking (QNested s) a) -> Q PgSelectSyntax db s a -- | Join with a table while locking it explicitly. Provides a -- PgLockedTables value that can be used with withLocks_ to -- explicitly lock a table during a SELECT statement locked_ :: Database Postgres db => DatabaseEntity Postgres db (TableEntity tbl) -> Q PgSelectSyntax db s (PgLockedTables s, tbl (QExpr PgExpressionSyntax s)) -- | Use with lockingFor_ to lock all tables mentioned in the query lockAll_ :: a -> PgWithLocking s a -- | Return and lock the given tables. Typically used as an infix operator. -- See the the user guide for usage examples withLocks_ :: a -> PgLockedTables s -> PgWithLocking s a -- | A beam-postgres-specific version of insert, which -- provides fuller support for the much richer Postgres INSERT -- syntax. This allows you to specify ON CONFLICT actions. For -- even more complete support, see insertReturning. insert :: DatabaseEntity Postgres db (TableEntity table) -> SqlInsertValues PgInsertValuesSyntax (table (QExpr PgExpressionSyntax s)) -> PgInsertOnConflict table -> SqlInsert PgInsertSyntax -- | The full Postgres INSERT syntax, supporting conflict actions -- and the RETURNING CLAUSE. See PgInsertOnConflict for -- how to specify a conflict action or provide onConflictDefault -- to preserve the behavior without any ON CONFLICT clause. The -- last argument takes a newly inserted row and returns the expression to -- be returned as part of the RETURNING clause. For a -- backend-agnostic version of this functionality see -- MonadBeamInsertReturning. Use runInsertReturning to -- get the results. insertReturning :: Projectible PgExpressionSyntax a => DatabaseEntity Postgres be (TableEntity table) -> SqlInsertValues PgInsertValuesSyntax (table (QExpr PgExpressionSyntax s)) -> PgInsertOnConflict table -> Maybe (table (QExpr PgExpressionSyntax PostgresInaccessible) -> a) -> PgInsertReturning (QExprToIdentity a) -- | The most general kind of INSERT that postgres can perform data PgInsertReturning a PgInsertReturning :: PgSyntax -> PgInsertReturning a PgInsertReturningEmpty :: PgInsertReturning a -- | What to do when an INSERT statement inserts a row into the -- table tbl that violates a constraint. newtype PgInsertOnConflict (tbl :: (* -> *) -> *) PgInsertOnConflict :: (tbl (QField PostgresInaccessible) -> PgInsertOnConflictSyntax) -> PgInsertOnConflict -- | Specifies the kind of constraint that must be violated for the action -- to occur newtype PgInsertOnConflictTarget (tbl :: (* -> *) -> *) PgInsertOnConflictTarget :: (tbl (QExpr PgExpressionSyntax PostgresInaccessible) -> PgInsertOnConflictTargetSyntax) -> PgInsertOnConflictTarget -- | A description of what to do when a constraint or index is violated. newtype PgConflictAction (tbl :: (* -> *) -> *) PgConflictAction :: (tbl (QField PostgresInaccessible) -> PgConflictActionSyntax) -> PgConflictAction -- | By default, Postgres will throw an error when a conflict is detected. -- This preserves that functionality. onConflictDefault :: PgInsertOnConflict tbl -- | Tells postgres what to do on an INSERT conflict. The first -- argument is the type of conflict to provide an action for. For -- example, to only provide an action for certain fields, use -- conflictingFields. Or to only provide an action over certain -- fields where a particular condition is met, use -- conflictingFields. If you have a particular constraint -- violation in mind, use conflictingConstraint. To perform an -- action on any conflict, use anyConflict. -- -- See the Postgres documentation. onConflict :: Beamable tbl => PgInsertOnConflictTarget tbl -> PgConflictAction tbl -> PgInsertOnConflict tbl -- | Perform the conflict action when any constraint or index conflict -- occurs. Syntactically, this is the ON CONFLICT clause, -- without any conflict target. anyConflict :: PgInsertOnConflictTarget tbl -- | Perform the conflict action only when these fields conflict. The first -- argument gets the current row as a table of expressions. Return the -- conflict key. For more information, see the beam-postgres -- manual. conflictingFields :: Projectible PgExpressionSyntax proj => (tbl (QExpr PgExpressionSyntax PostgresInaccessible) -> proj) -> PgInsertOnConflictTarget tbl -- | Like conflictingFields, but only perform the action if the -- condition given in the second argument is met. See the postgres -- manual for more information. conflictingFieldsWhere :: Projectible PgExpressionSyntax proj => (tbl (QExpr PgExpressionSyntax PostgresInaccessible) -> proj) -> (tbl (QExpr PgExpressionSyntax PostgresInaccessible) -> QExpr PgExpressionSyntax PostgresInaccessible Bool) -> PgInsertOnConflictTarget tbl -- | Perform the action only if the given named constraint is violated conflictingConstraint :: Text -> PgInsertOnConflictTarget tbl -- | The Postgres DO NOTHING action onConflictDoNothing :: PgConflictAction tbl -- | The Postgres DO UPDATE SET action, without the WHERE -- clause. The argument takes an updatable row (like the one used in -- update) and the conflicting row. Use current_ on the -- first argument to get the current value of the row in the database. onConflictUpdateSet :: Beamable tbl => (tbl (QField PostgresInaccessible) -> tbl (QExpr PgExpressionSyntax PostgresInaccessible) -> [QAssignment PgFieldNameSyntax PgExpressionSyntax PostgresInaccessible]) -> PgConflictAction tbl -- | The Postgres DO UPDATE SET action, with the WHERE -- clause. This is like onConflictUpdateSet, but only rows -- satisfying the given condition are updated. Sometimes this results in -- more efficient locking. See the Postgres manual for more -- information. onConflictUpdateSetWhere :: Beamable tbl => (tbl (QField PostgresInaccessible) -> tbl (QExpr PgExpressionSyntax PostgresInaccessible) -> [QAssignment PgFieldNameSyntax PgExpressionSyntax PostgresInaccessible]) -> (tbl (QExpr PgExpressionSyntax PostgresInaccessible) -> QExpr PgExpressionSyntax PostgresInaccessible Bool) -> PgConflictAction tbl -- | Sometimes you want to update certain columns in the row. Given a -- projection from a row to the fields you want, Beam can auto-generate -- an assignment that assigns the corresponding fields of the conflicting -- row. onConflictUpdateInstead :: (Beamable tbl, Projectible Text proj) => (tbl (QExpr Text PostgresInaccessible) -> proj) -> PgConflictAction tbl -- | Sometimes you want to update every value in the row. Beam can -- auto-generate an assignment that assigns the conflicting row to every -- field in the database row. This may not always be what you want. onConflictSetAll :: (Beamable tbl, Projectible Text (tbl (QExpr Text PostgresInaccessible))) => PgConflictAction tbl -- | The most general kind of UPDATE that postgres can perform data PgUpdateReturning a PgUpdateReturning :: PgSyntax -> PgUpdateReturning a PgUpdateReturningEmpty :: PgUpdateReturning a -- | Postgres UPDATE ... RETURNING statement support. The last -- argument takes the newly inserted row and returns the values to be -- returned. Use runUpdateReturning to get the results. updateReturning :: Projectible PgExpressionSyntax a => DatabaseEntity Postgres be (TableEntity table) -> (forall s. table (QField s) -> [QAssignment PgFieldNameSyntax PgExpressionSyntax s]) -> (forall s. table (QExpr PgExpressionSyntax s) -> QExpr PgExpressionSyntax s Bool) -> (table (QExpr PgExpressionSyntax PostgresInaccessible) -> a) -> PgUpdateReturning (QExprToIdentity a) -- | The most general kind of DELETE that postgres can perform newtype PgDeleteReturning a PgDeleteReturning :: PgSyntax -> PgDeleteReturning a -- | Postgres DELETE ... RETURNING statement support. The last -- argument takes the newly inserted row and returns the values to be -- returned. Use runDeleteReturning to get the results. deleteReturning :: Projectible PgExpressionSyntax a => DatabaseEntity Postgres be (TableEntity table) -> (forall s. table (QExpr PgExpressionSyntax s) -> QExpr PgExpressionSyntax s Bool) -> (table (QExpr PgExpressionSyntax PostgresInaccessible) -> a) -> PgDeleteReturning (QExprToIdentity a) instance GHC.Base.Monoid (Database.Beam.Postgres.Full.PgLockedTables s) instance GHC.Base.Semigroup (Database.Beam.Postgres.Full.PgLockedTables s) instance Database.Beam.Query.Internal.ProjectibleWithPredicate c syntax a => Database.Beam.Query.Internal.ProjectibleWithPredicate c syntax (Database.Beam.Postgres.Full.PgWithLocking s a) -- | The pgcrypto extension provides several cryptographic -- functions to Postgres. This module provides a beam-postgres -- extension to access this functionality. For an example of usage, see -- the documentation for PgExtensionEntity. module Database.Beam.Postgres.PgCrypto -- | Data type representing definitions contained in the pgcrypto -- extension -- -- Each field maps closely to the underlying pgcrypto function, -- which are described in further detail in the pgcrypto manual. data PgCrypto PgCrypto :: forall ctxt s. LiftPg ctxt s (Text -> Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (Text -> Text -> Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (Text -> Text -> Text) -> forall ctxt s. LiftPg ctxt s (Text -> Maybe Int -> Text) -> forall ctxt s. LiftPg ctxt s (Text -> Text -> Maybe Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Maybe Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Maybe Text -> Text) -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Maybe Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (Text -> ByteString -> Maybe Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (ByteString -> ByteString -> Maybe Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (ByteString -> ByteString -> Maybe Text -> Maybe Text -> Text) -> forall ctxt s. LiftPg ctxt s (ByteString -> ByteString -> Maybe Text -> Maybe Text -> ByteString) -> forall ctxt s. LiftPg ctxt s (ByteString -> Text) -> forall ctxt s. PgExpr ctxt s ByteString -> Maybe (PgExpr ctxt s (Vector Text), PgExpr ctxt s (Vector Text)) -> PgExpr ctxt s Text -> forall ctxt s. LiftPg ctxt s (Text -> ByteString) -> forall ctxt s i. Integral i => PgExpr ctxt s i -> PgExpr ctxt s ByteString -> forall ctxt s. PgExpr ctxt s UUID -> PgCrypto [pgCryptoDigestText] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (Text -> Text -> ByteString) [pgCryptoDigestBytes] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> ByteString) [pgCryptoHmacText] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (Text -> Text -> Text -> ByteString) [pgCryptoHmacBytes] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Text -> ByteString) [pgCryptoCrypt] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (Text -> Text -> Text) [pgCryptoGenSalt] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (Text -> Maybe Int -> Text) [pgCryptoPgpSymEncrypt] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (Text -> Text -> Maybe Text -> ByteString) [pgCryptoPgpSymEncryptBytea] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Maybe Text -> ByteString) [pgCryptoPgpSymDecrypt] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Maybe Text -> Text) [pgCryptoPgpSymDecryptBytea] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> Text -> Maybe Text -> ByteString) [pgCryptoPgpPubEncrypt] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (Text -> ByteString -> Maybe Text -> ByteString) [pgCryptoPgpPubEncryptBytea] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> ByteString -> Maybe Text -> ByteString) [pgCryptoPgpPubDecrypt] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> ByteString -> Maybe Text -> Maybe Text -> Text) [pgCryptoPgpPubDecryptBytea] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> ByteString -> Maybe Text -> Maybe Text -> ByteString) [pgCryptoPgpKeyId] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (ByteString -> Text) [pgCryptoArmor] :: PgCrypto -> forall ctxt s. PgExpr ctxt s ByteString -> Maybe (PgExpr ctxt s (Vector Text), PgExpr ctxt s (Vector Text)) -> PgExpr ctxt s Text [pgCryptoDearmor] :: PgCrypto -> forall ctxt s. LiftPg ctxt s (Text -> ByteString) [pgCryptoGenRandomBytes] :: PgCrypto -> forall ctxt s i. Integral i => PgExpr ctxt s i -> PgExpr ctxt s ByteString [pgCryptoGenRandomUUID] :: PgCrypto -> forall ctxt s. PgExpr ctxt s UUID instance Database.Beam.Postgres.Extensions.IsPgExtension Database.Beam.Postgres.PgCrypto.PgCrypto -- | Migrations support for beam-postgres. See Database.Beam.Migrate -- for more information on beam migrations. module Database.Beam.Postgres.Migrate -- | Top-level migration backend for use by beam-migrate tools migrationBackend :: BeamMigrationBackend PgCommandSyntax Postgres Connection Pg -- | BeamDeserializers for postgres-specific types: -- -- postgresDataTypeDeserializers :: BeamDeserializers PgCommandSyntax -- | Converts postgres DatabasePredicates to -- DatabasePredicates in the Haskell syntax. Allows automatic -- generation of Haskell schemas from postgres constraints. pgPredConverter :: HaskellPredicateConverter getDbConstraints :: Connection -> IO [SomeDatabasePredicate] -- | Turn a PgDataTypeSyntax into the corresponding -- HsDataType. This is a best effort guess, and may fail on more -- exotic types. Feel free to send PRs to make this function more robust! pgTypeToHs :: PgDataTypeSyntax -> Maybe HsDataType -- | Turn a series of MigrationSteps into a line-by-line array of -- ByteStrings suitable for writing to a script. migrateScript :: MigrationSteps PgCommandSyntax () a' -> [ByteString] -- | Write the migration given by the MigrationSteps to a file. writeMigrationScript :: FilePath -> MigrationSteps PgCommandSyntax () a -> IO () -- | DataType for tsquery. See TsQuery for more -- information tsquery :: DataType PgDataTypeSyntax TsQuery -- | DataType for tsvector. See TsVector for more -- information tsvector :: DataType PgDataTypeSyntax TsVector -- | DataType for Postgres TEXT. -- characterLargeObject is also mapped to this data type text :: DataType PgDataTypeSyntax Text -- | DataType for Postgres BYTEA. -- binaryLargeObject is also mapped to this data type bytea :: DataType PgDataTypeSyntax ByteString -- | DataType for a Postgres array without any bounds. -- -- Note that array support in beam-migrate is still incomplete. unboundedArray :: forall a. Typeable a => DataType PgDataTypeSyntax a -> DataType PgDataTypeSyntax (Vector a) -- | DataType for UUID columns. The -- pgCryptoGenRandomUUID function in the PgCrypto -- extension can be used to generate UUIDs at random. uuid :: DataType PgDataTypeSyntax UUID -- | DataType for MONEY columns. money :: DataType PgDataTypeSyntax PgMoney -- | DataType for JSON. See PgJSON for more -- information json :: (ToJSON a, FromJSON a) => DataType PgDataTypeSyntax (PgJSON a) -- | DataType for JSONB. See PgJSON for more -- information jsonb :: (ToJSON a, FromJSON a) => DataType PgDataTypeSyntax (PgJSONB a) -- | Postgres SERIAL data types. Automatically generates an -- appropriate DEFAULT clause and sequence smallserial :: Integral a => DataType PgDataTypeSyntax (SqlSerial a) -- | Postgres SERIAL data types. Automatically generates an -- appropriate DEFAULT clause and sequence serial :: Integral a => DataType PgDataTypeSyntax (SqlSerial a) -- | Postgres SERIAL data types. Automatically generates an -- appropriate DEFAULT clause and sequence bigserial :: Integral a => DataType PgDataTypeSyntax (SqlSerial a) instance Database.Beam.Migrate.SQL.Tables.FieldReturnType 'GHC.Types.True 'GHC.Types.False Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax resTy a => Database.Beam.Migrate.SQL.Tables.FieldReturnType 'GHC.Types.False 'GHC.Types.False Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax resTy (Database.Beam.Postgres.Migrate.PgHasDefault -> a) instance Database.Beam.Migrate.SQL.BeamExtensions.IsBeamSerialColumnSchemaSyntax Database.Beam.Postgres.Syntax.PgColumnSchemaSyntax -- | More efficient query execution functions for beam-postgres. -- These functions use the conduit package, to execute -- beam-postgres statements in an arbitrary MonadIO. -- These functions may be more efficient for streaming operations than -- MonadBeam. module Database.Beam.Postgres.Conduit -- | Run a PostgreSQL SELECT statement in any MonadIO. runSelect :: (MonadIO m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> SqlSelect PgSelectSyntax a -> (ConduitT () a m () -> m b) -> m b -- | Run a PostgreSQL INSERT statement in any MonadIO. -- Returns the number of rows affected. runInsert :: MonadIO m => Connection -> SqlInsert PgInsertSyntax -> m Int64 -- | Run a PostgreSQL INSERT ... RETURNING ... statement in any -- MonadIO and get a Source of the newly inserted rows. runInsertReturning :: (MonadIO m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> PgInsertReturning a -> (ConduitT () a m () -> m b) -> m b -- | Run a PostgreSQL UPDATE statement in any MonadIO. -- Returns the number of rows affected. runUpdate :: MonadIO m => Connection -> SqlUpdate PgUpdateSyntax tbl -> m Int64 -- | Run a PostgreSQL UPDATE ... RETURNING ... statement in any -- MonadIO and get a Source of the newly updated rows. runUpdateReturning :: (MonadIO m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> PgUpdateReturning a -> (ConduitT () a m () -> m b) -> m b -- | Run a PostgreSQL DELETE statement in any MonadIO. -- Returns the number of rows affected. runDelete :: MonadIO m => Connection -> SqlDelete PgDeleteSyntax tbl -> m Int64 -- | Run a PostgreSQl DELETE ... RETURNING ... statement in any -- MonadIO and get a Source of the deleted rows. runDeleteReturning :: (MonadIO m, MonadBaseControl IO m, FromBackendRow Postgres a) => Connection -> PgDeleteReturning a -> (ConduitT () a m () -> m b) -> m b -- | Run any DML statement. Return the number of rows affected executeStatement :: MonadIO m => Connection -> PgSyntax -> m Int64 -- | Runs any query that returns a set of values runQueryReturning :: (MonadIO m, MonadBaseControl IO m, Functor m, FromBackendRow Postgres r) => Connection -> PgSyntax -> (ConduitT () r m () -> m b) -> m b -- | Postgres is a popular, open-source RDBMS. It is fairly standards -- compliant and supports many advanced features and data types. -- -- The beam-postgres module is built atop of -- postgresql-simple, which is used for connection management, -- transaction support, serialization, and deserialization. -- -- beam-postgres supports most beam features as well as many -- postgres-specific features. For example, beam-postgres -- provides support for full-text search, DISTINCT ON, JSON -- handling, postgres ARRAYs, RANGEs, and the -- MONEY type. -- -- The documentation for beam-postgres functionality below -- indicates which postgres function each function or type wraps. -- Postgres maintains its own in-depth documentation. Please refer to -- that for more detailed information on behavior. -- -- For examples on how to use beam-postgres usage, see its -- manual. module Database.Beam.Postgres -- | An error that may occur while parsing a row data PgRowReadError -- | We attempted to read more columns than postgres returned. First -- argument is the zero-based index of the column we attempted to read, -- and the second is the total number of columns PgRowReadNoMoreColumns :: !CInt -> !CInt -> PgRowReadError -- | There was an error while parsing the field. The first argument gives -- the zero-based index of the column that could not have been parsed. -- This is usually caused by your Haskell schema type being incompatible -- with the one in the database. PgRowCouldNotParseField :: !CInt -> PgRowReadError -- | Errors that may arise while using the Pg monad. data PgError PgRowParseError :: PgRowReadError -> PgError PgInternalError :: String -> PgError -- | The Postgres backend type, used to parameterize MonadBeam. See -- the definitions there for more information. The corresponding query -- monad is Pg. See documentation for MonadBeam and the -- user guide for more information on using this backend. data Postgres Postgres :: Postgres -- | MonadBeam in which we can run Postgres commands. See the -- documentation for MonadBeam on examples of how to use. -- -- beam-postgres also provides functions that let you run -- queries without MonadBeam. These functions may be more -- efficient and offer a conduit API. See -- Database.Beam.Postgres.Conduit for more information. data Pg a -- | Representation of an arbitrary Postgres command. This is the -- combination of the command syntax (repesented by PgSyntax), as -- well as the type of command (represented by PgCommandType). The -- command type is necessary for us to know how to retrieve results from -- the database. data PgCommandSyntax -- | A piece of Postgres SQL syntax, which may contain embedded escaped -- byte and text sequences. PgSyntax composes monoidally, and may -- be created with emit, emitBuilder, escapeString, -- escapBytea, and escapeIdentifier. data PgSyntax -- | IsSql92SelectSyntax for Postgres data PgSelectSyntax -- | IsSql92InsertSyntax for Postgres data PgInsertSyntax -- | IsSql92UpdateSyntax for Postgres data PgUpdateSyntax -- | IsSql92DeleteSyntax for Postgres data PgDeleteSyntax -- | BeamURIOpeners for the standard postgresql: URI -- scheme. See the postgres documentation for more details on the -- formatting. See documentation for BeamURIOpeners for more -- information on how to use this with beam postgresUriSyntax :: c PgCommandSyntax Postgres Connection Pg -> BeamURIOpeners c -- | DataType for JSON. See PgJSON for more -- information json :: (ToJSON a, FromJSON a) => DataType PgDataTypeSyntax (PgJSON a) -- | DataType for JSONB. See PgJSON for more -- information jsonb :: (ToJSON a, FromJSON a) => DataType PgDataTypeSyntax (PgJSONB a) -- | DataType for UUID columns. The -- pgCryptoGenRandomUUID function in the PgCrypto -- extension can be used to generate UUIDs at random. uuid :: DataType PgDataTypeSyntax UUID -- | DataType for MONEY columns. money :: DataType PgDataTypeSyntax PgMoney -- | DataType for tsquery. See TsQuery for more -- information tsquery :: DataType PgDataTypeSyntax TsQuery -- | DataType for tsvector. See TsVector for more -- information tsvector :: DataType PgDataTypeSyntax TsVector -- | DataType for Postgres TEXT. -- characterLargeObject is also mapped to this data type text :: DataType PgDataTypeSyntax Text -- | DataType for Postgres BYTEA. -- binaryLargeObject is also mapped to this data type bytea :: DataType PgDataTypeSyntax ByteString -- | DataType for a Postgres array without any bounds. -- -- Note that array support in beam-migrate is still incomplete. unboundedArray :: forall a. Typeable a => DataType PgDataTypeSyntax a -> DataType PgDataTypeSyntax (Vector a) -- | Postgres SERIAL data types. Automatically generates an -- appropriate DEFAULT clause and sequence smallserial :: Integral a => DataType PgDataTypeSyntax (SqlSerial a) -- | Postgres SERIAL data types. Automatically generates an -- appropriate DEFAULT clause and sequence serial :: Integral a => DataType PgDataTypeSyntax (SqlSerial a) -- | Postgres SERIAL data types. Automatically generates an -- appropriate DEFAULT clause and sequence bigserial :: Integral a => DataType PgDataTypeSyntax (SqlSerial a) -- | The identifier of a Postgres text search configuration. -- -- Use the IsString instance to construct new values of this type data TsVectorConfig -- | The type of a document preprocessed for full-text search. The -- contained ByteString is the Postgres representation of the -- TSVECTOR type. Use toTsVector to construct these -- on-the-fly from strings. -- -- When this field is embedded in a beam table, -- defaultMigratableDbSettings will give the column the postgres -- TSVECTOR type. newtype TsVector TsVector :: ByteString -> TsVector -- | The Postgres to_tsvector function. Given a configuration and -- string, return the TSVECTOR that represents the contents of -- the string. toTsVector :: IsSqlExpressionSyntaxStringType PgExpressionSyntax str => Maybe TsVectorConfig -> QGenExpr context PgExpressionSyntax s str -> QGenExpr context PgExpressionSyntax s TsVector -- | A full-text search configuration with sensible defaults for english english :: TsVectorConfig -- | A query that can be run against a document contained in a -- TsVector. -- -- When this field is embedded in a beam table, -- defaultMigratableDbSettings will give the column the postgres -- TSVECTOR type newtype TsQuery TsQuery :: ByteString -> TsQuery -- | Determine if the given TSQUERY matches the document -- represented by the TSVECTOR. Behaves exactly like the -- similarly-named operator in postgres. (@@) :: QGenExpr context PgExpressionSyntax s TsVector -> QGenExpr context PgExpressionSyntax s TsQuery -> QGenExpr context PgExpressionSyntax s Bool -- | The Postgres to_tsquery function. Given a configuration and -- string, return the TSQUERY that represents the contents of -- the string. toTsQuery :: IsSqlExpressionSyntaxStringType PgExpressionSyntax str => Maybe TsVectorConfig -> QGenExpr context PgExpressionSyntax s str -> QGenExpr context PgExpressionSyntax s TsQuery -- | The Postgres JSON type, which stores textual values that -- represent JSON objects. The type parameter indicates the Haskell type -- which the JSON encodes. This type must be a member of FromJSON -- and ToJSON in order for deserialization and serialization to -- work as expected. -- -- The defaultMigratableDbSettings function automatically -- assigns the postgres JSON type to fields with this type. newtype PgJSON a PgJSON :: a -> PgJSON a -- | The Postgres JSONB type, which stores JSON-encoded data in a -- postgres-specific binary format. Like PgJSON, the type -- parameter indicates the Hgaskell type which the JSON encodes. -- -- Fields with this type are automatically given the Postgres -- JSONB type newtype PgJSONB a PgJSONB :: a -> PgJSONB a -- | Postgres provides separate json_ and jsonb_ -- functions. However, we know what we're dealing with based on the type -- of data, so we can be less obtuse. -- -- For more information on how these functions behave, see the Postgres -- manual section on JSON. class IsPgJSON (json :: * -> *) -- | The json_each or jsonb_each function. Values -- returned as json or jsonb respectively. Use -- pgUnnest to join against the result pgJsonEach :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (PgSetOf (PgJSONEach (json Value))) -- | Like pgJsonEach, but returning text values instead pgJsonEachText :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (PgSetOf (PgJSONEach Text)) -- | The json_object_keys and jsonb_object_keys function. -- Use pgUnnest to join against the result. pgJsonKeys :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (PgSetOf PgJSONKey) -- | The json_array_elements and jsonb_array_elements -- function. Use pgUnnest to join against the result pgJsonArrayElements :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (PgSetOf (PgJSONElement (json Value))) -- | Like pgJsonArrayElements, but returning the values as -- Text pgJsonArrayElementsText :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (PgSetOf (PgJSONElement Text)) -- | The json_typeof or jsonb_typeof function pgJsonTypeOf :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Text -- | The json_strip_nulls or jsonb_strip_nulls function. pgJsonStripNulls :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (json b) -- | The json_agg or jsonb_agg aggregate. pgJsonAgg :: IsPgJSON json => QExpr PgExpressionSyntax s a -> QAgg PgExpressionSyntax s (json a) -- | The json_object_agg or jsonb_object_agg. The first -- argument gives the key source and the second the corresponding values. pgJsonObjectAgg :: IsPgJSON json => QExpr PgExpressionSyntax s key -> QExpr PgExpressionSyntax s value -> QAgg PgExpressionSyntax s (json a) -- | Key-value pair, used as output of pgJsonEachText and -- pgJsonEach data PgJSONEach valType f PgJSONEach :: C f Text -> C f valType -> PgJSONEach valType f [pgJsonEachKey] :: PgJSONEach valType f -> C f Text [pgJsonEachValue] :: PgJSONEach valType f -> C f valType -- | Output row of pgJsonKeys data PgJSONKey f PgJSONKey :: C f Text -> PgJSONKey f [pgJsonKey] :: PgJSONKey f -> C f Text -- | Output row of pgJsonArrayElements and -- pgJsonArrayElementsText data PgJSONElement a f PgJSONElement :: C f a -> PgJSONElement a f [pgJsonElement] :: PgJSONElement a f -> C f a -- | Postgres @> and <@ operators for JSON. Return -- true if the json object pointed to by the arrow is completely -- contained in the other. See the Postgres documentation for more in -- formation on what this means. (@>) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (json b) -> QGenExpr ctxt PgExpressionSyntax s Bool -- | Postgres @> and <@ operators for JSON. Return -- true if the json object pointed to by the arrow is completely -- contained in the other. See the Postgres documentation for more in -- formation on what this means. (<@) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (json b) -> QGenExpr ctxt PgExpressionSyntax s Bool -- | Access a JSON array by index. Corresponds to the Postgres -- -> operator. See '(->$)' for the corresponding operator -- for object access. (->#) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Int -> QGenExpr ctxt PgExpressionSyntax s (json b) -- | Acces a JSON object by key. Corresponds to the Postgres -> -- operator. See '(->#)' for the corresponding operator for arrays. (->$) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Text -> QGenExpr ctxt PgExpressionSyntax s (json b) -- | Access a JSON array by index, returning the embedded object as a -- string. Corresponds to the Postgres ->> operator. See -- '(->>$)' for the corresponding operator on objects. (->>#) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Int -> QGenExpr ctxt PgExpressionSyntax s Text -- | Access a JSON object by key, returning the embedded object as a -- string. Corresponds to the Postgres ->> operator. See -- '(->>#)' for the corresponding operator on arrays. (->>$) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Text -> QGenExpr ctxt PgExpressionSyntax s Text -- | Access a deeply nested JSON object. The first argument is the JSON -- object to look within, the second is the path of keys from the first -- argument to the target. Returns the result as a new json value. Note -- that the postgres function allows etiher string keys or integer -- indices, but this function only allows string keys. PRs to improve -- this functionality are welcome. (#>) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (Vector Text) -> QGenExpr ctxt PgExpressionSyntax s (json b) -- | Like '(#>)' but returns the result as a string. (#>>) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (Vector Text) -> QGenExpr ctxt PgExpressionSyntax s Text -- | Postgres ? operator. Checks if the given string exists as -- top-level key of the json object. (?) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Text -> QGenExpr ctxt PgExpressionSyntax s Bool -- | Postgres ?| and ?& operators. Check if any or -- all of the given strings exist as top-level keys of the json object -- respectively. (?|) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (Vector Text) -> QGenExpr ctxt PgExpressionSyntax s Bool -- | Postgres ?| and ?& operators. Check if any or -- all of the given strings exist as top-level keys of the json object -- respectively. (?&) :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (Vector Text) -> QGenExpr ctxt PgExpressionSyntax s Bool -- | Postgres - operator on json objects. Returns the supplied -- json object with the supplied key deleted. See withoutIdx for -- the corresponding operator on arrays. withoutKey :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Text -> QGenExpr ctxt PgExpressionSyntax s (json b) -- | Postgres - operator on json arrays. See withoutKey for -- the corresponding operator on objects. withoutIdx :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Int -> QGenExpr ctxt PgExpressionSyntax s (json b) -- | Postgres #- operator. Removes all the keys specificied from -- the JSON object and returns the result. withoutKeys :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s (Vector Text) -> QGenExpr ctxt PgExpressionSyntax s (json b) -- | Postgres json_array_length function. The supplied json object -- should be an array, but this isn't checked at compile-time. pgJsonArrayLength :: IsPgJSON json => QGenExpr ctxt PgExpressionSyntax s (json a) -> QGenExpr ctxt PgExpressionSyntax s Int -- | The postgres jsonb_set function. pgJsonUpdate -- expects the value specified by the path in the second argument to -- exist. If it does not, the first argument is not modified. -- pgJsonbSet will create any intermediate objects necessary. This -- corresponds to the create_missing argument of -- jsonb_set being set to false or true respectively. pgJsonbUpdate :: QGenExpr ctxt PgExpressionSyntax s (PgJSONB a) -> QGenExpr ctxt PgExpressionSyntax s (Vector Text) -> QGenExpr ctxt PgExpressionSyntax s (PgJSONB b) -> QGenExpr ctxt PgExpressionSyntax s (PgJSONB a) -- | The postgres jsonb_set function. pgJsonUpdate -- expects the value specified by the path in the second argument to -- exist. If it does not, the first argument is not modified. -- pgJsonbSet will create any intermediate objects necessary. This -- corresponds to the create_missing argument of -- jsonb_set being set to false or true respectively. pgJsonbSet :: QGenExpr ctxt PgExpressionSyntax s (PgJSONB a) -> QGenExpr ctxt PgExpressionSyntax s (Vector Text) -> QGenExpr ctxt PgExpressionSyntax s (PgJSONB b) -> QGenExpr ctxt PgExpressionSyntax s (PgJSONB a) -- | Postgres jsonb_pretty function pgJsonbPretty :: QGenExpr ctxt PgExpressionSyntax s (PgJSONB a) -> QGenExpr ctxt PgExpressionSyntax s Text -- | Postgres MONEY data type. A simple wrapper over -- ByteString, because Postgres money format is locale-dependent, -- and we don't handle currency symbol placement, digit grouping, or -- decimal separation. -- -- The pgMoney function can be used to convert a number to -- PgMoney. newtype PgMoney PgMoney :: ByteString -> PgMoney [fromPgMoney] :: PgMoney -> ByteString -- | Attempt to pack a floating point value as a PgMoney value, -- paying no attention to the locale-dependent currency symbol, digit -- grouping, or decimal point. This will use the . symbol as the -- decimal separator. pgMoney :: Real a => a -> PgMoney -- | Multiply a MONEY value by a numeric value. Corresponds to the -- Postgres * operator. pgScaleMoney_ :: Num a => QGenExpr context PgExpressionSyntax s a -> QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s PgMoney -- | Divide a MONEY value by a numeric value. Corresponds to -- Postgres / where the numerator has type MONEY and -- the denominator is a number. If you would like to divide two -- MONEY values and have their units cancel out, use -- pgDivideMoneys_. pgDivideMoney_ :: Num a => QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s a -> QGenExpr context PgExpressionSyntax s PgMoney -- | Dividing two MONEY value results in a number. Corresponds to -- Postgres / on two MONEY values. If you would like to -- divide MONEY by a scalar, use pgDivideMoney_ pgDivideMoneys_ :: Num a => QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s a -- | Postgres + and - operators on money. pgAddMoney_ :: QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s PgMoney -- | Postgres + and - operators on money. pgSubtractMoney_ :: QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s PgMoney -> QGenExpr context PgExpressionSyntax s PgMoney -- | The Postgres MONEY type can be summed or averaged in an -- aggregation. These functions provide the quantified aggregations. See -- pgSumMoney_ and pgAvgMoney_ for the unquantified -- versions. pgSumMoneyOver_ :: Maybe PgAggregationSetQuantifierSyntax -> QExpr PgExpressionSyntax s PgMoney -> QExpr PgExpressionSyntax s PgMoney -- | The Postgres MONEY type can be summed or averaged in an -- aggregation. These functions provide the quantified aggregations. See -- pgSumMoney_ and pgAvgMoney_ for the unquantified -- versions. pgAvgMoneyOver_ :: Maybe PgAggregationSetQuantifierSyntax -> QExpr PgExpressionSyntax s PgMoney -> QExpr PgExpressionSyntax s PgMoney -- | The Postgres MONEY type can be summed or averaged in an -- aggregation. To provide an explicit quantification, see -- pgSumMoneyOver_ and pgAvgMoneyOver_. pgSumMoney_ :: QExpr PgExpressionSyntax s PgMoney -> QExpr PgExpressionSyntax s PgMoney -- | The Postgres MONEY type can be summed or averaged in an -- aggregation. To provide an explicit quantification, see -- pgSumMoneyOver_ and pgAvgMoneyOver_. pgAvgMoney_ :: QExpr PgExpressionSyntax s PgMoney -> QExpr PgExpressionSyntax s PgMoney data PgSetOf (tbl :: (* -> *) -> *) pgUnnest :: forall tbl db s. Beamable tbl => QExpr PgExpressionSyntax s (PgSetOf tbl) -> Q PgSelectSyntax db s (QExprTable PgExpressionSyntax s tbl) pgUnnestArray :: QExpr PgExpressionSyntax s (Vector a) -> Q PgSelectSyntax db s (QExpr PgExpressionSyntax s a) pgUnnestArrayWithOrdinality :: QExpr PgExpressionSyntax s (Vector a) -> Q PgSelectSyntax db s (QExpr PgExpressionSyntax s Int, QExpr PgExpressionSyntax s a) -- | An expression context that determines which types of expressions can -- be put inside an array element. Any scalar, aggregate, or window -- expression can be placed within an array. data PgArrayValueContext -- | If you are extending beam-postgres and provide another expression -- context that can be represented in an array, provide an empty instance -- of this class. class PgIsArrayContext ctxt -- | Build a 1-dimensional postgres array from an arbitrary Foldable -- containing expressions. array_ :: forall context f s a. (PgIsArrayContext context, Foldable f) => f (QGenExpr PgArrayValueContext PgExpressionSyntax s a) -> QGenExpr context PgExpressionSyntax s (Vector a) -- | Build a 1-dimensional postgres array from a subquery arrayOf_ :: Q PgSelectSyntax db s (QExpr PgExpressionSyntax s a) -> QGenExpr context PgExpressionSyntax s (Vector a) -- | Postgres || operator. Concatenates two vectors and returns -- their result. (++.) :: QGenExpr ctxt PgExpressionSyntax s (Vector a) -> QGenExpr ctxt PgExpressionSyntax s (Vector a) -> QGenExpr ctxt PgExpressionSyntax s (Vector a) -- | An aggregate that adds each value to the resulting array. See -- pgArrayOver if you want to specify a quantifier. Corresponds -- to the Postgres ARRAY_AGG function. pgArrayAgg :: QExpr PgExpressionSyntax s a -> QAgg PgExpressionSyntax s (Vector a) -- | Postgres ARRAY_AGG with an explicit quantifier. Includes each -- row that meets the quantification criteria in the result. pgArrayAggOver :: Maybe PgAggregationSetQuantifierSyntax -> QExpr PgExpressionSyntax s a -> QAgg PgExpressionSyntax s (Vector a) -- | Index into the given array. This translates to the -- array[index] syntax in postgres. The beam -- operator name has been chosen to match the 'Data.Vector.(!)' operator. (!.) :: Integral ix => QGenExpr context PgExpressionSyntax s (Vector a) -> QGenExpr context PgExpressionSyntax s ix -> QGenExpr context PgExpressionSyntax s a -- | Postgres array_dims() function. Returns a textual -- representation of the dimensions of the array. arrayDims_ :: IsSqlExpressionSyntaxStringType PgExpressionSyntax text => QGenExpr context PgExpressionSyntax s (Vector a) -> QGenExpr context PgExpressionSyntax s text -- | Return the upper or lower bound of the given array at the given -- dimension (statically supplied as a type application on a Nat). -- Note that beam will attempt to statically determine if the dimension -- is in range. GHC errors will be thrown if this cannot be proved. -- -- For example, to get the upper bound of the 2nd-dimension of an array: -- --
--   arrayUpper_ @2 vectorValuedExpression
--   
arrayUpper_ :: forall (dim :: Nat) context num v s. (KnownNat dim, WithinBounds dim (Vector v), Integral num) => QGenExpr context PgExpressionSyntax s (Vector v) -> QGenExpr context PgExpressionSyntax s num -- | Return the upper or lower bound of the given array at the given -- dimension (statically supplied as a type application on a Nat). -- Note that beam will attempt to statically determine if the dimension -- is in range. GHC errors will be thrown if this cannot be proved. -- -- For example, to get the upper bound of the 2nd-dimension of an array: -- --
--   arrayUpper_ @2 vectorValuedExpression
--   
arrayLower_ :: forall (dim :: Nat) context num v s. (KnownNat dim, WithinBounds dim (Vector v), Integral num) => QGenExpr context PgExpressionSyntax s (Vector v) -> QGenExpr context PgExpressionSyntax s num -- | These functions can be used to find the lower and upper bounds of an -- array where the dimension number is not known until run-time. They are -- marked unsafe because they may cause query processing to fail at -- runtime, even if they typecheck successfully. arrayUpperUnsafe_ :: (Integral dim, Integral length) => QGenExpr context PgExpressionSyntax s (Vector v) -> QGenExpr context PgExpressionSyntax s dim -> QGenExpr context PgExpressionSyntax s (Maybe length) -- | These functions can be used to find the lower and upper bounds of an -- array where the dimension number is not known until run-time. They are -- marked unsafe because they may cause query processing to fail at -- runtime, even if they typecheck successfully. arrayLowerUnsafe_ :: (Integral dim, Integral length) => QGenExpr context PgExpressionSyntax s (Vector v) -> QGenExpr context PgExpressionSyntax s dim -> QGenExpr context PgExpressionSyntax s (Maybe length) -- | Get the size of the array at the given (statically known) dimension, -- provided as a type-level Nat. Like the arrayUpper_ and -- arrayLower_ functions,throws a compile-time error if the -- dimension is out of bounds. arrayLength_ :: forall (dim :: Nat) ctxt num v s. (KnownNat dim, WithinBounds dim (Vector v), Integral num) => QGenExpr ctxt PgExpressionSyntax s (Vector v) -> QGenExpr ctxt PgExpressionSyntax s num -- | Get the size of an array at a dimension not known until run-time. -- Marked unsafe as this may cause runtime errors even if it type checks. arrayLengthUnsafe_ :: (Integral dim, Integral num) => QGenExpr ctxt PgExpressionSyntax s (Vector v) -> QGenExpr ctxt PgExpressionSyntax s dim -> QGenExpr ctxt PgExpressionSyntax s (Maybe num) -- | The Postgres @> operator. Returns true if every member of -- the second array is present in the first. isSupersetOf_ :: QGenExpr ctxt PgExpressionSyntax s (Vector a) -> QGenExpr ctxt PgExpressionSyntax s (Vector a) -> QGenExpr ctxt PgExpressionSyntax s Bool -- | The Postgres <@ operator. Returns true if every member of -- the first array is present in the second. isSubsetOf_ :: QGenExpr ctxt PgExpressionSyntax s (Vector a) -> QGenExpr ctxt PgExpressionSyntax s (Vector a) -> QGenExpr ctxt PgExpressionSyntax s Bool -- | A range of a given Haskell type (represented by a) stored as -- a given Postgres Range Type (represented by n). -- -- A reasonable example might be Range PgInt8Range Int64. This -- represents a range of Haskell Int64 values stored as a range -- of bigint in Postgres. data PgRange (n :: *) a PgEmptyRange :: PgRange a PgRange :: (PgRangeBound a) -> (PgRangeBound a) -> PgRange a -- | Represents a single bound on a Range. A bound always has a type, but -- may not have a value (the absense of a value represents unbounded). data PgRangeBound a PgRangeBound :: PgBoundType -> (Maybe a) -> PgRangeBound a -- | Represents the types of bounds a range can have. A range can and often -- does have mis-matched bound types. data PgBoundType Inclusive :: PgBoundType Exclusive :: PgBoundType -- | A class representing Postgres Range types and how to refer to them -- when speaking to the database. -- -- For custom Range types, create an uninhabited type, and make it an -- instance of this class. class PgIsRange n -- | The range type name in the database. rangeName :: PgIsRange n => ByteString data PgInt4Range data PgInt8Range data PgNumRange data PgTsRange data PgTsTzRange data PgDateRange range_ :: forall n a context s. PgIsRange n => PgBoundType -> PgBoundType -> QGenExpr context PgExpressionSyntax s (Maybe a) -> QGenExpr context PgExpressionSyntax s (Maybe a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) inclusive :: a -> PgRangeBound a exclusive :: a -> PgRangeBound a unbounded :: PgRangeBound a (-@>-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (-@>) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s a -> QGenExpr context PgExpressionSyntax s Bool (-<@-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (<@-) :: QGenExpr context PgExpressionSyntax s a -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (-&&-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (-<<-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (->>-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (-&<-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (-&>-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (--|--) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool (-+-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) (-*-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -- | The postgres range operator - . (-.-) :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) rLower_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (Maybe a) rUpper_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (Maybe a) isEmpty_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool lowerInc_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool upperInc_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool lowerInf_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool upperInf_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s Bool rangeMerge_ :: QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -> QGenExpr context PgExpressionSyntax s (PgRange n a) -- | Postgres bool_or aggregate. Returns true if any of the rows -- are true. pgBoolOr :: QExpr PgExpressionSyntax s a -> QAgg PgExpressionSyntax s (Maybe Bool) -- | Postgres bool_and aggregate. Returns false unless every row -- is true. pgBoolAnd :: QExpr PgExpressionSyntax s a -> QAgg PgExpressionSyntax s (Maybe Bool) -- | Joins the string value in each row of the first argument, using the -- second argument as a delimiter. See pgStringAggOver if you want -- to provide explicit quantification. pgStringAgg :: IsSqlExpressionSyntaxStringType PgExpressionSyntax str => QExpr PgExpressionSyntax s str -> QExpr PgExpressionSyntax s str -> QAgg PgExpressionSyntax s (Maybe str) -- | The Postgres string_agg function, with an explicit -- quantifier. Joins the values of the second argument using the -- delimiter given by the third. pgStringAggOver :: IsSqlExpressionSyntaxStringType PgExpressionSyntax str => Maybe PgAggregationSetQuantifierSyntax -> QExpr PgExpressionSyntax s str -> QExpr PgExpressionSyntax s str -> QAgg PgExpressionSyntax s (Maybe str) -- | Modify a query to only return rows where the supplied key function -- returns a unique value. This corresponds to the Postgres DISTINCT -- ON support. pgNubBy_ :: (Projectible PgExpressionSyntax key, Projectible PgExpressionSyntax r) => (r -> key) -> Q PgSelectSyntax db s r -> Q PgSelectSyntax db s r -- | Postgres NOW() function. Returns the server's timestamp now_ :: QExpr PgExpressionSyntax s LocalTime -- | Postgres ILIKE operator. A case-insensitive version of -- like_. ilike_ :: IsSqlExpressionSyntaxStringType PgExpressionSyntax text => QExpr PgExpressionSyntax s text -> QExpr PgExpressionSyntax s text -> QExpr PgExpressionSyntax s Bool runBeamPostgres :: Connection -> Pg a -> IO a runBeamPostgresDebug :: (String -> IO ()) -> Connection -> Pg a -> IO a -- | Represents an extension in a database. -- -- For example, to include the Database.Beam.Postgres.PgCrypto -- extension in a database, -- --
--   import Database.Beam.Migrate.PgCrypto
--   
--   data MyDatabase entity
--       = MyDatabase
--       { _table1 :: entity (TableEntity Table1)
--       , _cryptoExtension :: entity (PgExtensionEntity PgCrypto)
--       }
--   
--   migratableDbSettings :: CheckedDatabaseSettings Postgres MyDatabase
--   migratableDbSettings = defaultMigratableDbSettings
--   
--   dbSettings :: DatabaseSettings Postgres MyDatabase
--   dbSettings = unCheckDatabase migratableDbSettings
--   
-- -- Note that our database now only works in the Postgres backend. -- -- Extensions are implemented as records of functions and values that -- expose extension functionality. For example, the pgcrypto -- extension (implemented by PgCrypto) provides cryptographic -- functions. Thus, PgCrypto is a record of functions over -- QGenExpr which wrap the underlying postgres functionality. -- -- You get access to these functions by retrieving them from the entity -- in the database. -- -- For example, to use the pgcrypto extension in the database -- above: -- --
--   let PgCrypto { pgCryptoDigestText = digestText
--                , pgCryptoCrypt = crypt } = getPgExtension (_cryptoExtension dbSettings)
--   in fmap_ (tbl -> (tbl, crypt (_field1 tbl) (_salt tbl))) (all_ (table1 dbSettings))
--   
-- -- To implement your own extension, create a record type, and implement -- the IsPgExtension type class. data PgExtensionEntity extension -- | Type class implemented by any Postgresql extension class IsPgExtension extension -- | Return the name of this extension. This should be the string that is -- passed to CREATE EXTENSION. For example, PgCrypto -- returns "pgcrypto". pgExtensionName :: IsPgExtension extension => Proxy extension -> Text -- | Return a value of this extension type. This should fill in all fields -- in the record. For example, PgCrypto builds a record where -- each function wraps the underlying Postgres one. pgExtensionBuild :: IsPgExtension extension => extension -- | Migration representing the Postgres CREATE EXTENSION -- command. Because the extension name is statically known by the -- extension type and IsPgExtension type class, this simply -- produces the checked extension entity. -- -- If you need to use the extension in subsequent migration steps, use -- getPgExtension and unCheck to get access to the -- underlying DatabaseEntity. pgCreateExtension :: forall extension db. IsPgExtension extension => Migration PgCommandSyntax (CheckedDatabaseEntity Postgres db (PgExtensionEntity extension)) -- | Migration representing the Postgres DROP EXTENSION. -- After this executes, you should expect any further uses of the -- extension to fail. Unfortunately, without linear types, we cannot -- check this. pgDropExtension :: forall extension. CheckedDatabaseEntityDescriptor Postgres (PgExtensionEntity extension) -> Migration PgCommandSyntax () -- | Get the extension record from a database entity. See the documentation -- for PgExtensionEntity. getPgExtension :: DatabaseEntity Postgres db (PgExtensionEntity extension) -> extension -- | Exception thrown if conversion from a SQL value to a Haskell value -- fails. data ResultError -- | The SQL and Haskell types are not compatible. Incompatible :: String -> Maybe Oid -> String -> String -> String -> ResultError [errSQLType] :: ResultError -> String [errSQLTableOid] :: ResultError -> Maybe Oid [errSQLField] :: ResultError -> String [errHaskellType] :: ResultError -> String [errMessage] :: ResultError -> String -- | A SQL NULL was encountered when the Haskell type did not -- permit it. UnexpectedNull :: String -> Maybe Oid -> String -> String -> String -> ResultError [errSQLType] :: ResultError -> String [errSQLTableOid] :: ResultError -> Maybe Oid [errSQLField] :: ResultError -> String [errHaskellType] :: ResultError -> String [errMessage] :: ResultError -> String -- | The SQL value could not be parsed, or could not be represented as a -- valid Haskell value, or an unexpected low-level error occurred (e.g. -- mismatch between metadata and actual data in a row). ConversionFailed :: String -> Maybe Oid -> String -> String -> String -> ResultError [errSQLType] :: ResultError -> String [errSQLTableOid] :: ResultError -> Maybe Oid [errSQLField] :: ResultError -> String [errHaskellType] :: ResultError -> String [errMessage] :: ResultError -> String data SqlError SqlError :: ByteString -> ExecStatus -> ByteString -> ByteString -> ByteString -> SqlError [sqlState] :: SqlError -> ByteString [sqlExecStatus] :: SqlError -> ExecStatus [sqlErrorMsg] :: SqlError -> ByteString [sqlErrorDetail] :: SqlError -> ByteString [sqlErrorHint] :: SqlError -> ByteString data Connection data ConnectInfo ConnectInfo :: String -> Word16 -> String -> String -> String -> ConnectInfo [connectHost] :: ConnectInfo -> String [connectPort] :: ConnectInfo -> Word16 [connectUser] :: ConnectInfo -> String [connectPassword] :: ConnectInfo -> String [connectDatabase] :: ConnectInfo -> String -- | Default information for setting up a connection. -- -- Defaults are as follows: -- -- -- -- Use as in the following example: -- --
--   connect defaultConnectInfo { connectHost = "db.example.com" }
--   
defaultConnectInfo :: ConnectInfo -- | Attempt to make a connection based on a libpq connection string. See -- https://www.postgresql.org/docs/9.5/static/libpq-connect.html#LIBPQ-CONNSTRING -- for more information. Also note that environment variables also affect -- parameters not provided, parameters provided as the empty string, and -- a few other things; see -- https://www.postgresql.org/docs/9.5/static/libpq-envars.html -- for details. Here is an example with some of the most commonly used -- parameters: -- --
--   host='db.somedomain.com' port=5432 ...
--   
-- -- This attempts to connect to db.somedomain.com:5432. Omitting -- the port will normally default to 5432. -- -- On systems that provide unix domain sockets, omitting the host -- parameter will cause libpq to attempt to connect via unix domain -- sockets. The default filesystem path to the socket is constructed from -- the port number and the DEFAULT_PGSOCKET_DIR constant defined -- in the pg_config_manual.h header file. Connecting via unix -- sockets tends to use the peer authentication method, which is -- very secure and does not require a password. -- -- On Windows and other systems without unix domain sockets, omitting the -- host will default to localhost. -- --
--   ... dbname='postgres' user='postgres' password='secret \' \\ pw'
--   
-- -- This attempts to connect to a database named postgres with -- user postgres and password secret ' \ pw. Backslash -- characters will have to be double-quoted in literal Haskell strings, -- of course. Omitting dbname and user will both -- default to the system username that the client process is running as. -- -- Omitting password will default to an appropriate password -- found in the pgpass file, or no password at all if a matching -- line is not found. See -- https://www.postgresql.org/docs/9.5/static/libpq-pgpass.html -- for more information regarding this file. -- -- As all parameters are optional and the defaults are sensible, the -- empty connection string can be useful for development and exploratory -- use, assuming your system is set up appropriately. -- -- On Unix, such a setup would typically consist of a local postgresql -- server listening on port 5432, as well as a system user, database -- user, and database sharing a common name, with permissions granted to -- the user on the database. -- -- On Windows, in addition you will either need pg_hba.conf to -- specify the use of the trust authentication method for the -- connection, which may not be appropriate for multiuser or production -- machines, or you will need to use a pgpass file with the -- password or md5 authentication methods. -- -- See -- https://www.postgresql.org/docs/9.5/static/client-authentication.html -- for more information regarding the authentication process. -- -- SSL/TLS will typically "just work" if your postgresql server supports -- or requires it. However, note that libpq is trivially vulnerable to a -- MITM attack without setting additional SSL connection parameters. In -- particular, sslmode needs to be set to require, -- verify-ca, or verify-full in order to perform -- certificate validation. When sslmode is require, -- then you will also need to specify a sslrootcert file, -- otherwise no validation of the server's identity will be performed. -- Client authentication via certificates is also possible via the -- sslcert and sslkey parameters. See -- https://www.postgresql.org/docs/9.5/static/libpq-ssl.html for -- detailed information regarding libpq and SSL. connectPostgreSQL :: ByteString -> IO Connection -- | Connect with the given username to the given database. Will throw an -- exception if it cannot connect. connect :: ConnectInfo -> IO Connection close :: Connection -> IO ()