@@ -306,6 +306,8 @@ cdef class Buffer:
306306 * To see the contents , call ``str(buffer )``.
307307 """
308308 cdef line_sender_buffer* _impl
309+ cdef size_t _init_capacity
310+ cdef size_t _max_name_len
309311 cdef object _row_complete_sender
310312
311313 def __cinit__(self , init_capacity: int = 65536 , max_name_len: int = 127 ):
@@ -319,12 +321,33 @@ cdef class Buffer:
319321 cdef inline _cinit_impl(self , size_t init_capacity, size_t max_name_len):
320322 self ._impl = line_sender_buffer_with_max_name_len(max_name_len)
321323 line_sender_buffer_reserve(self ._impl, init_capacity)
324+ self ._init_capacity = init_capacity
325+ self ._max_name_len = max_name_len
322326 self ._row_complete_sender = None
323327
324328 def __dealloc__ (self ):
325329 self ._row_complete_sender = None
326330 line_sender_buffer_free(self ._impl)
327331
332+ @property
333+ def init_capacity (self ) -> int:
334+ """
335+ The initial capacity of the buffer when first created.
336+
337+ This may grow over time , see ``capacity()``.
338+ """
339+ return self._init_capacity
340+
341+ @property
342+ def max_name_len(self ) -> int:
343+ """Maximum length of a table or column name."""
344+ return self._max_name_len
345+
346+ @property
347+ def max_name_len(self ) -> int:
348+ """Maximum length of a table or column name."""
349+ return self._max_name_len
350+
328351 def reserve(self , additional: int ):
329352 """
330353 Ensure the buffer has at least `additional` bytes of future capacity.
@@ -770,8 +793,8 @@ cdef class Sender:
770793 cdef Buffer _buffer
771794 cdef bint _auto_flush_enabled
772795 cdef ssize_t _auto_flush_watermark
773- cdef object _init_capacity
774- cdef object _max_name_len
796+ cdef size_t _init_capacity
797+ cdef size_t _max_name_len
775798
776799 def __cinit__ (
777800 self ,
@@ -896,10 +919,20 @@ cdef class Sender:
896919 The buffer is set up with the configured `init_capacity` and
897920 `max_name_len`.
898921 """
899- self ._buffer = Buffer(
922+ return Buffer(
900923 init_capacity = self ._init_capacity,
901924 max_name_len = self ._max_name_len)
902925
926+ @property
927+ def init_capacity (self ) -> int:
928+ """The initial capacity of the sender's internal buffer."""
929+ return self._init_capacity
930+
931+ @property
932+ def max_name_len(self ) -> int:
933+ """Maximum length of a table or column name."""
934+ return self._max_name_len
935+
903936 def connect(self ):
904937 cdef line_sender_error* err = NULL
905938 if self ._opts == NULL :
0 commit comments