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

add query hint support #2351

Merged
merged 7 commits into from
Dec 6, 2019
Merged

add query hint support #2351

merged 7 commits into from
Dec 6, 2019

Conversation

dozer47528
Copy link
Contributor

What did this pull request do?

We are using our own MySQL read/write proxy.
In order to implement select on master db, we will add some sql hint to our sql query.

For example:
select * from users where id = 1

Force use master db:
/*master*/ select * from users where id = 1

It's a common use case for MySQL read/write and sharding.

@codecov-io
Copy link

codecov-io commented Jul 28, 2019

Codecov Report

Merging #2351 into master will decrease coverage by 0.03%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2351      +/-   ##
==========================================
- Coverage   79.42%   79.39%   -0.04%     
==========================================
  Files          24       24              
  Lines        3466     3470       +4     
==========================================
+ Hits         2753     2755       +2     
- Misses        612      613       +1     
- Partials      101      102       +1
Impacted Files Coverage Δ
callback_row_query.go 84.61% <0%> (-15.39%) ⬇️
callback_query.go 82.75% <100%> (+0.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 836fb2c...47c5a48. Read the comment docs.

@jinzhu jinzhu merged commit 9d2b65f into go-gorm:master Dec 6, 2019
blefevre pushed a commit to blefevre/gorm that referenced this pull request Feb 17, 2020
* add query hint support

* remove add extra space

* add test and fix bug

* fix ut

* fix ut
cgxxv pushed a commit to cgxxv/gorm that referenced this pull request Mar 25, 2022
* add query hint support

* remove add extra space

* add test and fix bug

* fix ut

* fix ut
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.

3 participants