Module

Yoga.Postgres.OmLayer

Package
purescript-yoga-postgres-om
Repository
rowtype-yoga/purescript-yoga-postgres-om

#PostgresConfig Source

type PostgresConfig = { database :: PostgresDatabase, host :: PostgresHost, password :: PostgresPassword, port :: PostgresPort, username :: PostgresUsername }

Postgres configuration

#PostgresL Source

type PostgresL :: Row Type -> Row Typetype PostgresL r = (postgresConnection :: Connection | r)

Row type for Postgres service

#postgresLayer Source

postgresLayer :: forall r. OmLayer (postgresConfig :: PostgresConfig | r) (PostgresL ()) (Record (PostgresL ()))

Create a Postgres layer that provides Connection as a service Requires PostgresConfig in context

#postgresLayer' Source

postgresLayer' :: forall r. PostgresConfig -> OmLayer r (PostgresL ()) (Record (PostgresL ()))

Create a Postgres layer with inline config Useful when you don't need config from context

#noContext Source

noContext :: Record ()

Helper to avoid the annoying ({} :: {}) pattern