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

Missing return statement in :execrows generated code #2

Open
cameroncash opened this issue Jan 30, 2023 · 0 comments
Open

Missing return statement in :execrows generated code #2

cameroncash opened this issue Jan 30, 2023 · 0 comments

Comments

@cameroncash
Copy link

When using the plugin to generate Kotlin output for :execrows queries with MySql return statements are missing and the resulting files wont compile.

If I look at the template code it looks like the generated code should start with return return conn.prepareStatement however when using the plugin (from the github release or the sqlc release the return statement is not present and the code wont compile.

The source zips for the release do seem to have a return statement.
The following example shows the generated output I'm seeing in QueriesImpl.kt

 @Throws(SQLException::class)
  override fun updateMyRow(newDesc: String, theKey: String): Int {
    conn.prepareStatement(setStateByDdaToken).use { stmt ->
      stmt.setString(1, newDesc)
          stmt.setString(2, theKey)

      stmt.execute()

      stmt.updateCount
    }
  }
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

No branches or pull requests

1 participant