Internal Database Query Functions

Database Independent Abstraction Layer for C: libdbi Driver Author's Guide
Prev | Chapter 3. Driver Functions | Next

# 3.2. Internal Database Query Functions

These functions are called by libdbi when the libdbi user runs queries and accesses their results. There are also a bunch of helper functions that deal with the character encodings as well as with string escaping and quoting.

## 3.2.1. dbd_goto_row

``int dbd_goto_row`(dbi_result_t *result, unsigned long long rowidx, unsigned long long currowidx);`

Jumps to the specifed row in the result set. Internal row counts start at 0. The current row number is passed to the driver to allow it to check whether a (presumably expensive) seek operation is required.

Arguments

  `result`: The target result handle.

  `row`: The target row number.

  `row`: The current row number.

Returns

  1 on success, 0 on error.

## 3.2.2. dbd_fetch_row

``int dbd_fetch_row`(dbi_result_t *result, unsigned long long rowidx);`

Fetches the target row, retrieving one-time field information if necessary. Also see the _dbd_row_allocate and _dbd_row_finalize helper functions.

Arguments

  `result`: The target result object.

  `rowidx`: The number of the row to fetch. Internal row numbers start at zero.

Returns

  0 on error, 1 on successful fetch.

## 3.2.3. dbd_free_query

``int dbd_free_query`(dbi_result_t *result);`

Frees the target result handle.

Arguments

  `result`: The target result handle.

Returns

  0 on success.

Prev | Home | Next
Driver Infrastructure Functions | Up | Public Database Query Functions