From 4178f9005e2470cc98b9e2a1e77af7b36261d0b4 Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Fri, 6 Oct 2017 19:03:22 +0530 Subject: [PATCH] Makes `Array Foreign` an instance of ToSQLRow For when the user wants to convert the values to foreign by themselves. --- src/Database/PostgreSQL/Row.purs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Database/PostgreSQL/Row.purs b/src/Database/PostgreSQL/Row.purs index a765f7c..01246c4 100644 --- a/src/Database/PostgreSQL/Row.purs +++ b/src/Database/PostgreSQL/Row.purs @@ -13,6 +13,9 @@ class ToSQLRow a where -- | Convert things from SQL rows. class FromSQLRow a where fromSQLRow :: Array Foreign -> Either String a + +instance toSQLRowForeignArray :: ToSQLRow (Array Foreign) where + toSQLRow = id -- | A row with 0 fields. data Row0 = Row0 @@ -602,4 +605,4 @@ instance fromSQLRowRow19 :: (FromSQLValue a, FromSQLValue b, FromSQLValue c, Fro instance toSQLRowRow19 :: (ToSQLValue a, ToSQLValue b, ToSQLValue c, ToSQLValue d, ToSQLValue e, ToSQLValue f, ToSQLValue g, ToSQLValue h, ToSQLValue i, ToSQLValue j, ToSQLValue k, ToSQLValue l, ToSQLValue m, ToSQLValue n, ToSQLValue o, ToSQLValue p, ToSQLValue q, ToSQLValue r, ToSQLValue s) => ToSQLRow (Row19 a b c d e f g h i j k l m n o p q r s) where toSQLRow (Row19 a b c d e f g h i j k l m n o p q r s) = - [toSQLValue a, toSQLValue b, toSQLValue c, toSQLValue d, toSQLValue e, toSQLValue f, toSQLValue g, toSQLValue h, toSQLValue i, toSQLValue j, toSQLValue k, toSQLValue l, toSQLValue m, toSQLValue n, toSQLValue o, toSQLValue p, toSQLValue q, toSQLValue r, toSQLValue s] \ No newline at end of file + [toSQLValue a, toSQLValue b, toSQLValue c, toSQLValue d, toSQLValue e, toSQLValue f, toSQLValue g, toSQLValue h, toSQLValue i, toSQLValue j, toSQLValue k, toSQLValue l, toSQLValue m, toSQLValue n, toSQLValue o, toSQLValue p, toSQLValue q, toSQLValue r, toSQLValue s]