OpenDBX(3)

okay bestie, this is OpenDBX(3) from the opendbx manual β€” the C++ API page, and it's lowkey iconic. πŸ’…βœ¨

🌸 NAME 🌸

  • OpenDBX β€” the OpenDBX C++ API. periodt.

✨ SYNOPSIS ✨

πŸŽ€ Classes πŸŽ€

  • class Conn β€” wraps a connection to a database. it's the main-character connector. 🫢
  • class Exception β€” the exceptions that the OpenDBX classes throw when things go sideways. 😭
  • class Lob β€” handles large objects when the database supports that. big-object energy. πŸ¦‹
  • class Result β€” gives you result sets from the database. the receipts. πŸ’…
  • class Stmt β€” statement object. the actual statement icon. ⭐

πŸ’« Detailed Description πŸ’«

OpenDBX C++ API. yes bestie, that's the name and we're already obsessed.

The OpenDBX C++ API is an object-oriented database abstraction layer built on top of the procedural C API of the OpenDBX library. it gives you objects that encapsulate connections, statements, result sets, and large objects β€” very organized, very slay. πŸŽ€

Using the API starts with establishing a connection to the database server by creating an instance of the Conn class with the parameters backend, host, and port. Conn::getCapability() tests the implemented capabilities of the underlying database library, while Conn::getOption() and Conn::setOption() are how you test for and change a number of options.

bestie, those options must be changed before authenticating the connection with the Conn::bind() method if you want them to have any effect β€” no cap. 🫑

it's also possible to rebind a connection using different credentials after Conn::unbind() has been called. plus, the Conn class can escape potentially dangerous character sequences with Conn::escape() if, for example, user input should be part of a statement as a value. safety first, bestie. πŸ›‘οΈβœ¨

The Conn::create() method creates and initializes a new statement instance from a SQL string. currently, only simple statement objects are implemented, and they need to be complete statements that can be sent to the database with Stmt::execute(). this method returns a Result object encapsulating one or more result sets returned by the database, depending on the statement sent. πŸ“¬

Each result set must be retrieved using Result::getResult(), while Result::getRows() fetches a row from the current result set if the statement was a SELECT-like statement. otherwise, Result::rowsAffected() can be used to get the number of rows that were touched by the statement. if the statement may return rows, the Result::columnName() and Result::columnType() methods are able to provide some informations about the columns, indexed from 0 to n. it's also possible to map the column name with the Result::columnPos() method to the column index, which is required by the other column methods. to get the actual value and length of the content in the current row at the given position, Result::fieldValue() and Result::fieldLength() must be called. get those receipts, bestie. πŸ§ΎπŸ’–

In case the underlying database library requires special handling of large objects (binary or text LOBs), the value of Result::fieldValue() has to be fed into the Result::getLob() method. it returns a Lob object which enables the application to read from and write to a large object using Lob::read() respectively Lob::write(). this is only necessary if the Conn::getCapability() method returns true when asking for ODBX_CAP_LO. big LOB energy only when needed. πŸ¦‹

If an error occurs in any of the object methods, the objects will throw an instance of the Exception class, which extends the runtime_error exception of the STL. the instance contains an error message, the OpenDBX error code, and an error type indicating the severity of the error. this information can be retrieved by the methods Exception::what(), Exception::getCode(), and Exception::getType(). so when it throws, it's giving details. πŸ˜­πŸ’€

🌈 Author 🌈

  • Norbert Sendetzky β€” norbert@linuxnetworks.de. legend behavior. πŸ‘‘

🌟 Version 🌟

  • 1.0 β€” the version, bestie. πŸ’œ

πŸ“œ Author πŸ“œ

Generated automatically by Doxygen for opendbx from the source code. (yes, the bots made this page, and they ate. πŸ€–βœ¨)


mwah πŸ’‹ β€” this page's source/version/date footer is: opendbx and OpenDBX(3), version 1.4.6, dated Fri Feb 6 2026 20:17:56. that's the cute sign-off, bestie β€” now go slay some database abstractions! πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from