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

let gorm support limit and offset binding parameters,change the BindVar of postgres driver #239

Merged
merged 6 commits into from
Feb 4, 2024

Conversation

jasonchuan
Copy link
Contributor

@jasonchuan jasonchuan commented Jan 31, 2024

if limit and offset use the parameter in new gorm version,must remove config vars before bindvar to ,and then restore them.

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

User Case Description

this is necessary for limit and offset binding parameters issue
go-gorm/gorm#6806

if limit and offset use the parameter  in new gorm version,must remove config vars before bindvar to ,and then restore them.
@jasonchuan
Copy link
Contributor Author

@jinzhu please approve this commit first and add a tag for this version
next step go-gorm/gorm#6806

@jasonchuan jasonchuan changed the title Update postgres.go let gorm support limit and offset binding parameters,change the BindVar of postgres driver Feb 1, 2024
postgres.go Outdated Show resolved Hide resolved
postgres.go Outdated
index := 0
varLen := len(stmt.Vars)
if varLen > 0 {
switch stmt.Vars[index].(type) {
Copy link
Member

Choose a reason for hiding this comment

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

change to stmt.Vars[0].(type) {?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jinzhu jinzhu merged commit dc711bd into go-gorm:master Feb 4, 2024
1 check passed
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