-
Notifications
You must be signed in to change notification settings - Fork 884
Kotlin mysql #775
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
Kotlin mysql #775
Conversation
@@ -141,7 +141,9 @@ func Generate(e Env, dir string, stderr io.Writer) (map[string]string, error) { | |||
if sql.Gen.Go != nil { | |||
name = combo.Go.Package | |||
} else if sql.Gen.Kotlin != nil { | |||
parseOpts.UsePositionalParameters = true | |||
if sql.Engine == config.EnginePostgreSQL { | |||
parseOpts.UsePositionalParameters = true |
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 switch breaks MySQL since it's trying to replace non-existent $1
to ?
. Not sure if some clever renaming would be useful here
7287db6
to
b02a053
Compare
@@ -46,6 +46,6 @@ jobs: | |||
PG_PORT: ${{ job.services.postgres.ports['5432'] }} | |||
MYSQL_DATABASE: mysql | |||
MYSQL_HOST: localhost | |||
MYSQL_PORT: ${{ job.services.mysql.ports['5432'] }} | |||
MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }} |
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 probably never worked? It probably interpolated into the empty string, and the tests used the default port which is 3306
No example for a mysql |
Not supported. sqlc doesn't currently have support for variable length arguments AFAIK and MySQL doesn't have support for passing an array as a single parameter. It would be nice to find a solution for this. |
Looks like passing slices is being discussed in #695 |
d856776
to
d7c05e9
Compare
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.
@mightyguava I merged in your PR that removed the runtime, which has caused merge conflicts. Can you update this PR with the latest master?
Not much changed really. * Added support for `:execresult` * Add Kotlin MySQL examples and get tests working.
and adds MySQL tests for all existing examples
d7c05e9
to
0b85966
Compare
I did a rebase and git auto-resolved the conflicts. |
Not much changed really.
:execresult
There's a lot of generated code changes and Kotlin test changes, so I've included (filtered commit) links that filter out .kt files for easier review. Also note this PR includes #774. I'll rebase when that's merged.
TODO for future PRs:
okio
forByteString
.