odbx_lo_write(3)

πŸ’Ύ odbx_lo_write(3) β€” the OpenDBX lo-write glow-up ✨

Okay bestie, gather round, because we're talking about odbx_lo_write β€” it lives in the OpenDBX family (that's the manual name, iykyk 🫢) and it's literally the function that shoves your bytes into a large object. Let's get into it πŸ’…


🌸 NAME 🌸

odbx_lo_write β€” writes buffer content into the large object. That's it, that's the whole job, and it ate πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <opendbx/api.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

So odbx_lo_write() sends the data you've got in buffer off to the server, and the server stores it inside the large object. Iconic behavior, no notes πŸ’…

You can call this function more than once to add subsequent parts of the content to the object β€” like building the vibe piece by piece, one chunk at a time ✨

⚠️ But heads up bestie: if it isn't a new or empty object, the existing data will be overwritten and truncated to the new size. So don't come for old content unless you mean it, fr fr 😭

Also, it's not possible to update only parts of the content, because some databases don't support positioning the internal file position indicator. So no partial-update era for us, that's just not the timeline we're on πŸ™ˆ

Now the lo parameter β€” that has to be the large object handle created and returned by odbx_lo_open() via its second parameter. Simple enough, right? But the second you hand it over to odbx_lo_close(), it becomes invalid, and this function will return an error in that case. Dead handle, dead link, no cap πŸ’€

The data that should be sent to the server is read from buffer up to buflen bytes. That's the whole read situation, queen πŸŽ€


πŸ‘‘ 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. So it's giving "here's how much I actually got through" πŸ’–

🫢 And no, it isn't guaranteed that the complete chunk was sent to the server, so the returned size may be less than the value in buflen. Don't assume full delivery just because you asked nicely.

On error, a code whose value is less than zero is returned if one of the operations couldn't be completed successfully. Possible error codes are listed in the error section (scroll down bestie πŸ‘‡) and they can be feed to odbx_error() and odbx_error_type() to get further details. Detective mode: activated πŸ”


🌈 ERRORS 🌈

  • -ODBX_ERR_BACKEND β€” the native database library couldn't write to the large object successfully. The backend fumbled the bag 😭
  • -ODBX_ERR_HANDLE β€” lo is NULL or the supplied large object handle is invalid. Nobody's home, the handle is not it πŸ’€

⭐ SEE ALSO ⭐

  • odbx_lo_open()
  • odbx_lo_close()

Go read those too, the whole lo-family is a package deal 🧚


That's the whole page, bestie β€” slay, go write some large objects πŸ’…βœ¨

Sign-off szn: this OpenDBX page is dated 6 February 2026 β€” mwah, from your favorite manual with love πŸŽ€πŸ’œ

πŸ“¦ where this page comes from