db_mysql/km_dbase.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * MySQL module core functions
00005  *
00006  * Copyright (C) 2001-2003 FhG Fokus
00007  * Copyright (C) 2008 1&1 Internet AG
00008  *
00009  * This file is part of Kamailio, a free SIP server.
00010  *
00011  * Kamailio is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version
00015  *
00016  * Kamailio is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License 
00022  * along with this program; if not, write to the Free Software 
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024  */
00025 
00034 #ifndef KM_DBASE_H
00035 #define KM_DBASE_H
00036 
00037 
00038 #include "../../lib/srdb1/db_con.h"
00039 #include "../../lib/srdb1/db_res.h"
00040 #include "../../lib/srdb1/db_key.h"
00041 #include "../../lib/srdb1/db_op.h"
00042 #include "../../lib/srdb1/db_val.h"
00043 #include "../../str.h"
00044 
00048 db1_con_t* db_mysql_init(const str* _sqlurl);
00049 
00050 
00054 void db_mysql_close(db1_con_t* _h);
00055 
00056 
00060 int db_mysql_free_result(db1_con_t* _h, db1_res_t* _r);
00061 
00062 
00066 int db_mysql_query(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _op,
00067              const db_val_t* _v, const db_key_t* _c, const int _n, const int _nc,
00068              const db_key_t _o, db1_res_t** _r);
00069 
00070 
00074 int db_mysql_fetch_result(const db1_con_t* _h, db1_res_t** _r, const int nrows);
00075 
00076 
00080 int db_mysql_raw_query(const db1_con_t* _h, const str* _s, db1_res_t** _r);
00081 
00082 
00086 int db_mysql_insert(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v, const int _n);
00087 
00088 
00092 int db_mysql_delete(const db1_con_t* _h, const db_key_t* _k, const 
00093         db_op_t* _o, const db_val_t* _v, const int _n);
00094 
00095 
00099 int db_mysql_update(const db1_con_t* _h, const db_key_t* _k, const db_op_t* _o,
00100         const db_val_t* _v, const db_key_t* _uk, const db_val_t* _uv, const int _n,
00101         const int _un);
00102 
00103 
00107 int db_mysql_replace(const db1_con_t* handle, const db_key_t* keys,
00108                 const db_val_t* vals, const int n, const int _un, const int _m);
00109 
00113 int db_mysql_last_inserted_id(const db1_con_t* _h);
00114 
00115 
00119 int db_mysql_affected_rows(const db1_con_t* _h);
00120 
00121 
00125 int db_mysql_insert_update(const db1_con_t* _h, const db_key_t* _k, const db_val_t* _v,
00126         const int _n);
00127 
00128 
00132 int db_mysql_insert_delayed(const db1_con_t* _h, const db_key_t* _k,
00133                 const db_val_t* _v, const int _n);
00134 
00135 
00140 int db_mysql_use_table(db1_con_t* _h, const str* _t);
00141 
00142 
00143 #endif /* KM_DBASE_H */