[glom/sqlbuilder2] Use SqlBuilder in all possible remaining places.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/sqlbuilder2] Use SqlBuilder in all possible remaining places.
- Date: Wed, 12 May 2010 22:30:07 +0000 (UTC)
commit a7a2e6e963908d292d22ff1af70a39fadb6a69a6
Author: Murray Cumming <murrayc murrayc com>
Date: Thu May 13 00:25:16 2010 +0200
Use SqlBuilder in all possible remaining places.
* glom/libglom/db_utils.[h|cc]: Renamed query_execute(string) to
query_execute_string() so we catch uses of it that could use SqlBuilder.
* glom/base_db.cc: Replaced some INSERT and DELETE string sql queries
with SqlBuilder.
* glom/base_db_table_data.cc:
* glom/libglom/db_utils.cc:
* glom/libglom/db_utils.h:
* glom/libglom/privs.cc:
* glom/mode_design/users/dialog_groups_list.cc:
* glom/mode_design/users/dialog_users_list.cc:
* glom/navigation/box_tables.cc: Adapt.
ChangeLog | 19 ++++++++-
glom/base_db.cc | 16 ++++----
glom/base_db_table_data.cc | 57 ++++++++++---------------
glom/libglom/db_utils.cc | 23 +++++-----
glom/libglom/db_utils.h | 8 ++-
glom/libglom/privs.cc | 2 +-
glom/mode_design/users/dialog_groups_list.cc | 8 ++--
glom/mode_design/users/dialog_users_list.cc | 6 +-
glom/navigation/box_tables.cc | 4 +-
9 files changed, 75 insertions(+), 68 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 448dd62..fa33660 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,27 @@
+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
+ query_execute_string() so we catch uses of it that could use SqlBuilder.
+
+ * glom/base_db.cc: Replaced some INSERT and DELETE string sql queries
+ with SqlBuilder.
+ * glom/base_db_table_data.cc:
+ * glom/libglom/db_utils.cc:
+ * glom/libglom/db_utils.h:
+ * glom/libglom/privs.cc:
+ * glom/mode_design/users/dialog_groups_list.cc:
+ * glom/mode_design/users/dialog_users_list.cc:
+ * glom/navigation/box_tables.cc: Adapt.
+
2010-05-12 Murray Cumming <murrayc murrayc com>
Remove redundant BaseDb::query_execute*() methods.
* glom/base_db.[h|cc]: Removed query_execute_select() and query_execute().
The same methods in DbUtils replace them.
- * glom/libglom/db_utils.h: Removed the query_execute_select(string) override.
+ * glom/libglom/db_utils.[h|cc]: Removed the query_execute_select(string) override.
* glom/mode_data/box_data_calendar_related.cc:
* glom/mode_data/box_data_details.cc:
* glom/mode_data/box_data_portal.cc:
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 875b5a4..1c5ac2e 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -2020,7 +2020,7 @@ bool Base_DB::add_user(const Glib::ustring& user, const Glib::ustring& password,
//strQuery += " PASSWORD '" + password + "'" ; //TODO: Escape the password.
- bool test = DbUtils::query_execute(strQuery);
+ bool test = DbUtils::query_execute_string(strQuery);
if(!test)
{
std::cerr << "Base_DB::add_user(): CREATE USER failed." << std::endl;
@@ -2029,7 +2029,7 @@ bool Base_DB::add_user(const Glib::ustring& user, const Glib::ustring& password,
//Add it to the group:
strQuery = "ALTER GROUP \"" + group + "\" ADD USER \"" + user + "\"";
- test = DbUtils::query_execute(strQuery);
+ test = DbUtils::query_execute_string(strQuery);
if(!test)
{
std::cerr << "Base_DB::add_user(): ALTER GROUP failed." << std::endl;
@@ -2046,7 +2046,7 @@ bool Base_DB::add_user(const Glib::ustring& user, const Glib::ustring& password,
for(Document::type_listTableInfo::const_iterator iter = table_list.begin(); iter != table_list.end(); ++iter)
{
const Glib::ustring strQuery = "REVOKE ALL PRIVILEGES ON \"" + (*iter)->get_name() + "\" FROM \"" + user + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
std::cerr << "Base_DB::add_user(): REVOKE failed." << std::endl;
}
@@ -2061,7 +2061,7 @@ bool Base_DB::remove_user(const Glib::ustring& user)
return false;
const Glib::ustring strQuery = "DROP USER \"" + user + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
{
std::cerr << "Base_DB::remove_user(): DROP USER failed" << std::endl;
@@ -2077,7 +2077,7 @@ bool Base_DB::remove_user_from_group(const Glib::ustring& user, const Glib::ustr
return false;
const Glib::ustring strQuery = "ALTER GROUP \"" + group + "\" DROP USER \"" + user + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
{
std::cerr << "Base_DB::remove_user_from_group(): ALTER GROUP failed." << std::endl;
@@ -2098,10 +2098,10 @@ bool Base_DB::set_database_owner_user(const Glib::ustring& user)
return false;
const Glib::ustring strQuery = "ALTER DATABASE \"" + database_name + "\" OWNER TO \"" + user + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
{
- std::cerr << "Base_DB::set_database_owner_user(): ALTER DATABSE failed." << std::endl;
+ std::cerr << "Base_DB::set_database_owner_user(): ALTER DATABASE failed." << std::endl;
return false;
}
@@ -2122,7 +2122,7 @@ bool Base_DB::disable_user(const Glib::ustring& user)
}
const Glib::ustring strQuery = "ALTER ROLE \"" + user + "\" NOLOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
{
std::cerr << "Base_DB::remove_user(): DROP USER failed" << std::endl;
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index 1cb05c6..38ceaa2 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -161,8 +161,8 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
}
//Get all entered field name/value pairs:
- Glib::ustring strNames;
- Glib::ustring strValues;
+ Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+ builder->set_table(m_table_name);
//Avoid specifying the same field twice:
typedef std::map<Glib::ustring, bool> type_map_added;
@@ -206,17 +206,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
*/
if(!value.is_null())
{
- if(!strNames.empty())
- {
- strNames += ", ";
- strValues += ", ";
- }
-
- strNames += "\"" + field_name + "\"";
- strValues += field->get_gda_holder_string();
- Glib::RefPtr<Gnome::Gda::Holder> holder = field->get_holder(value);
- params->add_holder(holder);
-
+ builder->add_field_value(field_name, value);
map_added[field_name] = true;
}
}
@@ -225,10 +215,9 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
}
//Put it all together to create the record with these field values:
- if(!strNames.empty() && !strValues.empty())
+ if(!map_added.empty())
{
- const Glib::ustring strQuery = "INSERT INTO \"" + m_table_name + "\" (" + strNames + ") VALUES (" + strValues + ")";
- const bool test = DbUtils::query_execute(strQuery, params);
+ const bool test = DbUtils::query_execute(builder);
if(!test)
std::cerr << "Box_Data::record_new(): INSERT failed." << std::endl;
else
@@ -244,7 +233,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
//TODO_Performance: We just set this with set_entered_field_data() above. Maybe we could just remember it.
const Gnome::Gda::Value field_value = get_entered_field_data(layout_item);
- LayoutFieldInRecord field_in_record(layout_item, m_table_name, fieldPrimaryKey, primary_key_value);
+ const LayoutFieldInRecord field_in_record(layout_item, m_table_name, fieldPrimaryKey, primary_key_value);
//Get-and-set values for lookup fields, if this field triggers those relationships:
do_lookups(field_in_record, row, field_value);
@@ -378,10 +367,11 @@ bool Base_DB_Table_Data::add_related_record_for_field(const sharedptr<const Layo
//Generate the new key value;
}
- Glib::RefPtr<Gnome::Gda::Set> params = Gnome::Gda::Set::create();
- params->add_holder(primary_key_field->get_holder(primary_key_value));
- const Glib::ustring strQuery = "INSERT INTO \"" + relationship->get_to_table() + "\" (\"" + primary_key_field->get_name() + "\") VALUES (" + primary_key_field->get_gda_holder_string() + ")";
- const bool test = DbUtils::query_execute(strQuery, params);
+
+ Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+ builder->set_table(relationship->get_to_table());
+ builder->add_field_value(primary_key_field->get_name(), primary_key_value);
+ const bool test = DbUtils::query_execute(builder);
if(!test)
{
std::cerr << "Base_DB_Table_Data::add_related_record_for_field(): INSERT failed." << std::endl;
@@ -420,23 +410,17 @@ bool Base_DB_Table_Data::add_related_record_for_field(const sharedptr<const Layo
return false;
}
else
- {
- params->add_holder(parent_primary_key_field->get_holder(parent_primary_key_value));
- const Glib::ustring strQuery = "UPDATE \"" + relationship->get_from_table() + "\" SET \"" + relationship->get_from_field() + "\" = " + primary_key_field->get_gda_holder_string() +
- " WHERE \"" + relationship->get_from_table() + "\".\"" + parent_primary_key_field->get_name() + "\" = " + parent_primary_key_field->get_gda_holder_string();
-
- /* TODO: Use SqlBuilder when can know how to specify the related field properly in the condition:
+ {
Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
builder->set_table(relationship->get_from_table());
builder->add_field_value_as_value(relationship->get_from_field(), primary_key_value);
builder->set_where(
builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
- builder->add_id("\"" + relationship->get_from_table() + "\".\"" + parent_primary_key_field->get_name() + "\""),
- builder->add_expr(parent_primary_key_value)),
- */
+ builder->add_id(parent_primary_key_field->get_name()),
+ builder->add_expr(parent_primary_key_value)) );
- const bool test = DbUtils::query_execute(strQuery, params);
+ const bool test = DbUtils::query_execute(builder);
if(!test)
{
std::cerr << "Base_DB_Table_Data::add_related_record_for_field(): UPDATE failed." << std::endl;
@@ -489,9 +473,14 @@ bool Base_DB_Table_Data::record_delete(const Gnome::Gda::Value& primary_key_valu
sharedptr<Field> field_primary_key = get_field_primary_key();
if(field_primary_key && !Conversions::value_is_empty(primary_key_value))
{
- Glib::RefPtr<Gnome::Gda::Set> params = Gnome::Gda::Set::create();
- params->add_holder(field_primary_key->get_holder(primary_key_value));
- return DbUtils::query_execute( "DELETE FROM \"" + m_table_name + "\" WHERE \"" + m_table_name + "\".\"" + field_primary_key->get_name() + "\" = " + field_primary_key->get_gda_holder_string(), params);
+ Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+ Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_DELETE);
+ builder->set_table(m_table_name);
+ builder->set_where(
+ builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
+ builder->add_id(field_primary_key->get_name()),
+ builder->add_expr(primary_key_value)) );
+ return DbUtils::query_execute(builder);
}
else
{
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index 1cdfa34..e990a2f 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -619,7 +619,7 @@ bool add_standard_groups(Document* document)
{
//The "SUPERUSER" here has no effect because SUPERUSER is not "inherited" to member users.
//But let's keep it to make the purpose of this group obvious.
- bool test = query_execute("CREATE GROUP \"" GLOM_STANDARD_GROUP_NAME_DEVELOPER "\" WITH SUPERUSER");
+ bool test = query_execute_string("CREATE GROUP \"" GLOM_STANDARD_GROUP_NAME_DEVELOPER "\" WITH SUPERUSER");
if(!test)
{
std::cerr << "Glom add_standard_groups(): CREATE GROUP failed when adding the developer group." << std::endl;
@@ -629,8 +629,8 @@ bool add_standard_groups(Document* document)
//Make sure the current user is in the developer group.
//(If he is capable of creating these groups then he is obviously a developer, and has developer rights on the postgres server.)
const Glib::ustring current_user = ConnectionPool::get_instance()->get_user();
- Glib::ustring strQuery = "ALTER GROUP \"" GLOM_STANDARD_GROUP_NAME_DEVELOPER "\" ADD USER \"" + current_user + "\"";
- test = query_execute(strQuery);
+ const Glib::ustring strQuery = "ALTER GROUP \"" GLOM_STANDARD_GROUP_NAME_DEVELOPER "\" ADD USER \"" + current_user + "\"";
+ test = query_execute_string(strQuery);
if(!test)
{
std::cerr << "Glom add_standard_groups(): ALTER GROUP failed when adding the user to the developer group." << std::endl;
@@ -1181,7 +1181,7 @@ bool create_table(const sharedptr<const TableInfo>& table_info, const Document::
{
//TODO: Escape the table name?
//TODO: Use GDA_SERVER_OPERATION_CREATE_TABLE instead?
- table_creation_succeeded = query_execute( "CREATE TABLE \"" + table_info->get_name() + "\" (" + sql_fields + ");" );
+ table_creation_succeeded = query_execute_string( "CREATE TABLE \"" + table_info->get_name() + "\" (" + sql_fields + ");" );
if(!table_creation_succeeded)
std::cerr << "create_table(): CREATE TABLE failed." << std::endl;
}
@@ -1512,7 +1512,7 @@ bool insert_example_data(Document* document, const Glib::ustring& table_name)
//After this, the Parser will know how many SQL parameters there are in
//the query, and allow us to set their values.
const Glib::ustring strQuery = "INSERT INTO \"" + table_name + "\" (" + strNames + ") VALUES (" + strVals + ")";
- insert_succeeded = query_execute(strQuery, params);
+ insert_succeeded = query_execute_string(strQuery, params);
if(!insert_succeeded)
break;
}
@@ -1526,8 +1526,7 @@ bool insert_example_data(Document* document, const Glib::ustring& table_name)
}
//static:
-Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder,
- const Glib::RefPtr<const Gnome::Gda::Set>& params)
+Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder)
{
Glib::RefPtr<Gnome::Gda::DataModel> result;
@@ -1543,7 +1542,7 @@ Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<cons
//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::cout << "Debug: query_execute_select(): " << full_query << std::endl;
}
@@ -1551,7 +1550,7 @@ Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<cons
#ifdef GLIBMM_EXCEPTIONS_ENABLED
try
{
- result = gda_connection->statement_execute_select_builder(builder, params);
+ result = gda_connection->statement_execute_select_builder(builder);
}
catch(const Gnome::Gda::ConnectionError& ex)
{
@@ -1567,14 +1566,14 @@ Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<cons
}
#else
- result = gda_connection->statement_execute_select_builder(builder, params, ex);
+ result = gda_connection->statement_execute_select_builder(builder, ex);
if(ex.get())
std::cerr << "debug: query_execute_select(): Glib::Error from statement_execute_select_builder(): " << ex->what() << std::endl;
#endif //GLIBMM_EXCEPTIONS_ENABLED
if(!result)
{
- 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 << "Glom query_execute_select(): Error while executing SQL: "
<< std::endl << " " << full_query << std::endl << std::endl;
handle_error();
@@ -1583,7 +1582,7 @@ Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(const Glib::RefPtr<cons
return result;
}
-bool query_execute(const Glib::ustring& strQuery, const Glib::RefPtr<Gnome::Gda::Set>& params)
+bool query_execute_string(const Glib::ustring& strQuery, const Glib::RefPtr<Gnome::Gda::Set>& params)
{
Glib::RefPtr<Gnome::Gda::Connection> gda_connection = get_connection();
if(!gda_connection)
diff --git a/glom/libglom/db_utils.h b/glom/libglom/db_utils.h
index 7f7b5b4..340e7f8 100644
--- a/glom/libglom/db_utils.h
+++ b/glom/libglom/db_utils.h
@@ -75,13 +75,15 @@ bool insert_example_data(Document* document, const Glib::ustring& table_name);
/** Execute a SQL Select command, returning the result.
*/
Glib::RefPtr<Gnome::Gda::DataModel> query_execute_select(
- const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder,
- const Glib::RefPtr<const Gnome::Gda::Set>& params = Glib::RefPtr<const Gnome::Gda::Set>(0));
+ const Glib::RefPtr<const Gnome::Gda::SqlBuilder>& builder);
/** Execute a SQL non-select command, returning true if it succeeded.
+ * See also query_execute(), which takes a SqlBuilder.
+ * This should only be used for SQL commands that are not supported by SqlBuilder,
+ * such as ADD GROUP.
*/
-bool query_execute(const Glib::ustring& strQuery,
+bool query_execute_string(const Glib::ustring& strQuery,
const Glib::RefPtr<Gnome::Gda::Set>& params = Glib::RefPtr<Gnome::Gda::Set>(0));
/** Execute a SQL non-select command, returning true if it succeeded.
diff --git a/glom/libglom/privs.cc b/glom/libglom/privs.cc
index 97fdf20..622149c 100644
--- a/glom/libglom/privs.cc
+++ b/glom/libglom/privs.cc
@@ -246,7 +246,7 @@ void Privs::set_table_privileges(const Glib::ustring& group_name, const Glib::us
strQuery += " GROUP \"" + group_name + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
std::cerr << "Privs::set_table_privileges(): GRANT failed." << std::endl;
else
diff --git a/glom/mode_design/users/dialog_groups_list.cc b/glom/mode_design/users/dialog_groups_list.cc
index 5002485..7dc2552 100644
--- a/glom/mode_design/users/dialog_groups_list.cc
+++ b/glom/mode_design/users/dialog_groups_list.cc
@@ -222,8 +222,8 @@ void Dialog_GroupsList::on_button_group_delete()
if(response == Gtk::RESPONSE_OK)
{
- Glib::ustring strQuery = "DROP GROUP \"" + group + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const Glib::ustring strQuery = "DROP GROUP \"" + group + "\"";
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
std::cerr << "Box_DB_Table_Definition::on_adddel_delete(): DROP GROUP failed." << std::endl;
@@ -253,7 +253,7 @@ void Dialog_GroupsList::on_button_group_new()
if(!group_name.empty())
{
const Glib::ustring strQuery = "CREATE GROUP \"" + group_name + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
std::cout << "Dialog_GroupsList::on_button_group_new(): CREATE GROUP failed." << std::endl;
@@ -480,7 +480,7 @@ bool Dialog_GroupsList::set_table_privilege(const Glib::ustring& table_name, con
strQuery += " GROUP \"" + group_name + "\"";
- const bool test = DbUtils::query_execute(strQuery); //TODO: Handle errors.
+ const bool test = DbUtils::query_execute_string(strQuery); //TODO: Handle errors.
if(!test)
std::cerr << "Dialog_GroupsList::set_table_privilege(): GRANT/REVOKE failed." << std::endl;
diff --git a/glom/mode_design/users/dialog_users_list.cc b/glom/mode_design/users/dialog_users_list.cc
index 8ff983b..53202ea 100644
--- a/glom/mode_design/users/dialog_users_list.cc
+++ b/glom/mode_design/users/dialog_users_list.cc
@@ -203,7 +203,7 @@ void Dialog_UsersList::on_button_user_add()
{
//Add it to the group:
const Glib::ustring strQuery = "ALTER GROUP \"" + m_combo_group->get_active_text() + "\" ADD USER \"" + user + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
std::cerr << "Dialog_UsersList::on_button_user_add(): ALTER GROUP failed." << std::endl;
@@ -213,7 +213,7 @@ void Dialog_UsersList::on_button_user_add()
for(Document::type_listTableInfo::const_iterator iter = table_list.begin(); iter != table_list.end(); ++iter)
{
const Glib::ustring strQuery = "REVOKE ALL PRIVILEGES ON \"" + (*iter)->get_name() + "\" FROM \"" + user + "\"";
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
std::cerr << "Dialog_UsersList::on_button_user_add(): REVOKE failed." << std::endl;
}
@@ -320,7 +320,7 @@ void Dialog_UsersList::on_button_user_edit()
if(!user.empty() && !password.empty())
{
const Glib::ustring strQuery = "ALTER USER \"" + user + "\" PASSWORD '" + password + "'" ; //TODO: Escape the password.
- const bool test = DbUtils::query_execute(strQuery);
+ const bool test = DbUtils::query_execute_string(strQuery);
if(!test)
std::cerr << "Dialog_UsersList::on_button_user_edit(): ALTER USER failed." << std::endl;
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index 2a0d097..9932c58 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -313,7 +313,7 @@ void Box_Tables::on_adddel_Delete(const Gtk::TreeModel::iterator& rowStart, cons
//Delete the table:
if(iButtonClicked == Gtk::RESPONSE_OK)
{
- const bool test = DbUtils::query_execute( "DROP TABLE \"" + table_name + "\"");
+ const bool test = DbUtils::query_execute_string( "DROP TABLE \"" + table_name + "\"");
if(!test)
std::cerr << "Box_Tables::on_adddel_Delete(): DROP TABLE failed." << std::endl;
else
@@ -386,7 +386,7 @@ void Box_Tables::on_adddel_changed(const Gtk::TreeModel::iterator& row, guint co
//Rename the table:
if(iButtonClicked == Gtk::RESPONSE_OK)
{
- const bool test = DbUtils::query_execute( "ALTER TABLE \"" + table_name + "\" RENAME TO \"" + table_name_new + "\"");
+ const bool test = DbUtils::query_execute_string( "ALTER TABLE \"" + table_name + "\" RENAME TO \"" + table_name_new + "\"");
if(test)
{
//Change the AddDel item's key:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]