git.iko.soy/typeable/postgresql-simple
on master help sign in
Rudimentary Large Object support
3ed6fffLeon P Smith
postgresql-simple.cabal+1
@@ -24,6 +24,7 @@ Library
24 Database.PostgreSQL.Simple
24 Database.PostgreSQL.Simple
25 Database.PostgreSQL.Simple.BuiltinTypes
25 Database.PostgreSQL.Simple.BuiltinTypes
26 Database.PostgreSQL.Simple.Field
26 Database.PostgreSQL.Simple.Field
27+ Database.PostgreSQL.Simple.LargeObjects
27 Database.PostgreSQL.Simple.Notification
28 Database.PostgreSQL.Simple.Notification
28 Database.PostgreSQL.Simple.Param
29 Database.PostgreSQL.Simple.Param
29 Database.PostgreSQL.Simple.Result
30 Database.PostgreSQL.Simple.Result
src/Database/PostgreSQL/Simple/LargeObjects.hsnew file+26
@@ -0,0 +1,26 @@
1+-----------------------------------------------------------------------------
2+-- |
3+-- Module : Database.PostgreSQL.Simple.LargeObjects
4+-- Copyright : (c) 2011 Leon P Smith
5+-- License : BSD3
6+--
7+-- Maintainer : leon@melding-monads.com
8+--
9+-----------------------------------------------------------------------------
10+
11+module Database.PostgreSQL.Simple.LargeObjects
12+ ( loImport
13+ , loExport
14+ , Oid(..)
15+ ) where
16+
17+import Database.PostgreSQL.LibPQ (Oid(..))
18+import qualified Database.PostgreSQL.LibPQ as PQ
19+import Database.PostgreSQL.Simple.Implementation
20+import Foreign.C.Types(CInt)
21+
22+loImport :: Connection -> FilePath -> IO (Maybe Oid)
23+loImport conn path = withConnection conn $ \c -> PQ.loImport c path
24+
25+loExport :: Connection -> Oid -> FilePath -> IO CInt
26+loExport conn oid path = withConnection conn $ \c -> PQ.loExport c oid path