Beam generate database schema - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Bolt

Hi, does anyone knows if it is possible to generate the database creation schema in Beam by just using the types? I already read the documentation and they say it's possible however, when trying to set it up with Postgres I fail. I already opened an issue but the responses are slow.

https://github.com/tathougies/beam/issues/454 here's the issue for more context!

Hi! I'm having the following error: • Couldn't match type ‘Database.Beam.Backend.SQL.SQL92.Sql92ExpressionCastTargetSyntax (Database.Beam.Backend.SQL.SQL92.Sql92SelectTableExpressionSyntax ...
Sandy Maguire

do you have a codebase i can play with?

Sandy Maguire

my guess is be should be Postgres

Sandy Maguire

i can't even get your code sample to the error you're showing

Bolt

@Sandy Maguire Hey I managed to get it working with your help! I needed to change the fields to Text now everything is fine!

Bolt

Here's the final product: https://github.com/bolt12/generic-crud/tree/master

Generic CRUD REST server with Servant, Beam and Polysemy - bolt12/generic-crud