doobie icon indicating copy to clipboard operation
doobie copied to clipboard

[Feature Request] Add high level CLOB support

Open keirlawson opened this issue 6 years ago • 6 comments

Currently to read CLOBs the low level API is required. It would be great if there was support for CLOBs in the high level API.

If I were able to get som pointers as to what this ought to look like and where to start I could have a go at contibuting this (if my Scala is up to the task!)

keirlawson avatar Jul 30 '18 17:07 keirlawson

Maybe you can say a little bit about how you'd like it to work.

tpolecat avatar Jul 30 '18 17:07 tpolecat

So my naive instinct is that CLOBs should be supported in the high level API just as any other field with their type being Stream[F, Char], so for example with a table containg two VARCHARs and a CLOB you could produce a case class Foo(String, String, Stream[F, Char]), it would then be the consumers responsibility to consume the CLOB stream.

keirlawson avatar Jul 30 '18 17:07 keirlawson

A complicating factor is that the lifetime of the CLOB is bounded by the transaction so it will be hard to make this safe. I'll think about it.

tpolecat avatar Jul 30 '18 17:07 tpolecat

Thinking about this some more, having the CLOB already consumed and serialised out into a simple String would actually be a preffered solution to the way that I am using it, though I appreciate others may want the more fine-grained control of managing the stream themselves.

keirlawson avatar Aug 12 '18 10:08 keirlawson

I just need to insert a CLOB in Oracle using doobie, Is this now possible? I see these comments are from 3 years ago

acrimon avatar Jun 01 '21 21:06 acrimon

I'm curious about this too. I'm working on an application in Scala 3 and Doobie seems be the only Scala database library with proper support for Scala 3. I am hoping I can get CLOB/BLOB support at some point as I would like 6o use it.

OOPMan avatar Nov 24 '21 23:11 OOPMan