Module
Data.Postgres.Result
- Package
- purescript-postgresql
- Repository
- cakekindel/purescript-postgresql
#rowsAffected Source
rowsAffected :: Result -> Maybe Int
Returns the number of rows affected by the query
https://node-postgres.com/apis/result#resultrowcount-int--null
#RowsAffected Source
#FromRow Source
class FromRow (a :: Type) where
Can be unmarshalled from a queried row
Implementations are provided for:
- tuples of any length containing types that are
Rep
- tuples of any length with the last member of
Array Raw
- a single value of a type that is
Rep
Array Raw
Unit
(always succeeds)
-- CREATE TABLE foo
-- ( id INT NOT NULL PRIMARY KEY
-- , fruit TEXT NOT NULL
-- , created TIMESTAMPTZ NOT NULL DEFAULT NOW()
-- );
do
let q = query "select id, fruit, created from foo" client
-- pick all 3 columns explicitly
_ :: Array (Int /\ String /\ DateTime) <- q
-- pick first 2 columns, discarding any others
_ :: Array (Int /\ String) <- q
-- pick first 2 columns, if any more keep as `Array Raw`
_ :: Array (Int /\ String /\ Array Raw) <- q
-- pick just the ID, discarding all other columns
id :: Array Int <- q
pure unit
Members
Instances
- 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. Interval - 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. Error - Effect.
Postgres. Error. Common - Effect.
Postgres. Error. Except - Effect.
Postgres. Error. RE - Effect.
Postgres. Pool - Node.
FS. PinnedVersion - Pipes.
Postgres
Minimum length of row for type
a