---------------------
PatchSet 251 
Date: 2005/05/16 21:57:14
Author: jhoblitt
Branch: HEAD
Tag: (none) 
Log:
rename psDBRunQuery -> p_psDBRunQuery and make the symbol public

Members: 
	src/dataIO/psDB.c:1.1->1.2 
	src/dataIO/psDB.h:1.1->1.2 

Index: pslib/src/dataIO/psDB.c
diff -u pslib/src/dataIO/psDB.c:1.1 pslib/src/dataIO/psDB.c:1.2
--- pslib/src/dataIO/psDB.c:1.1	Fri May  6 08:15:25 2005
+++ pslib/src/dataIO/psDB.c	Mon May 16 11:57:14 2005
@@ -11,8 +11,8 @@
  *  @author Aaron Culliney
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.1 $ $Name:  $
- *  @date $Date: 2005/05/06 18:15:25 $
+ *  @version $Revision: 1.2 $ $Name:  $
+ *  @date $Date: 2005/05/16 21:57:14 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
  */
@@ -42,7 +42,6 @@
 mysqlType;
 
 // database utility functions
-static bool     psDBRunQuery(psDB *dbh, const char *query);
 static inline bool psDBPackRow(MYSQL_BIND *bind, psMetadata *values, psU32 paramCount);
 
 // SQL generation functions
@@ -135,7 +134,7 @@
     psStringAppend(&query, "CREATE DATABASE %s", dbname);
 
     // the MySQL C API notes that mysql_create_db() is deprecated
-    status = psDBRunQuery(dbh, query);
+    status = p_psDBRunQuery(dbh, query);
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "Failed to create new database.");
     }
@@ -164,7 +163,7 @@
     psStringAppend(&query, "DROP DATABASE %s", dbname);
 
     // the MySQL C API notes that mysql_drop_db() is deprecated
-    status = psDBRunQuery(dbh, query);
+    status = p_psDBRunQuery(dbh, query);
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "Failed to drop database.");
     }
@@ -186,7 +185,7 @@
         return NULL;
     }
 
-    status = psDBRunQuery(dbh, query);
+    status = p_psDBRunQuery(dbh, query);
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "Failed to create table.");
     }
@@ -203,7 +202,7 @@
 
     psStringAppend(&query, "DROP TABLE %s", tableName);
 
-    status = psDBRunQuery(dbh, query);
+    status = p_psDBRunQuery(dbh, query);
     if (!status) {
         psError(PS_ERR_UNKNOWN, false, "Failed to drop table.");
     }
@@ -230,7 +229,7 @@
         return NULL;
     }
 
-    if (!psDBRunQuery(dbh, query)) {
+    if (!p_psDBRunQuery(dbh, query)) {
         psError(PS_ERR_UNKNOWN, false, "Query execution failed.");
         psFree(query);
         return NULL;
@@ -387,7 +386,7 @@
         return NULL;
     }
 
-    if (!psDBRunQuery(dbh, query)) {
+    if (!p_psDBRunQuery(dbh, query)) {
         psError(PS_ERR_UNKNOWN, false, "Query execution failed.");
 
         psFree(query);
@@ -723,7 +722,7 @@
         return -1;
     }
 
-    if (!psDBRunQuery(dbh, query)) {
+    if (!p_psDBRunQuery(dbh, query)) {
         psError(PS_ERR_UNKNOWN, false, "Delete failed.");
 
         mysql_rollback(dbh->mysql);
@@ -749,7 +748,7 @@
 // database utility functions
 /*****************************************************************************/
 
-static bool psDBRunQuery(psDB *dbh, const char *query)
+bool p_psDBRunQuery(psDB *dbh, const char *query)
 {
     if (mysql_real_query(dbh->mysql, query, (unsigned long)strlen(query)) !=0) {
         psError(PS_ERR_UNKNOWN, true, "Failed to execute query.  Error: %s\n", mysql_error(dbh->mysql));
Index: pslib/src/dataIO/psDB.h
diff -u pslib/src/dataIO/psDB.h:1.1 pslib/src/dataIO/psDB.h:1.2
--- pslib/src/dataIO/psDB.h:1.1	Thu Mar 31 13:01:46 2005
+++ pslib/src/dataIO/psDB.h	Mon May 16 11:57:14 2005
@@ -9,8 +9,8 @@
  *
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.1 $ $Name:  $
- *  @date $Date: 2005/03/31 23:01:46 $
+ *  @version $Revision: 1.2 $ $Name:  $
+ *  @date $Date: 2005/05/16 21:57:14 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
  */
@@ -82,6 +82,19 @@
     const char *dbname                  ///< Database namespace
 );
 
+/** Executes a SQL query
+ *
+ * This function will execute a string as a raw SQL query.  No additional
+ * processing of the string or abstraction of the underlying database's SQL
+ * dialect is provided.  Caveat emptor.
+ *
+ * @return true on success
+ */
+bool p_psDBRunQuery(
+    psDB *dbh,                          ///< Database handle
+    const char *query                   ///< SQL string to execute
+);
+
 /** Creates a new database table
  *
  * This function generates and executes the SQL needed to create a table named
