Module
Control.Monad.Postgres.Session
- Package
- purescript-postgresql
- Repository
- cakekindel/purescript-postgresql
#MonadSession Source
class MonadSession :: (Type -> Type) -> Constraint
class (MonadAff m) <= MonadSession m where
A monad representing a connected session to a database
Members
query :: forall q r. AsQuery q => FromRows r => q -> m r
exec :: forall q. AsQuery q => q -> m Int
Executes a query and returns the number of rows affected
exec_ :: forall q. AsQuery q => q -> m Unit
Executes a query and discards the result
streamIn :: String -> m (Writable ())
Execute a query with a
Writable
stream toSTDIN
Use with
COPY .. FROM
like so:w <- streamIn "COPY foo FROM STDIN WITH (FORMAT CSV, HEADER true)" liftEffect $ Stream.writeString "bar\n\"my bar column\"" UTF8 w
streamOut :: String -> m (Readable ())
Execute a query with a
Readable
stream fromSTDOUT
Use with
COPY .. TO
like so:r <- streamIn "COPY foo TO STDIN WITH (FORMAT CSV, HEADER true)" liftEffect $ Stream.readString r -- "bar\n\"my bar column\""
Instances
(MonadAff m) => MonadSession (SessionT m)
- Modules
- Control.
Monad. Postgres - Control.
Monad. Postgres. Base - Control.
Monad. Postgres. Cursor - Control.
Monad. Postgres. Session - Data.
Postgres - Data.
Postgres. Custom - Data.
Postgres. Custom. Enum - Data.
Postgres. Query - Data.
Postgres. Query. Builder - Data.
Postgres. Range - Data.
Postgres. Raw - Data.
Postgres. Result - Data.
Postgres. Unresult - Effect.
Aff. Postgres. Client - Effect.
Aff. Postgres. Pool - Effect.
Postgres. Client - Effect.
Postgres. Pool - Pipes.
Postgres
Executes a query and unmarshals the result into
r