We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2249174 commit d3d1c06Copy full SHA for d3d1c06
internal/gen.go
@@ -378,6 +378,15 @@ func sqlalchemySQL(s, engine string) string {
378
s = strings.ReplaceAll(s, ":", `\\:`)
379
if engine == "postgresql" {
380
return postgresPlaceholderRegexp.ReplaceAllString(s, ":p$1")
381
+ } else if engine == "mysql" {
382
+ // All "?" in string s in string s are replaced with ":p1", ":p2", ... in that order
383
+ parts := strings.Split(s, "?")
384
+ for i := range parts {
385
+ if i != 0 {
386
+ parts[i] = fmt.Sprintf(":p%d%s", i, parts[i])
387
+ }
388
389
+ return strings.Join(parts, "")
390
}
391
return s
392
0 commit comments