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

feat: allow {delete,insert}().returning() on MariaDB #8673

Merged
merged 5 commits into from Feb 21, 2022
Merged

feat: allow {delete,insert}().returning() on MariaDB #8673

merged 5 commits into from Feb 21, 2022

Conversation

nix6839
Copy link
Contributor

@nix6839 nix6839 commented Feb 19, 2022

Closes: #7235

Description of change

  • Allow delete().returning() on MariaDB >= 10.0.5
  • Allow insert().returning() on MariaDB >= 10.5.0
  • Can check DML type(ex: select, update, delete) on
    Driver.isReturningSqlSupported() and QueryBuilder.createReturningExpression()

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

@nix6839
Copy link
Contributor Author

nix6839 commented Feb 19, 2022

It seems that need to add the MariaDB version (>= 10.5.0) of docker and check the version in the code.

@pleerock
Copy link
Member

It seems that need to add the MariaDB version (>= 10.5.0) of docker and check the version in the code.

just update a docker-compose file

@nix6839
Copy link
Contributor Author

nix6839 commented Feb 20, 2022

The current error seems to be that need to update the createGeneratedMap() function in MysqlDriver.ts.

@nix6839 nix6839 changed the title feat: allow returning() on MariaDB >= 10.5.0 feat: allow {delete,insert}().returning() on MariaDB Feb 21, 2022
@pleerock
Copy link
Member

Quite solid implementation. Thanks for contribution!

@pleerock pleerock merged commit 7facbab into typeorm:master Feb 21, 2022
@nix6839 nix6839 deleted the allow-returning-mariadb branch February 22, 2022 00:07
@nix6839 nix6839 restored the allow-returning-mariadb branch February 22, 2022 00:07
@nix6839 nix6839 deleted the allow-returning-mariadb branch February 22, 2022 00:07
@nix6839 nix6839 restored the allow-returning-mariadb branch February 22, 2022 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use "INSERT...RETURNING" in MariaDB.
2 participants