dg / dibi

Dibi - smart database abstraction layer
https://dibiphp.com
Other
487 stars 136 forks source link

ORACLE - Add support of CLOB data type #347

Closed BigOHenry closed 4 years ago

BigOHenry commented 4 years ago

OCI-Lob: https://www.php.net/manual/en/class.OCI-Lob.php

dg commented 4 years ago

Can you send PR?

milo commented 4 years ago

Dibi already returns OCI-Lob objects.

BigOHenry commented 4 years ago

Yeah i wrote that at first post. But i thought it should return string.

BigOHenry commented 4 years ago

Can you send PR?

I will. But first i will make more testing of implementing it. There is a OCI8 driver problem with OCI-Lob class. At PHP exists OCI_Lob class: https://bugs.php.net/bug.php?id=58319 https://bugs.php.net/bug.php?id=45853

milo commented 4 years ago

Yeah i wrote that at first post. But i thought it should return string.

I don't think so that automatic CLOB to string conversion is a good way. Let's say that 100 rows can grow from few kilobytes to gigabytes. OCI-Lob provides more methods than string conversion. For example OCI-Lob::export() which saves contents to file.

Automatic CLOB to string conversion could work with explicit type set, like:

$db->query(...)->setType('clobField', Dibi::TEXT)
BigOHenry commented 4 years ago

I thought more about it and you are right. Closing issue.