0

I have made this table:

object PartnerOwnerMappingTable : IntIdTable("partner_owner_mapping") {
  val ownerId = integer("owner_id")
  val driverUUID = uuid("driver_uuid")
  val partnerUUID = uuid("partner_uuid")

  val createdAt = timestampWithoutTZAsInstant("created_at")
  val updatedAt = timestampWithoutTZAsInstant("updated_at")
}

And I'm trying to execute this statement using the exposedrepo.

PartnerOwnerMappingTable.insertIgnore {
    it[this.ownerId] = record.ownerId
    it[this.driverUUID] = record.driverUUID
    it[this.partnerUUID] = record.partnerUUID
    it[this.createdAt] = Instant.now()
    it[this.updatedAt] = Instant.now()

}

But when I'm checking the database the data is not there.

I'm trying to use insertIgnore but the data is not reflecting in the database.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
  • My use case is to insert when ownerid is not present else ignore the value and don't give an error. – prashant gupta Nov 04 '22 at 05:16
  • Please share a minimal reproducible example of your code that shows how you connect to the DB and how you handle the transaction or any exceptions. Example: https://stackoverflow.com/q/45520895/18667225 – Markus Nov 04 '22 at 09:24

0 Answers0