Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: Frank Lanitz frank@frank.uvena.de Date: Sun, 28 Sep 2014 19:13:04 UTC Commit: 36fdddc5f2d0972858d2fbc1d3d39e6add6efc08 https://github.com/geany/geany-plugins/commit/36fdddc5f2d0972858d2fbc1d3d39e...
Log Message: ----------- Tableconvert: SQL: All colums are now handled as strings
Modified Paths: -------------- tableconvert/ChangeLog tableconvert/src/tableconvert.c
Modified: tableconvert/ChangeLog 8 lines changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -1,3 +1,11 @@ +2014-09-28 Frank Lanitz frank@frank.uvena.de + + * SQL: Treating every column as a string when transfering data to SQL + Most DBMS can take a string and convert them to e.g. integer. + However, some check for integer would be useful nevertheless + + + 2011-10-06 Frank Lanitz frlan@frank.uvena.de
* Fixing some i18n issue.
Modified: tableconvert/src/tableconvert.c 17 lines changed, 9 insertions(+), 8 deletions(-) =================================================================== @@ -1,7 +1,7 @@ /* * tableconvert.c * - * Copyright 2011-2013 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + * Copyright 2011-2014 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -94,9 +94,9 @@ TableConvertRule tablerules[] = { "", "", "", - ",", - "\t(", - ")", + "','", + "\t('", + "')", ",\n", ";" } @@ -105,7 +105,7 @@ TableConvertRule tablerules[] = {
static GtkWidget *main_menu_item = NULL;
-static gchar* convert_to_table_worker(gchar **rows, gboolean header, +static gchar* convert_to_table_worker(gchar **rows, gboolean header, const TableConvertRule *rule) { guint i; @@ -135,8 +135,8 @@ static gchar* convert_to_table_worker(gchar **rows, gboolean header, header == TRUE) { g_string_append(replacement_str, rule->header_stop); - /* We are assuming, that if someone inserts a head, - * only in this case we will insert some special body. + /* We are assuming, that if someone inserts a head, + * only in this case we will insert some special body. * Might needs to be discussed further */ g_string_append(replacement_str, rule->body_start); } @@ -165,7 +165,7 @@ static gchar* convert_to_table_worker(gchar **rows, gboolean header, { g_string_append(replacement_str, rule->body_end); } - + /* Adding the footer of table */ g_string_append(replacement_str, rule->end);
@@ -218,6 +218,7 @@ static void convert_to_table(gboolean header) } case GEANY_FILETYPES_SQL: { + /* TODO: Check for INTEGER and other datatypes on SQL */ replacement = convert_to_table_worker(rows, header, &tablerules[TC_SQL]);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org