logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

odbx_lo_write - Writes buffer content into the large object

Description

odbx_lo_write()  sends  the data supplied in buffer to the server for storing it inside the large object.
       The function can be called more than once to add subsequent parts of the content to  the  object.  If  it
       isn't  a  new  or empty object, the existing data will be overwritten and truncated to the new size. It's
       not possible to update only parts of the content as some databases doesn't support to position the inter‐
       nal file position indicator.

       The lo parameter has to be the large object handle created and returned by odbx_lo_open() via its  second
       parameter.  It  becomes invalid after it was supplied to odbx_lo_close() and this function will return an
       error in this case. The data which should be send to the server is read from buffer up to buflen bytes.

Errors

       -ODBX_ERR_BACKEND
              The native database library couldn't write to the large object successfully

       -ODBX_ERR_HANDLE
              lo is NULL or the supplied large object handle is invalid

Name

       odbx_lo_write - Writes buffer content into the large object

Return Value

odbx_lo_write() returns the number of bytes read from buffer and sent to the database server,  which  may
       be  up  to  buflen  bytes. It isn't guaranteed that the complete chunk was sent to the server, so the re‐
       turned size may be less than the value in buflen. On error, a code whose value is less than zero  is  re‐
       turned  if  one  of the operations couldn't be completed successfully. Possible error codes are listed in
       the error section and they can be feed to odbx_error() and odbx_error_type() to get further details.

See Also

odbx_lo_open(), odbx_lo_close()

                                                 8 January 2025                                 odbx_lo_write(3)

Synopsis

       #include <opendbx/api.h>

       ssize_t odbx_lo_write (odbx_lo_t* lo, void* buffer, size_t buflen);

See Also