diff --git a/README.md b/README.md index d61299f..62968cf 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ data User = User instance Opium.FromRow User where getUsers :: Connection -> IO (Either Opium.Error [User]) -getUsers conn = Opium.fetch_ "SELECT * FROM user" conn +getUsers = Opium.fetch_ "SELECT * FROM user" ``` The `Opium.FromRow` instance is implemented generically for all product types ("records"). It looks up the field name in the query result and decodes the column value using `Opium.FromField`. @@ -51,7 +51,7 @@ instance Opium.FromRow ScoreByAge where getScoreByAge :: Connection -> IO ScoreByAge getScoreByAge conn = do let query = "SELECT regr_intercept(score, age) AS t, regr_slope(score, age) AS m FROM user" - Right [x] <- Opium.fetch_ query conn + Right (Identity x) <- Opium.fetch_ query conn pure x ```