Can Haskell's Opaleye DSL generate any given SQL?

236 Views Asked by At

My team uses Opaleye to query Postgres from Haskell.

However, we also use raw SQL to do such things as:

  • Initialize the database. Including commands create database and create table

  • Perform database migrations when we change our schema, including varied commands.

Is it possible to entirely replace this raw SQL code with Opaleye?

Can Opaleye replace any SQL?

1

There are 1 best solutions below

0
On BEST ANSWER

According to the Opaleye tutorial, creating tables and databases is currently unsupported:

Opaleye assumes that a Postgres database already exists. Currently there is no support for creating databases or tables, though these features may be added later according to demand.