Module

Database.PostgreSQL

Package
purescript-postgresql-client
Repository
rightfold/purescript-postgresql-client

#POSTGRESQL Source

#PoolConfiguration Source

type PoolConfiguration = { database :: String, host :: String, idleTimeoutMillis :: Int, max :: Int, password :: String, port :: Int, user :: String }

PostgreSQL connection pool configuration.

#Pool Source

data Pool :: Type

PostgreSQL connection pool.

#Connection Source

data Connection :: Type

PostgreSQL connection.

#Query Source

newtype Query i o

PostgreSQL query with parameter ($1, $2, …) and return types.

Constructors

Instances

#newPool Source

newPool :: forall eff. PoolConfiguration -> Aff (postgreSQL :: POSTGRESQL | eff) Pool

Create a new connection pool.

#withConnection Source

withConnection :: forall a eff. Pool -> (Connection -> Aff (postgreSQL :: POSTGRESQL | eff) a) -> Aff (postgreSQL :: POSTGRESQL | eff) a

Run an action with a connection. The connection is released to the pool when the action returns.

#withTransaction Source

withTransaction :: forall a eff. Connection -> Aff (postgreSQL :: POSTGRESQL | eff) a -> Aff (postgreSQL :: POSTGRESQL | eff) a

Run an action within a transaction. The transaction is committed if the action returns, and rolled back when the action throws. If you want to change the transaction mode, issue a separate SET TRANSACTION statement within the transaction.

#execute Source

execute :: forall eff o i. ToSQLRow i => Connection -> Query i o -> i -> Aff (postgreSQL :: POSTGRESQL | eff) Unit

Execute a PostgreSQL query and discard its results.

#query Source

query :: forall eff o i. ToSQLRow i => FromSQLRow o => Connection -> Query i o -> i -> Aff (postgreSQL :: POSTGRESQL | eff) (Array o)

Execute a PostgreSQL query and return its results.

#scalar Source

scalar :: forall eff o i. ToSQLRow i => FromSQLValue o => Connection -> Query i (Row1 o) -> i -> Aff (postgreSQL :: POSTGRESQL | eff) (Maybe o)

Execute a PostgreSQL query and return the first field of the first row in the result.

#unsafeQuery Source

unsafeQuery :: forall eff. Connection -> String -> Array Foreign -> Aff (postgreSQL :: POSTGRESQL | eff) (Array (Array Foreign))

Re-exports from Database.PostgreSQL.Row

#Row9 Source

data Row9 a b c d e f g h i

A row with 9 fields.

Constructors

  • Row9 a b c d e f g h i

Instances

#Row8 Source

data Row8 a b c d e f g h

A row with 8 fields.

Constructors

  • Row8 a b c d e f g h

Instances

#Row7 Source

data Row7 a b c d e f g

A row with 7 fields.

Constructors

Instances

#Row6 Source

data Row6 a b c d e f

A row with 6 fields.

Constructors

Instances

#Row5 Source

data Row5 a b c d e

A row with 5 fields.

Constructors

Instances

#Row4 Source

data Row4 a b c d

A row with 4 fields.

Constructors

Instances

#Row3 Source

data Row3 a b c

A row with 3 fields.

Constructors

Instances

#Row2 Source

data Row2 a b

A row with 2 fields.

Constructors

Instances

#Row19 Source

data Row19 a b c d e f g h i j k l m n o p q r s

A row with 19 fields.

Constructors

  • Row19 a b c d e f g h i j k l m n o p q r s

Instances

#Row18 Source

data Row18 a b c d e f g h i j k l m n o p q r

A row with 18 fields.

Constructors

  • Row18 a b c d e f g h i j k l m n o p q r

Instances

#Row17 Source

data Row17 a b c d e f g h i j k l m n o p q

A row with 17 fields.

Constructors

  • Row17 a b c d e f g h i j k l m n o p q

Instances

#Row16 Source

data Row16 a b c d e f g h i j k l m n o p

A row with 16 fields.

Constructors

  • Row16 a b c d e f g h i j k l m n o p

Instances

#Row15 Source

data Row15 a b c d e f g h i j k l m n o

A row with 15 fields.

Constructors

  • Row15 a b c d e f g h i j k l m n o

Instances

#Row14 Source

data Row14 a b c d e f g h i j k l m n

A row with 14 fields.

Constructors

  • Row14 a b c d e f g h i j k l m n

Instances

#Row13 Source

data Row13 a b c d e f g h i j k l m

A row with 13 fields.

Constructors

  • Row13 a b c d e f g h i j k l m

Instances

#Row12 Source

data Row12 a b c d e f g h i j k l

A row with 12 fields.

Constructors

  • Row12 a b c d e f g h i j k l

Instances

#Row11 Source

data Row11 a b c d e f g h i j k

A row with 11 fields.

Constructors

  • Row11 a b c d e f g h i j k

Instances

#Row10 Source

data Row10 a b c d e f g h i j

A row with 10 fields.

Constructors

  • Row10 a b c d e f g h i j

Instances

#Row1 Source

data Row1 a

A row with 1 field.

Constructors

Instances

#Row0 Source

data Row0

A row with 0 fields.

Constructors

Instances

#FromSQLRow Source

class FromSQLRow a  where

Convert things from SQL rows.

Members

Instances

#ToSQLRow Source

class ToSQLRow a  where

Convert things to SQL rows.

Members

Instances

Re-exports from Database.PostgreSQL.Value

#unsafeIsBuffer Source

unsafeIsBuffer :: forall a. a -> Boolean

#instantToString Source