All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.augustnagro.magnum.Update.scala Maven / Gradle / Ivy

The newest version!
package com.augustnagro.magnum

import java.util.concurrent.TimeUnit
import scala.concurrent.duration.FiniteDuration
import scala.util.{Failure, Success, Using}

case class Update(frag: Frag):
  /** Exactly like [[java.sql.PreparedStatement]].executeUpdate */
  def run()(using con: DbCon): Int =
    handleQuery(frag.sqlString, frag.params):
      Using(con.connection.prepareStatement(frag.sqlString)): ps =>
        frag.writer.write(ps, 1)
        timed(ps.executeUpdate())




© 2015 - 2025 Weber Informatics LLC | Privacy Policy