Add kore_pgsql_getlength() which will return length of a column.

This commit is contained in:
Joris Vink 2014-09-28 23:03:49 +02:00
parent 3b09683f5c
commit e1be630b84
2 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,7 @@ int kore_pgsql_ntuples(struct kore_pgsql *);
void kore_pgsql_logerror(struct kore_pgsql *);
void kore_pgsql_queue_remove(struct http_request *);
char *kore_pgsql_getvalue(struct kore_pgsql *, int, int);
int kore_pgsql_getlength(struct kore_pgsql *, int, int);
#define KORE_PGSQL_STATE_INIT 1
#define KORE_PGSQL_STATE_WAIT 2

View File

@ -228,6 +228,12 @@ kore_pgsql_ntuples(struct kore_pgsql *pgsql)
return (PQntuples(pgsql->result));
}
int
kore_pgsql_getlength(struct kore_pgsql *pgsql, int row, int col)
{
return (PQgetlength(pgsql->result, row, col));
}
char *
kore_pgsql_getvalue(struct kore_pgsql *pgsql, int row, int col)
{