Automatically Generating Types for Tables with Large Numbers of Columns #238
-
How do folks create types for tables with 100 columns? Doing it by hand is extremely tedious. I had a look at opaleye-gen but it is very bit-rotted and even when I got it to compile, it failed on a particular table type I can automate some of what I need by exporting the table to CSV and then using Frames but it is still a pain. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
PostgreSQL has all information about tables itself as metadata tables. What I tend to do is to query this metadata in a |
Beta Was this translation helpful? Give feedback.
PostgreSQL has all information about tables itself as metadata tables. What I tend to do is to query this metadata in a
SELECT
statement, and I format it with a bunch ofstring_agg
and stuff so that it actually produces Haskell. Have a look at #59, which I think shows some of these metadata tables. Infact, that very PR might do the job for you.