[libgda] Gda: Fixing CreateOperation for RENAME COLUMN
- From: Pavlo Solntsev <psolntsev src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Gda: Fixing CreateOperation for RENAME COLUMN
- Date: Sun, 12 Jul 2020 03:38:52 +0000 (UTC)
commit cf35f023376389c81029f0c9125a4743da2df434
Author: Pavlo Solntsev <p sun fun gmail com>
Date: Thu May 28 08:38:06 2020 -0500
Gda: Fixing CreateOperation for RENAME COLUMN
Fixing implementation of the RENAME COLUMN
Fixing xml node names on operation description. (xml file)
libgda/gda-server-operation.c | 2 ++
libgda/gda-server-provider.c | 9 +++++++++
libgda/sqlite/gda-sqlite-provider.c | 1 +
providers/sqlite/sqlite_specs_rename_column.xml.in | 6 +++---
4 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/libgda/gda-server-operation.c b/libgda/gda-server-operation.c
index 7f0b072b9..e320af2c4 100644
--- a/libgda/gda-server-operation.c
+++ b/libgda/gda-server-operation.c
@@ -1327,6 +1327,8 @@ gda_server_operation_op_type_to_string (GdaServerOperationType type)
return "ADD_COLUMN";
case GDA_SERVER_OPERATION_DROP_COLUMN:
return "DROP_COLUMN";
+ case GDA_SERVER_OPERATION_RENAME_COLUMN:
+ return "RENAME_COLUMN";
case GDA_SERVER_OPERATION_COMMENT_COLUMN:
return "COMMENT_COLUMN";
case GDA_SERVER_OPERATION_CREATE_VIEW:
diff --git a/libgda/gda-server-provider.c b/libgda/gda-server-provider.c
index 0a262aa4c..97556ad20 100644
--- a/libgda/gda-server-provider.c
+++ b/libgda/gda-server-provider.c
@@ -854,6 +854,14 @@ static OpReq op_req_COMMENT_COLUMN [] = {
{NULL, 0, 0}
};
+static OpReq op_req_RENAME_COLUMN [] = {
+ {"/COLUMN_DEF_P", GDA_SERVER_OPERATION_NODE_PARAMLIST, 0},
+ {"/COLUMN_DEF_P/TABLE_NAME", GDA_SERVER_OPERATION_NODE_PARAM, G_TYPE_STRING},
+ {"/COLUMN_DEF_P/COLUMN_NAME", GDA_SERVER_OPERATION_NODE_PARAM, G_TYPE_STRING},
+ {"/COLUMN_DEF_P/COLUMN_NAME_NEW", GDA_SERVER_OPERATION_NODE_PARAM, G_TYPE_STRING},
+ {NULL, 0, 0}
+};
+
static OpReq op_req_CREATE_INDEX [] = {
{"/INDEX_DEF_P/INDEX_NAME", GDA_SERVER_OPERATION_NODE_PARAM, G_TYPE_STRING},
{"/INDEX_DEF_P/INDEX_ON_TABLE", GDA_SERVER_OPERATION_NODE_PARAM, G_TYPE_STRING},
@@ -938,6 +946,7 @@ gda_server_provider_create_operation (GdaServerProvider *provider, GdaConnection
op_req_table [GDA_SERVER_OPERATION_ADD_COLUMN] = op_req_ADD_COLUMN;
op_req_table [GDA_SERVER_OPERATION_DROP_COLUMN] = op_req_DROP_COLUMN;
+ op_req_table [GDA_SERVER_OPERATION_RENAME_COLUMN] = op_req_RENAME_COLUMN;
op_req_table [GDA_SERVER_OPERATION_CREATE_INDEX] = op_req_CREATE_INDEX;
op_req_table [GDA_SERVER_OPERATION_DROP_INDEX] = op_req_DROP_INDEX;
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index 21fa20b71..835de3460 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -1511,6 +1511,7 @@ gda_sqlite_provider_supports_operation (G_GNUC_UNUSED GdaServerProvider *provide
case GDA_SERVER_OPERATION_RENAME_TABLE:
case GDA_SERVER_OPERATION_ADD_COLUMN:
+ case GDA_SERVER_OPERATION_RENAME_COLUMN:
case GDA_SERVER_OPERATION_CREATE_INDEX:
case GDA_SERVER_OPERATION_DROP_INDEX:
diff --git a/providers/sqlite/sqlite_specs_rename_column.xml.in
b/providers/sqlite/sqlite_specs_rename_column.xml.in
index 87f49fca4..a06f4791f 100644
--- a/providers/sqlite/sqlite_specs_rename_column.xml.in
+++ b/providers/sqlite/sqlite_specs_rename_column.xml.in
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<serv_op>
<parameters id="COLUMN_DEF_P">
- <parameter id="TABLE_NAME" _name="Table" _descr="Table to ALTER" gdatype="gchararray" nullok="FALSE"
source="_DICT_TABLES_"/>
- <parameter id="COLUMN_NAME" _name="Column" _descr="Column to rename" gdatype="gchararray" nullok="FALSE"
source="_DICT_COLUMNS_"/>
- <parameter id="COLUMN_NEW_NAME" _name="New name" _descr="New column name" gdatype="gchararray"
nullok="FALSE"/>
+ <parameter id="TABLE_NAME" _name="Table" _descr="Table to ALTER" gdatype="gchararray" nullok="FALSE"/>
+ <parameter id="COLUMN_NAME" _name="Column" _descr="Column to rename" gdatype="gchararray"
nullok="FALSE"/>
+ <parameter id="COLUMN_NAME_NEW" _name="New name" _descr="New column name" gdatype="gchararray"
nullok="FALSE"/>
</parameters>
</serv_op>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]