Skip to content

row count not returned #116

@sphrak

Description

@sphrak

hi,
unless i missed something the row count seems to always be 0.. minimal test here;

  @Test
  fun rowCountReturnedByInsert() {
    val rowCount = insertTestData(TestData(1, "42")).value

    // it was inserted
    val qr = testDataQuery()
    assertEquals(1L, qr.id)
    assertEquals("42", qr.value)

    assertEquals(1L, rowCount, "unexpected row count $rowCount") // unexpected row count 0
  }

modified this to return QueryResult<Long>

  private fun insertTestData(testData: TestData): QueryResult<Long> {
    return driver.execute(1, "INSERT INTO test VALUES (?, ?)", 2) {
      bindLong(0, testData.id)
      bindString(1, testData.value)
    }
  }

edit: note i ran the test on jvm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions