Skip to content

Commit 60d1bdd

Browse files
Added support for getthing the LOB chunk size (#14).
1 parent 9883784 commit 60d1bdd

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ oracledb 1.1.0 (TBD)
1313
Thin Mode Changes
1414
+++++++++++++++++
1515

16+
#) Added support for getthing the LOB chunk size
17+
(`issue 14 <https://github.com/oracle/python-oracledb/issues/14>`__).
1618
#) Internally make use of the `TCP_NODELAY` socket option to remove delays
1719
in socket reads.
1820

src/oracledb/impl/thin/lob.pyx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ cdef class ThinLobImpl(BaseLobImpl):
8585
self._conn_impl._temp_lobs_total_size += len(self._locator)
8686
self._conn_impl = None
8787

88+
def get_chunk_size(self):
89+
"""
90+
Internal method for returning the chunk size of the LOB.
91+
"""
92+
cdef LobOpMessage message
93+
message = self._conn_impl._create_message(LobOpMessage)
94+
message.operation = TNS_LOB_OP_GET_CHUNK_SIZE
95+
message.source_lob_impl = self
96+
message.send_amount = True
97+
self._conn_impl._protocol._process_single_message(message)
98+
return message.amount
99+
88100
def get_is_open(self):
89101
"""
90102
Internal method for returning whether the LOB is open or not.

tests/test_1900_lob_var.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def __test_lob_operations(self, lob_type):
176176
lob.trim, new_size=50, newSize=60)
177177
lob.trim()
178178
self.assertEqual(lob.size(), 0)
179+
self.assertIsInstance(lob.getchunksize(), int)
179180

180181
def __test_pickle(self, lob_type):
181182
value = "A test string value for pickling"

0 commit comments

Comments
 (0)