1

What methodes are available to stream the result of a byteEA column from a postgres database via ScalikeJDBC. My question is not about streaming results e.g a query has 1 000 000 results and results are streamed to the application BUT about selecting a single byteEA field from the db and instead of retrieving the whole binary data at once, read the content of the column from a stream.

Background: There is a guide to streaming the content of byteEA columns in jdbc but i miss a documentation of such feature in scalalikejdbc.

Th 00 mÄ s
  • 3,776
  • 1
  • 27
  • 46
  • 1
    I've not used jdbc or scalikejdbc before but quite honestly, you can probably get away with just using that guide. Scala is build on the JVM, so any Java libraries also work in Scala. Once you have it working there, try to refactor it to use scalikejdbc. – James Whiteley Aug 07 '20 at 14:47
  • 1
    Or, try to understand what that example is doing and replicate it with scalikejdbc functions/whatever. blindly following tutorials won't help you understand what's happening or what to do if something goes wrong. – James Whiteley Aug 07 '20 at 14:49
  • bytea you mean? – pedrofurla Aug 08 '20 at 03:56
  • The guide looks to be using standard JDBC, for example: https://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html#setBinaryStream-int-java.io.InputStream-long- – pedrofurla Aug 08 '20 at 04:00
  • It looks like what you looking for is https://www.javadoc.io/doc/org.scalikejdbc/scalikejdbc-core_2.12/latest/scalikejdbc/Binders$.html#binaryStream:scalikejdbc.Binders[java.io.InputStream]. – pedrofurla Aug 08 '20 at 04:08

0 Answers0