loopbackio / loopback-connector-oracle

Connect Loopback to Oracle
http://loopback.io/doc/en/lb3/Oracle-connector.html
Other
28 stars 30 forks source link

Use fetchAsString for CLOB #124

Closed raymondfeng closed 7 years ago

raymondfeng commented 7 years ago

Description

This PR uses oracledb.fetchAsString and oracledb.fetchAsBuffer options to simplify CLOB/BLOB reading.

Related issues

Checklist

jannyHou commented 7 years ago

The 3 clob tests in test/oracle.clob.test.js fail due to invalid connection

1) Oracle connector should support clob size < 4000 chars: Uncaught Error: NJS-003: invalid connection

PTAL.

raymondfeng commented 7 years ago

@jannyHou These tests are passing in my local test. Can you try too?

cjbj commented 7 years ago

Note there are upper size limitations if the Oracle Client is 11.2. The Oracle Client 12 is OK. And a future node-oracledb v2 won't have the limitation with 11 or 12.

raymondfeng commented 7 years ago

@jannyHou It seems the issue only happens with oracledb@1.11.x. Upgrading to oracledb@1.12.0 and above fixes the problem. We probably have to rebuild the binary bundle.

jannyHou commented 7 years ago

@raymondfeng sounds good, Biniam helps me setup the testing ENV and we might need a new oracleUrl in https://github.com/strongloop/loopback-connector-oracle/blob/fc7c148249cd4420be8dde8838a1a976e8a21876/package.json#L22 for ~oracledb@^1.12.x~ oracledb@^1.13.x according to Christopher's comment

cjbj commented 7 years ago

fetchAsString was introduced in 1.12. fetchAsBuffer was introduced in 1.13. You will want 1.13.1.