CREATE DATABASE dbname (OWNER name);
\c(onnect) dbname
\i some/script.sql
Type of runInsertReturning
is:
runInsertReturning :: Default QueryRunner returned haskells =>
Connection ->
Table columnsW columnsR ->
columnsW ->
(columnsR -> returned) ->
IO [haskells]
You have to write out the type of IO [haskells]
(whether that be Int
,
UUID
, whatever) so that the function can return a concrete type, otherwise it
doesn’t know what to return.
[haskells]
is the type var for what is returning… deckId
is an Int
, so
therefore we have IO [Int]
as the return type.
returned
and haskells
are constrained by the same typeclass, as they are
representing the same exact ‘thing’ being returned.