Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Config = Config {}
- data Connection
- data Address
- withConnection :: Config -> (Connection -> IO a) -> IO a
- connect :: Config -> IO Connection
- begin :: Connection -> IO ()
Connection
A configuration of a connection.
Default configuration is def
, which is following.
letConfig
{ address, user, password, database, sendingBufferSize, receptionBufferSize } =def
inConfig
{ address = address , user = user , password = password , database = database , sendingBufferSize = sendingBufferSize , receptionBufferSize = receptionBufferSize , encodeString = code -> case code of "UTF8" ->pure
.fromString
; _ ->const
$fail
$ "unexpected character code: " <>show
code , decodeString = code -> case code of "UTF8" ->pure
.toString
; _ ->const
$fail
$ "unexpected character code: " <>show
code }
Config | |
|
data Connection Source #
PostgreSQL connection.
Instances
IConnection Connection Source # | |
Defined in Database.HDBC.PostgreSQL.Pure disconnect :: Connection -> IO () # commit :: Connection -> IO () # rollback :: Connection -> IO () # runRaw :: Connection -> String -> IO () # run :: Connection -> String -> [SqlValue] -> IO Integer # prepare :: Connection -> String -> IO Statement # clone :: Connection -> IO Connection # hdbcDriverName :: Connection -> String # hdbcClientVer :: Connection -> String # proxiedClientName :: Connection -> String # proxiedClientVer :: Connection -> String # dbServerVer :: Connection -> String # dbTransactionSupport :: Connection -> Bool # getTables :: Connection -> IO [String] # describeTable :: Connection -> String -> IO [(String, SqlColDesc)] # |
IP address.
AddressResolved SockAddr | Address which is DNS resolved. |
AddressNotResolved HostName ServiceName | Address which is not DNS resolved. |
withConnection :: Config -> (Connection -> IO a) -> IO a Source #
Bracket function for a connection.
Transaction
begin :: Connection -> IO () Source #
To send BEGIN
SQL statement.
Orphan instances
ToField Rational Source # | Security risk of DoS attack. You should convert |
toField :: MonadFail m => BackendParameters -> StringEncoder -> Maybe Oid -> FormatCode -> Rational -> m (Maybe ByteString) Source # | |
ToField SqlValue Source # | |
toField :: MonadFail m => BackendParameters -> StringEncoder -> Maybe Oid -> FormatCode -> SqlValue -> m (Maybe ByteString) Source # | |
FromField SqlValue Source # | |
fromField :: MonadFail m => StringDecoder -> ColumnInfo -> Maybe ByteString -> m SqlValue Source # | |
Convertible Oid SqlTypeId Source # | |
safeConvert :: Oid -> ConvertResult SqlTypeId # |