| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.HDBC.PostgreSQL.Pure
Description
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 } =definConfig{ 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: " <>showcode , decodeString = code -> case code of "UTF8" ->pure.toString; _ ->const$fail$ "unexpected character code: " <>showcode }
Constructors
| Config | |
Fields
| |
data Connection Source #
PostgreSQL connection.
Instances
| IConnection Connection Source # | |
Defined in Database.HDBC.PostgreSQL.Pure Methods 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.
Constructors
| 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 |
Methods toField :: MonadFail m => BackendParameters -> StringEncoder -> Maybe Oid -> FormatCode -> Rational -> m (Maybe ByteString) Source # | |
| ToField SqlValue Source # | |
Methods toField :: MonadFail m => BackendParameters -> StringEncoder -> Maybe Oid -> FormatCode -> SqlValue -> m (Maybe ByteString) Source # | |
| FromField SqlValue Source # | |
Methods fromField :: MonadFail m => StringDecoder -> ColumnInfo -> Maybe ByteString -> m SqlValue Source # | |
| Convertible Oid SqlTypeId Source # | |
Methods safeConvert :: Oid -> ConvertResult SqlTypeId # | |