Skip to content

Missing return statement in :execrows generated code #2

Description

@cameroncash

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
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions