Open
Description
I have found these related issues/pull requests
#3181 introduced a --no-transaction
directive specifically so that things like CREATE INDEX CONCURRENTLY
or CREATE DATABASE
could be run on Postgres.
Description
But if you include more than one statement in a query Postgres starts an implicit transaction, which means that you can only run a single statement per migration file. This quickly becomes frustrating.
Prefered solution
I propose the addition of a -- sqlx: split migration
directive that allows doing something like this:
-- no-transaction
CREATE INDEX CONCURRENTLY ...
-- sqlx: split migration
CREATE INDEX CONCURRENTLY ...
Then sqlx literally calls split()
on the migration string and runs multiple queries instead of a single one.
Is this a breaking change? Why or why not?
I don't think it has to be.