odbx_unbind(3)

πŸ’… odbx_unbind(3) β€” the OpenDBX glow-up page πŸ’…

okay bestie, so this is odbx_unbind, one of the OpenDBX crew, and it's literally the "we're breaking up (with the database)" function. Let's get into it ✨


🌸 NAME 🌸

odbx_unbind β€” disconnects from the database. that's it. that's the whole vibe. bye-bye connection 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <opendbx/api.h>

int odbx_unbind (odbx_t* handle);

πŸŽ€ DESCRIPTION πŸŽ€

okay so picture this: you already used odbx_bind() to tie your connection object to a database and a user, and now you want out. odbx_unbind() releases that binding on the connection object you hand it. it's giving "we need to see other databases" πŸ’…

why would you even want this? iconic reasons, honestly:

  • you're switching to a different database πŸ”„
  • you're binding to the same database but with different credentials πŸ”‘
  • you want to set some new connection related options before rebinding to the database server ✨
heads up, firebird besties 🐦 β€” if there's an open transaction while this function runs in the firebird backend, it gets committed to the database and closed. the behavior of the other backends with open transactions may vary, so like… don't assume, okay? πŸ™ˆ

the way that you MUST process all result sets returned by the database server before using this function… no seriously, you have to. otherwise it might return an error, depending on the native database client library and the backend module. so finish your result sets first, bestie, i'm begging 😭

and this function must be invoked before calling odbx_finish() β€” otherwise you get memory leaks and connections left open which may block necessary resources later on. not the resource-blocking arc, we're not doing that πŸ’€

the handle parameter has to be the connection object created and returned by odbx_init(). it becomes invalid after it was supplied to odbx_finish(), and in that case odbx_unbind() will return an error. so yeah, after odbx_finish() she's gone, don't come calling πŸ‘‹


✨ RETURN VALUE ✨

odbx_unbind() returns ODBX_ERR_SUCCESS, or an error code whose value is less than zero if one of the operations couldn't be completed successfully 😬

possible error codes are listed in the ERRORS section (right below, keep scrolling babe), and you can feed them to odbx_error() and odbx_error_type() to get further details πŸ”


πŸ”₯ ERRORS πŸ”₯

  • -ODBX_ERR_PARAM β€” handle is NULL, or the supplied connection object is invalid 🚫

πŸ‘‘ SEE ALSO πŸ‘‘

  • odbx_bind()
  • odbx_error()
  • odbx_finish()

go read those too, iykyk πŸ“š


kay that's the whole page, mwah πŸ’‹ β€” this has been odbx_unbind(3) from OpenDBX, dated 6 February 2026. slay, stay bound (until you unbind), and don't forget to odbx_finish() πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from