beam
                                
                                 beam copied to clipboard
                                
                                    beam copied to clipboard
                            
                            
                            
                        `beam-migrate simple schema` fails on all but empty database
Based on instructions at #27 I run stack exec -- beam-migrate simple schema --backend Database.Beam.Postgres.Migrate --connection "dbname=<my db> user=<my user> password=<my pw>" to create a schema from an existing database, but:
- Running on my full (complex) postgres database results in beam-migrateoccupying all available memory then coredumping.
- Running on a test database with even one table results in beam-migrate: user error (Could not form haskell schema)
- Running on a completely empty test database seems to work OK.
Using beam master branch and Postgresql 10.4 on Arch linux.
What is the database schema?
It fails even with something as simple as:
CREATE TABLE public.test_table ( );
ALTER TABLE public.test_table OWNER TO postgres;
This results in the Could not form haskell schema error.
I am experiencing the same issue with current master (24a96f2f8d53558c33f1fe4031bd0687f9511e01):
$ stack exec -- beam-migrate simple schema --connection postgres://postgres@localhost:5432/postgres --backend Database.Beam.Postgres.Migrate
beam-migrate: user error (Could not form haskell schema)
Dump works however:
$ stack exec -- beam-migrate simple dump --connection postgres://postgres@localhost:5432/postgres --backend Database.Beam.Postgres.Migrate
- predicates:
  - has-column:
      type: int
      column: meh
      table: foo
  - table-exists: foo
  specificity:
  - backend: Database.Beam.Postgres.Migrate
PostgreSQL 10.6, with DDL:
create table foo (meh int);
@tathougies I made an attempt at digging into this with Debug.Trace but foundered quickly on an inability to derive Show on most of the types used inside heuristicSolver. Any thoughts on how to debug?
Which types in particular? You should be able to get away with the various debug functions in DatabasePredicate.