rel8 icon indicating copy to clipboard operation
rel8 copied to clipboard

WIP: Add schema-to-rel8

Open ocharles opened this issue 4 years ago • 1 comments

This executable takes a database connection string and a schema name, and prints out Haskell code to STDOUT that defines all data types along with corresponding TableSchemas.

For example:

cabal run schema-to-rel8 -- --connection="dbname=foo user=bar" --schema="public"

ocharles avatar Jun 19 '21 15:06 ocharles

Hi, drive by contribution here, because I was messing with rel8 and ended up using your script.

  1. Bugfix: the script was using the table name in place of the schema name.
  2. Suggested, but questionable, improvement: deduplicate the definition of the field name. I'm not attached to this commit at all.

#210

FYI I think this script is findable and useful even if just sits here in this PR forever.

Thanks,

peterwicksstringfield avatar Oct 21 '22 22:10 peterwicksstringfield