-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
jochenehret
commented
Jul 13, 2022
•
edited
Loading
edited
- 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"
* 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
philippthun
reviewed
Jul 18, 2022
helpers/mysql_stored_procedures.go
Outdated
CLOSE orgs_cursor; | ||
END; | ||
`}, | ||
} |
There was a problem hiding this comment.
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.
c20bd53
to
8a433a7
Compare
* and temporarily add debug messages
* better IDE support
* and delete MySQL stored procedures from Go sources
* and refactor db type constants to make them public
* Error 1235: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
* and cleanup FUNCTIONs
* MySQL returns an array of uint8 which can't be converted directly to a string: "interface conversion: interface {} is []uint8, not string"
philippthun
reviewed
Jul 20, 2022
scripts/mysql/create_service_keys_for_service_instances.tmpl.sql
Outdated
Show resolved
Hide resolved
* 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.