[SR-Dev] git:janakj/bdb: further cleanups in core database API

Jan Janak jan at iptel.org
Sun Feb 15 16:12:26 CET 2009


Module: sip-router
Branch: janakj/bdb
Commit: 3904bb0de19f991292c69e61ebfe387d2d10809f
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3904bb0de19f991292c69e61ebfe387d2d10809f

Author: Henning Westerholt <henning.westerholt at 1und1.de>
Committer: Henning Westerholt <henning.westerholt at 1und1.de>
Date:   Mon Jan  7 14:26:27 2008 +0000

further cleanups in core database API
- move use_table and close function for SQL DBs to core
- move query, raw_query, insert, update, delete functions for SQL DBs to core
- all this functions were almost identical implemented in the three DB,
  this functions uses now a function pointer based interface to do the work
- the use_table functions from dbtext and db_berkeley uses also now the core API
- move result management function from db_col to db_res to the other result
  management functions, they are not useful alone
- change postgres module to match more the structure of mysql and unixodbc,
  remove the 'PARANOID' #define, the other modules don't have this and prefix
  all functions with db_postgres, make this more consistent to mysql module
- prefix all functions in unixodbc module with db_unixodbc, make this consistent
  to the other modules, cleanup the namespace
- prefix val2str function in mysql with db_mysql too
- move the SQL_BUF_LENGTH to core API, all modules need this
- remove the static SQL char buffer from postgres and unixodbc, uses the one
  provided from the core API
- move documentation from db/doc to API files in doxygen format
- improve and extend documentation for the whole API
- make database API const correct, to guard against implementation errors and
  allow better compiler optimizations
- change interface free_connection function in SQL DBs to connection structure
  to allow the usage of core API do_close
- fix indention for postgres driver and make logging messages consistent
- remove now unneeded system header includes for SQL DBs
- remove transaction related code from postgres driver, this is not used at all
  and according to Klaus also brings no performance benefit if used.
- probably some other smaller cleanups

Tested with the testcases, so basic functionality should work.. Please test! :-)


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3506 689a6050-402a-0410-94f2-e92a70836424

---

 modules/db_berkeley/db_berkeley.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/modules/db_berkeley/db_berkeley.c b/modules/db_berkeley/db_berkeley.c
index b4ccc7c..8049baf 100644
--- a/modules/db_berkeley/db_berkeley.c
+++ b/modules/db_berkeley/db_berkeley.c
@@ -134,11 +134,7 @@ static void destroy(void)
 
 int bdb_use_table(db_con_t* _h, const char* _t)
 {
-	if ((!_h) || (!_t))
-		return -1;
-	
-	CON_TABLE(_h) = _t;
-	return 0;
+	return db_use_table(_h, _t);
 }
 
 /*




More information about the sr-dev mailing list