Skip to content

Instantly share code, notes, and snippets.

@schmitch
Created July 31, 2015 10:56
Show Gist options
  • Select an option

  • Save schmitch/6964a342f441bcff9d67 to your computer and use it in GitHub Desktop.

Select an option

Save schmitch/6964a342f441bcff9d67 to your computer and use it in GitHub Desktop.
Demo DBIO
object Demo {
def simple = {
SimpleDBIO[Long]{d =>
val lobj = d.connection.unwrap(classOf[PGConnection]).getLargeObjectAPI
val oid = lobj.createLO(LargeObjectManager.READWRITE)
val lo = lobj.open(oid, LargeObjectManager.WRITE)
val out = lo.getOutputStream // Use this outputstream to write directly to the database
// Write to the outputstream, call close
oid
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment