nakagami / firebirdsql

Firebird RDBMS sql driver for Go (golang)
MIT License
220 stars 60 forks source link

Multi statement execution #155

Closed azapater closed 10 months ago

azapater commented 10 months ago

I'm thinking about using migrate for handling my FB databases but my problem is that migrations sometimes require multiple statements in one .sql file.

IE: creating a new field that needs to be updated based on another data from the db. It makes more sense from a reading point of view to include the ALTER TABLE X, UPDATE X and all the statements related with that migration in the same sql file.

The limitation I'm facing at the moment is that the FB driver doesn't support multistatement executions.

Are there any plans to do any implementation similar to the mysql driver that allows an extra parameter in the connection string for this kind of scenario?

Info from mysql driver

I understand that this is a bit of an anti-pattern when it comes to security, but exclusively for migrations IMO it would make sense.

Thanks in advance

nakagami commented 10 months ago

It would seem that parsing SQL statements to separate them with semicolons is necessary, but the driver does not have that capability. So I don't think it can support multiple statement execution.

azapater commented 10 months ago

Okay. Thanks for the info