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. |
Answered by
ocharles
Jun 7, 2023
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 |
1 reply
Answer selected by
idontgetoutmuch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PostgreSQL has all information about tables itself as metadata tables. What I tend to do is to query this metadata in a
SELECTstatement, and I format it with a bunch ofstring_aggand 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.