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

CFP-1806 Add support for MySQL #22

Merged
merged 51 commits into from
Aug 19, 2022
Merged

CFP-1806 Add support for MySQL #22

merged 51 commits into from
Aug 19, 2022

Conversation

jochenehret
Copy link
Contributor

@jochenehret jochenehret commented Jul 13, 2022

  • add config options to specify database type: "postgres" or "mysql"
  • adapt stored procedures and cleanup statements to MySQL
  • remove "VACUUM" and "ANALYZE" commands for now

* "PostgreSQL" or "MySQL"
@jochenehret jochenehret marked this pull request as draft July 13, 2022 07:33
* first stored procedure for MySQL
* adapt sql file processing for MySQL
* add "ExecuteStoredProcedure" function to distinguish between "SELECT FROM procedure()" and "CALL procedure()"
* for MySQL, use cursors to iterate over result set (and continuation handlers for multiple iterations)
* storing all procedures in a file requires DELIMITER change which is not supported by the GoLang MySQL driver (same for other languages)
* also replace print with log statements
@jochenehret jochenehret changed the title CFP-1806 Add config option for db type CFP-1806 Add support for MySQL Jul 15, 2022
@jochenehret jochenehret marked this pull request as ready for review July 15, 2022 12:43
helpers/database.go Outdated Show resolved Hide resolved
helpers/mysql_stored_procedures.go Outdated Show resolved Hide resolved
helpers/mysql_stored_procedures.go Outdated Show resolved Hide resolved
helpers/mysql_stored_procedures.go Outdated Show resolved Hide resolved
helpers/mysql_stored_procedures.go Outdated Show resolved Hide resolved
helpers/mysql_stored_procedures.go Outdated Show resolved Hide resolved
CLOSE orgs_cursor;
END;
`},
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And a final comment on this file: maybe we could adapt the Postgres procedures to use the same (i.e. limited) syntax where available, e.g. CONCAT instead of || and WHILE instead of FOR. This would allow us to keep the differences to an absolute minimum.

@jochenehret jochenehret force-pushed the CFP-1806 branch 4 times, most recently from c20bd53 to 8a433a7 Compare July 18, 2022 13:56
* and temporarily add debug messages
* delete unnecessary statements
* change variable names so that they don't collide with column names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants