Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add MySQL DECLARE statements #66

Open
alexdunae opened this issue Aug 16, 2017 · 1 comment
Open

Ability to add MySQL DECLARE statements #66

alexdunae opened this issue Aug 16, 2017 · 1 comment
Labels

Comments

@alexdunae
Copy link

Hi there - thanks for the great gem.

I'm currently unable to use MySQL DECLARE statements to declare local variables in conjunction with the conditional of from the gem, since they appear after the opening IF THEN that is generated. MySQL requires any declared variables to be immediately after the BEFORE statement.

Is this something you'd consider adding support for? I'm unsure if MySQL's declare is the same as Postgres's. If so, I'd be happy to open a PR with MySQL support. If not, would you be open to adding an option for code to run immediately after the opening BEGIN?

@jenseng
Copy link
Owner

jenseng commented Aug 26, 2017

Hi @alexdunae, I'd happily accept a PR for this. Note that the declare syntax is a little different between MySQL and Postgres, and it occurs in different spots (before the BEGIN in Postgres, after it in MySQL).

Regardless, it seems like Hairtrigger's declare could be reworked so that it does the right thing for MySQL (whether or not you're using of)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants