DB_POSTGRES :: CoreModule: DB_POSTGRES :: the PostgreSQL driver for Kamailio. More...
#include "../../lib/srdb1/db_con.h"#include "../../lib/srdb1/db_res.h"#include "../../lib/srdb1/db_key.h"#include "../../lib/srdb1/db_op.h"#include "../../lib/srdb1/db_val.h"

Go to the source code of this file.
Definition in file db_postgres/km_dbase.h.
| int db_postgres_abort_transaction | ( | db1_con_t * | _h | ) |
| _h | database handle |
Definition at line 714 of file db_postgres/km_dbase.c.
References db_postgres_free_result(), and db_postgres_raw_query().

| int db_postgres_affected_rows | ( | const db1_con_t * | _h | ) |
| _h | database handle |
Definition at line 633 of file db_postgres/km_dbase.c.
Referenced by db_postgres_replace().

| void db_postgres_close | ( | db1_con_t * | _h | ) |
| _h | closed connection, as returned from db_postgres_init |
Definition at line 152 of file db_postgres/km_dbase.c.
References db_do_close(), and db_postgres_free_connection().

| int db_postgres_delete | ( | const db1_con_t * | _h, | |
| const db_key_t * | _k, | |||
| const db_op_t * | _o, | |||
| const db_val_t * | _v, | |||
| const int | _n | |||
| ) |
| _h | structure representing database connection | |
| _k | key names | |
| _o | operators | |
| _v | values of the keys that must match | |
| _n | number of key=value pairs |
Definition at line 576 of file db_postgres/km_dbase.c.
References db_do_delete(), db_free_result(), db_postgres_store_result(), db_postgres_submit_query(), and db_postgres_val2str().

| int db_postgres_end_transaction | ( | db1_con_t * | _h | ) |
| _h | database handle |
Definition at line 679 of file db_postgres/km_dbase.c.
References db_postgres_free_result(), and db_postgres_raw_query().

Gets a partial result set, fetch a number of rows from a database result. This function initialize the given result structure on the first run, and fetches the nrows number of rows. On subsequenting runs, it uses the existing result and fetches more rows, until it reaches the end of the result set. Because of this the result needs to be null in the first invocation of the function. If the number of wanted rows is zero, the function returns anything with a result of zero.
| _con | database connection | |
| _res | result set | |
| nrows | number of fetches rows |
Definition at line 248 of file db_postgres/km_dbase.c.
References db_free_result(), db_free_rows(), db_new_result(), db_postgres_convert_rows(), db_postgres_get_columns(), RES_LAST_ROW, RES_NUM_ROWS, RES_ROW_N, and RES_ROWS.

| _con | database connection | |
| _r | result set |
Definition at line 392 of file db_postgres/km_dbase.c.
References db_free_result(), and db_postgres_free_query().
Referenced by db_postgres_abort_transaction(), db_postgres_end_transaction(), and db_postgres_start_transaction().


| _url | URL of the database that should be opened |
Definition at line 131 of file db_postgres/km_dbase.c.
References db_do_init(), and db_postgres_new_connection().

| _url | URL of the database that should be opened |
Definition at line 142 of file db_postgres/km_dbase.c.
References db_do_init2(), and db_postgres_new_connection().

| int db_postgres_insert | ( | const db1_con_t * | _h, | |
| const db_key_t * | _k, | |||
| const db_val_t * | _v, | |||
| const int | _n | |||
| ) |
| _h | structure representing database connection | |
| _k | key names | |
| _v | values of the keys | |
| _n | number of key=value pairs |
Definition at line 546 of file db_postgres/km_dbase.c.
References db_do_insert(), db_free_result(), db_postgres_store_result(), db_postgres_submit_query(), and db_postgres_val2str().
Referenced by db_postgres_replace().


| int db_postgres_query | ( | const db1_con_t * | _h, | |
| const db_key_t * | _k, | |||
| const db_op_t * | _op, | |||
| const db_val_t * | _v, | |||
| const db_key_t * | _c, | |||
| const int | _n, | |||
| const int | _nc, | |||
| const db_key_t | _o, | |||
| db1_res_t ** | _r | |||
| ) |
| _h | structure representing database connection | |
| _k | key names | |
| _op | operators | |
| _v | values of the keys that must match | |
| _c | column names to return | |
| _n | nmber of key=values pairs to compare | |
| _nc | number of columns to return | |
| _o | order by the specified column | |
| _r | result set |
Definition at line 420 of file db_postgres/km_dbase.c.
References db_do_query(), db_postgres_store_result(), db_postgres_submit_query(), and db_postgres_val2str().

| _h | database connection | |
| _s | raw query string | |
| _r | result set |
Definition at line 436 of file db_postgres/km_dbase.c.
References db_do_raw_query(), db_postgres_store_result(), and db_postgres_submit_query().
Referenced by db_postgres_abort_transaction(), db_postgres_end_transaction(), and db_postgres_start_transaction().


| int db_postgres_replace | ( | const db1_con_t * | _h, | |
| const db_key_t * | _k, | |||
| const db_val_t * | _v, | |||
| const int | _n, | |||
| const int | _un, | |||
| const int | _m | |||
| ) |
| _h | structure representing database connection | |
| _k | key names | |
| _v | values of the keys | |
| _n | number of key=value pairs | |
| _un | number of keys to build the unique key, starting from first | |
| _m | mode - first update, then insert, or first insert, then update |
Definition at line 766 of file db_postgres/km_dbase.c.
References DB1_INT, DB1_STR, DB1_STRING, db_postgres_affected_rows(), db_postgres_insert(), db_postgres_update(), VAL_NULL, VAL_STR, VAL_STRING, VAL_TYPE, and VAL_UINT.

| int db_postgres_start_transaction | ( | db1_con_t * | _h | ) |
| _h | database handle |
Definition at line 647 of file db_postgres/km_dbase.c.
References db_postgres_free_result(), and db_postgres_raw_query().

| _con | structure representing the database connection | |
| _r | pointer to a structure represending the result set |
Definition at line 456 of file db_postgres/km_dbase.c.
References db_free_result(), db_new_result(), db_postgres_convert_result(), and db_postgres_free_query().
Referenced by db_postgres_delete(), db_postgres_insert(), db_postgres_query(), db_postgres_raw_query(), and db_postgres_update().


| int db_postgres_update | ( | const db1_con_t * | _h, | |
| const db_key_t * | _k, | |||
| const db_op_t * | _o, | |||
| const db_val_t * | _v, | |||
| const db_key_t * | _uk, | |||
| const db_val_t * | _uv, | |||
| const int | _n, | |||
| const int | _un | |||
| ) |
| _h | structure representing database connection | |
| _k | key names | |
| _o | operators | |
| _v | values of the keys that must match | |
| _uk | updated columns | |
| _uv | updated values of the columns | |
| _n | number of key=value pairs | |
| _un | number of columns to update |
Definition at line 608 of file db_postgres/km_dbase.c.
References db_do_update(), db_free_result(), db_postgres_store_result(), db_postgres_submit_query(), and db_postgres_val2str().
Referenced by db_postgres_replace().


| _con | database connection | |
| _t | table name |
Definition at line 750 of file db_postgres/km_dbase.c.
References db_use_table().

1.7.1