haskell-beam / haskell-beam/beam

Table with no primary key seems to cause an out of memory error during schema migration

Open
#573 4 comments 0 reactions 0 assignees View on GitHub
bug migration-framework
Dominant language
Haskell
Stars
635
Forks
193
PR merge metrics
No merged PRs in 30d

Description

I'm getting the following error in what appears to be one of either `verifySchema` or `autoMigrate`.

```
internal error: Unable to commit 1048576 bytes of memory
(GHC version 8.6.5 for x86_64_unknown_linux)
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```

We ended up finding that the problem seems to be related to having a table with no primary key. The `Table` instance was defined like this.

```
instance Table FooT where
data PrimaryKey FooT f = FooNoId
deriving stock (Generic)
deriving anyclass (Beamable)
primaryKey _ = FooNoId
```

But when we changed it to have a primary key, the above memory crash went away. I don't have time to dig into the details at the moment, but I wanted to record this behavior in case anyone else runs into it.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.