/Database/HDBC/PostgreSQL.hs

http://github.com/hdbc/hdbc-postgresql · Haskell · 82 lines · 13 code · 8 blank · 61 comment · 0 complexity · 41d9ddd589870f01de42d0c9d32aa831 MD5 · raw file

  1. {- |
  2. Module : Database.HDBC.PostgreSQL
  3. Copyright : Copyright (C) 2005-2011 John Goerzen
  4. License : BSD3
  5. Maintainer : John Goerzen <jgoerzen@complete.org>
  6. Stability : provisional
  7. Portability: portable
  8. HDBC driver interface for PostgreSQL 8.x
  9. Written by John Goerzen, jgoerzen\@complete.org
  10. /NOTE ON DATES AND TIMES/
  11. The recommended correspondence between PostgreSQL date and time types and HDBC SqlValue
  12. types is:
  13. * SqlLocalDate: DATE
  14. * SqlLocalTimeOfDay: TIME WITHOUT TIME ZONE
  15. * SqlZonedLocalTimeOfDay: TIME WITH TIME ZONE
  16. * SqlLocalTime: TIMESTAMP WITHOUT TIME ZONE
  17. * SqlZonedTime: TIMESTAMP WITH TIME ZONE
  18. * SqlUTCTime: TIMESTAMP WITH TIME ZONE
  19. * SqlDiffTime: INTERVAL
  20. * SqlPOSIXTime: NUMERIC
  21. * SqlEpochTime: INTEGER
  22. * SqlTimeDiff: INTERVAL
  23. Other combinations are possible, and may even be converted automatically.
  24. The above simply represents the types that seem the most logical correspondence,
  25. and thus are tested by the HDBC-PostgreSQL test suite.
  26. -}
  27. module Database.HDBC.PostgreSQL
  28. (
  29. -- * Connecting to Databases
  30. connectPostgreSQL, withPostgreSQL,
  31. connectPostgreSQL', withPostgreSQL',
  32. Connection,
  33. -- * Transactions
  34. begin,
  35. -- * PostgreSQL Error Codes
  36. --
  37. -- |When an @SqlError@ is thrown, the field @seState@ is set to one of the following
  38. -- error codes.
  39. module Database.HDBC.PostgreSQL.ErrorCodes,
  40. -- * Threading
  41. -- $threading
  42. )
  43. where
  44. import Database.HDBC.PostgreSQL.Connection(connectPostgreSQL, withPostgreSQL,
  45. connectPostgreSQL', withPostgreSQL',
  46. begin, Connection())
  47. import Database.HDBC.PostgreSQL.ErrorCodes
  48. {- $threading
  49. Provided the local libpq library is thread-safe, multiple 'Connection's may be used
  50. to have concurrent database queries. Concurrent queries issued on a single
  51. 'Connection' will be performed serially.
  52. When the local libpq library is not thread-safe (ie. it has not been compiled with
  53. --enable-thread-safety), only a single database function will be performed at a time.
  54. -}