db_postgres/res.c File Reference

DB_POSTGRES :: Core

Module: DB_POSTGRES :: the PostgreSQL driver for Kamailio. More...

#include <stdlib.h>
#include <string.h>
#include "../../db/db_id.h"
#include "../../db/db_res.h"
#include "../../db/db_con.h"
#include "../../dprint.h"
#include "../../mem/mem.h"
#include "res.h"
#include "val.h"
#include "pg_con.h"
#include "pg_type.h"

Include dependency graph for db_postgres/res.c:

Go to the source code of this file.

Functions

int db_postgres_convert_result (const db_con_t *_h, db_res_t *_r)
 Fill the result structure with data from the query.
int db_postgres_convert_row (const db_con_t *_h, db_res_t *_r, db_row_t *_row, char **row_buf)
 Convert a row from the result query into db API representation.
int db_postgres_convert_rows (const db_con_t *_h, db_res_t *_r)
 Convert rows from PostgreSQL to db API representation.
int db_postgres_get_columns (const db_con_t *_h, db_res_t *_r)
 Get and convert columns from a result set.


Detailed Description

DB_POSTGRES :: Core

Module: DB_POSTGRES :: the PostgreSQL driver for Kamailio.

Definition in file db_postgres/res.c.


Function Documentation

int db_postgres_convert_result ( const db_con_t _h,
db_res_t _r 
)

Fill the result structure with data from the query.

Parameters:
_h database connection
_r result set
Returns:
0 on success, negative on error

Definition at line 62 of file db_postgres/res.c.

References db_free_columns(), db_postgres_convert_rows(), db_postgres_get_columns(), and LM_ERR.

Referenced by db_postgres_store_result().

int db_postgres_convert_row ( const db_con_t _h,
db_res_t _r,
db_row_t _row,
char **  row_buf 
)

Convert a row from the result query into db API representation.

Parameters:
_h database connection
_r result set
_row row
row_buf row buffer
Returns:
0 on success, negative on error

Definition at line 281 of file db_postgres/res.c.

References db_allocate_row(), db_free_row(), db_postgres_str2val(), LM_DBG, LM_ERR, RES_TYPES, ROW_N, and ROW_VALUES.

Referenced by db_postgres_convert_rows().

int db_postgres_convert_rows ( const db_con_t _h,
db_res_t _r 
)

Convert rows from PostgreSQL to db API representation.

Parameters:
_h database connection
_r result set
Returns:
0 on success, negative on error

Definition at line 200 of file db_postgres/res.c.

References CON_RESULT, db_allocate_rows(), db_free_rows(), db_postgres_convert_row(), len, LM_DBG, LM_ERR, NULL, pkg_free, pkg_malloc, RES_COL_N, RES_LAST_ROW, RES_NAMES, RES_ROW_N, RES_ROWS, and s.

Referenced by db_postgres_convert_result(), and db_postgres_fetch_result().

int db_postgres_get_columns ( const db_con_t _h,
db_res_t _r 
)

Get and convert columns from a result set.

Parameters:
_h database connection
_r result set
Returns:
0 on success, negative on error

Definition at line 89 of file db_postgres/res.c.

References BITOID, BOOLOID, BPCHAROID, BYTEAOID, CHAROID, CON_RESULT, DATEOID, db_allocate_columns(), DB_BIGINT, DB_BITMAP, DB_BLOB, DB_DATETIME, DB_DOUBLE, db_free_columns(), DB_INT, DB_STRING, FLOAT4OID, FLOAT8OID, INT2OID, INT4OID, INT8OID, len, LM_DBG, LM_ERR, LM_WARN, NUMERICOID, pkg_malloc, RES_COL_N, RES_NAMES, RES_ROW_N, RES_TYPES, s, TEXTOID, TIMESTAMPOID, TIMESTAMPTZOID, VARBITOID, and VARCHAROID.

Referenced by db_postgres_convert_result(), and db_postgres_fetch_result().


Generated on Tue May 22 14:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6