haskell-beam / haskell-beam/beam

haskellSchema generates import statements that are not up to date with the rest of the library

Open
#395 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Haskell
Stars
635
Forks
193
PR merge metrics
No merged PRs in 30d

Description

Hello! I have started looking at Beam, thanks for your great contribution to the Haskell world!
I wanted to see what haskellSchema produced. I downloaded the latest master and built it with stack. In ghci, I made a connection to my Postgres test database, then I ran:

λ> runBeamPostgres conn (haskellSchema migrationBackend)

Among other things, it generates the following import statement:

import Database.Beam.Migrate
(BeamMigrateSqlBackend, CheckedDatabaseSettings, Migration,
boolean, createTable, field, int, notNull, runMigrationSilenced,
unCheckDatabase, varchar)

The problem is if we try to run the file containing this import statement, ghc will not find the boolean, int, and varchar types:

error:
Module ‘Database.Beam.Migrate’ does not export ‘boolean’
13 | boolean, createTable, field, int, notNull, runMigrationSilenced,
| ^^^^^^^
error:
Module ‘Database.Beam.Migrate’ does not export ‘int’
13 | boolean, createTable, field, int, notNull, runMigrationSilenced,
| ^^^

error:
Module ‘Database.Beam.Migrate’ does not export ‘varchar’
14 | unCheckDatabase, varchar)
| ^^^^^^^

Apparently, these types are now in the module Database.Beam.Query.DataTypes.

I can always edit the import statement of the generated file, so that it works, so this is not blocking me, but I thought it might help others too if these were fixed. I tried to look in the code myself to see if I could fix it, but it is beyond my Haskell level at the moment :(

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.