apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: Column names with apr_dbd
Date Mon, 13 Feb 2006 10:52:24 GMT
On Monday 13 February 2006 07:16, Bojan Smojver wrote:
> Is there a way to get result set column names with apr_dbd? I couldn't
> find one...

There isn't.  But you're not the first to ask for this feature,
so I guess it's a strong candidate for inclusion in a future update.

> If the feature really isn't there, would this be something where patches
> would be welcome? Or is this a design decision related to some
> underlying database compatibility/capability problem?

FWIW, we have an uncommitted patch that looks like this.
Feel free to improve it.

--- include/apr_dbd.h.orig
+++ include/apr_dbd.h
@@ -210,6 +210,16 @@
 APU_DECLARE(const char*) apr_dbd_get_entry(const apr_dbd_driver_t *driver,
                                            apr_dbd_row_t *row, int col);

+/** apr_dbd_get_name: get an entry name from a result set
+ *
+ *  @param driver - the driver
+ *  @param res - result set pointer
+ *  @param col - entry number
+ *  @return name of the entry, or NULL if col is out of bounds.
+ */
+APU_DECLARE(const char*) apr_dbd_get_name(const apr_dbd_driver_t *driver,
+                                          apr_dbd_results_t *res, int col);
+
 /** apr_dbd_error: get current error message (if any)
  *
  *  @param driver - the driver

-- 
Nick Kew

Mime
View raw message