Module

Effect.Aff.Postgres.Client

Package
purescript-postgresql
Repository
cakekindel/purescript-postgresql

#connected Source

connected :: forall r missing trash. Union r missing (Config trash) => Record r -> Aff Client

Create a client and immediately connect it to the database

The config parameter r is Config with all keys optional.

This is a shorthand for (voidRight <*> connect) =<< liftEffect (make cfg)

#connect Source

#end Source

end :: Client -> Aff Unit

Disconnects the client from the database

https://node-postgres.com/apis/client#clientend

#exec Source

exec :: forall q. AsQuery q => q -> Client -> Aff Int

Performs a query that we expect to not yield any rows, returning the number of rows affected by the statement.

https://node-postgres.com/apis/client#clientquery

#query Source

query :: forall q r. AsQuery q => FromRows r => q -> Client -> Aff r

Performs a query that we expect to yield rows, returning them unmarshalled into destination type r.

https://node-postgres.com/apis/client#clientquery

#queryRaw Source

queryRaw :: forall q. AsQuery q => q -> Client -> Aff Result

Performs a query, returning the raw Result object

https://node-postgres.com/apis/client#clientquery

#__connect Source

__connect :: Client -> Effect (Promise Unit)

FFI binding to Client#connect

#__end Source

__end :: Client -> Effect (Promise Unit)

FFI binding to Client#end

#__query Source

__query :: QueryRaw -> Client -> Effect (Promise Result)

FFI binding to Client#query

Re-exports from Effect.Postgres.Client

#NotificationRaw Source

type NotificationRaw = { channel :: String, payload :: Nullable String, processId :: Number }

FFI

#Notification Source

type Notification = { channel :: String, payload :: Maybe String, processId :: Number }

A notification raised by NOTIFY

#Config Source

type Config :: Row Type -> Row Typetype Config r = (applicationName :: String, connectionString :: String, connectionTimeout :: Milliseconds, database :: String, host :: String, idleInTransactionTimeout :: Milliseconds, password :: String, port :: Number, queryTimeout :: Milliseconds, statementTimeout :: Milliseconds, user :: String | r)

Client connection config

#ClientConfigRaw Source

#Client Source

data Client

Database connection

#make Source

make :: forall @r @missing @trash. Union r missing (Config trash) => Record r -> Effect Client

Creates a new client, not yet connected to the database.

The config parameter r is Config with all keys optional.

https://node-postgres.com/apis/client#new-client

#__uncfg Source

__uncfg :: { unwrapMillis :: Milliseconds -> Number } -> Foreign -> ClientConfigRaw

FFI