PostgreSQL Simple supports only up 10 variables in a tuple, but I need more

307 Views Asked by At

I have a postgresql table with a bunch of columns, it's around 20-30 columns. Posgresql Simple supports only up 10 variables in a tuple https://hackage.haskell.org/package/postgresql-simple-0.5.0.0/candidate/docs/Database-PostgreSQL-Simple-ToRow.html#v:toRow

It's not enough for me. How can I fix that? I can't use the original "data" I have. If I use it for insertion then the "id" and other fields generated by Postgresql will be passed from a client and it'll cause an exception.

Creating a new "data" and then implementing FromJson and possibly other intances might be overkill. Then is there any other solution?

1

There are 1 best solutions below

0
On

Just use (:.) operator to combine several tuples into one row. There are instances defined for both FromRow and ToRow