-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix bulk insert with one field #710
Conversation
CI is failed, yet. |
Pull Request Test Coverage Report for Build 210
💛 - Coveralls |
0f772c8
to
1c63f0a
Compare
_, _, now := defaultSchema.Postgres() | ||
return fmt.Sprintf("INSERT INTO val (k, v, added_at) VALUES (:k, :v, %v)", now) | ||
}(), | ||
expected: "INSERT INTO val (k, v, added_at) VALUES (?, ?, now()),(?, ?, now())", |
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.
Supports only no-arguments function (e.g. now()
).
// extra operation | ||
{ | ||
values: []interface{}{vs[0], vs[1]}, | ||
q: "INSERT INTO val (k,v) VALUES (:k,:v) ON DUPLICATE KEY UPDATE v = VALUES(v)", |
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.
For this, I changed the regex values to start with "VALUES".
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.
( But when this feature is used other than bulk insert (e.g. used in NamedQuery), this changes is broken )
q: "INSERT INTO val (k) VALUES (:k)", | ||
expected: "INSERT INTO val (k) VALUES (?)", | ||
}, | ||
{ |
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.
This is the test for #709
#718 is almost same |
fix #709, #694