[glom/sqlbuilder2] DbUtils::query_execute(): Remove params parameter.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/sqlbuilder2] DbUtils::query_execute(): Remove params parameter.
- Date: Wed, 12 May 2010 22:30:12 +0000 (UTC)
commit 93af5cc63fc572ce34ece708bb3d566b5d943272
Author: Murray Cumming <murrayc murrayc com>
Date: Thu May 13 00:28:15 2010 +0200
DbUtils::query_execute(): Remove params parameter.
* glom/libglom/db_utils.[h|cc]: query_execute(): Remove the unused params
parameter.
ChangeLog | 7 +++++++
glom/libglom/db_utils.cc | 25 ++++++++++++-------------
glom/libglom/db_utils.h | 3 +--
3 files changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fa33660..2e9190a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2010-05-13 Murray Cumming <murrayc murrayc com>
+ DbUtils::query_execute(): Remove params parameter.
+
+ * glom/libglom/db_utils.[h|cc]: query_execute(): Remove the unused params
+ parameter.
+
+2010-05-13 Murray Cumming <murrayc murrayc com>
+
Use SqlBuilder in all possible remaining places.
* glom/libglom/db_utils.[h|cc]: Renamed query_execute(string) to
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index e990a2f..4160c40 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -1600,7 +1600,7 @@ bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnom
}
catch(const Gnome::Gda::SqlParserError& error)
{
- std::cerr << "DEBUG: BaseDB::query_execute: SqlParserError: " << error.what() << std::endl;
+ std::cerr << "DEBUG: DbUtils::query_execute: SqlParserError: " << error.what() << std::endl;
return false;
}
#else
@@ -1608,7 +1608,7 @@ bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnom
stmt = parser->parse_string(strQuery, sql_error);
if(sql_error.get())
{
- std::cerr << "DEBUG: BaseDB::query_execute: SqlParserError:" << sql_error->what() << std::endl;
+ std::cerr << "DEBUG: DbUtils::query_execute: SqlParserError:" << sql_error->what() << std::endl;
return false;
}
#endif
@@ -1646,7 +1646,7 @@ bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnom
}
catch(const Glib::Error& error)
{
- std::cerr << "BaseDB::query_execute: ConnectionError: " << error.what() << std::endl;
+ std::cerr << "DbUtils::query_execute: ConnectionError: " << error.what() << std::endl;
const Glib::ustring full_query = stmt->to_sql(params);
std::cerr << " full_query: " << full_query << std::endl;
return false;
@@ -1656,7 +1656,7 @@ bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnom
exec_retval = gda_connection->statement_execute_non_select (stmt, params, exec_error);
if(exec_error.get())
{
- std::cerr << "BaseDB::query_execute: ConnectionError: " << exec_error->what() << std::endl;
+ std::cerr << "DbUtils::query_execute: ConnectionError: " << exec_error->what() << std::endl;
const Glib::ustring full_query = stmt->to_sql(params, exec_error);
std::cerr << " full_query: " << full_query << std::endl;
return false;
@@ -1665,8 +1665,7 @@ bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnom
return (exec_retval >= 0);
}
-bool query_execute(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder,
- const Glib::RefPtr<const Gnome::Gda::Set>& params)
+bool query_execute(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder)
{
Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
if(!gda_connection)
@@ -1678,7 +1677,7 @@ bool query_execute(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder,
//Debug output:
if(builder && ConnectionPool::get_instance()->get_show_debug_output())
{
- const std::string full_query = Utils::sqlbuilder_get_full_query(builder, params);
+ const std::string full_query = Utils::sqlbuilder_get_full_query(builder);
std::cerr << "Debug: query_execute(): " << full_query << std::endl;
}
@@ -1687,22 +1686,22 @@ bool query_execute(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder,
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- exec_retval = gda_connection->statement_execute_non_select_builder(builder, params);
+ exec_retval = gda_connection->statement_execute_non_select_builder(builder);
}
catch(const Glib::Error& error)
{
- std::cerr << "BaseDB::query_execute: ConnectionError: " << error.what() << std::endl;
- const std::string full_query = Utils::sqlbuilder_get_full_query(builder, params);
+ std::cerr << "DbUtils::query_execute: ConnectionError: " << error.what() << std::endl;
+ const std::string full_query = Utils::sqlbuilder_get_full_query(builder);
std::cerr << " full_query: " << full_query << std::endl;
return false;
}
#else
std::auto_ptr<Glib::Error> exec_error;
- exec_retval = gda_connection->statement_execute_non_select_builder(builder, params, exec_error);
+ exec_retval = gda_connection->statement_execute_non_select_builder(builder, exec_error);
if(exec_error.get())
{
- std::cerr << "BaseDB::query_execute: ConnectionError: " << exec_error->what() << std::endl;
- const std::string full_query = Utils::sqlbuilder_get_full_query(builder, params);
+ std::cerr << "DbUtils::query_execute: ConnectionError: " << exec_error->what() << std::endl;
+ const std::string full_query = Utils::sqlbuilder_get_full_query(builder);
std::cerr << " full_query: " << full_query << std::endl;
return false;
}
diff --git a/glom/libglom/db_utils.h b/glom/libglom/db_utils.h
index 340e7f8..9bcd475 100644
--- a/glom/libglom/db_utils.h
+++ b/glom/libglom/db_utils.h
@@ -88,8 +88,7 @@ bool query_execute_string(const Glib::ustring& strQuery,
/** Execute a SQL non-select command, returning true if it succeeded.
*/
-bool query_execute(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder,
- const Glib::RefPtr<const Gnome::Gda::Set>& params = Glib::RefPtr<const Gnome::Gda::Set>(0));
+bool query_execute(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder);
//TODO: Is this used directly?
Gnome::Gda::Value auto_increment_insert_first_if_necessary(const Glib::ustring& table_name, const Glib::ustring& field_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]