[libgda] SQLite provider: added LIKE keyword constraint recognition



commit 54c442e7ff882ca7cf747e7965e0f2ae71175757
Author: Daniel Espinosa <esodan gmail com>
Date:   Fri Sep 28 13:51:50 2018 -0500

    SQLite provider: added LIKE keyword constraint recognition

 libgda/gda-connection.c                          | 1 +
 libgda/sqlite/virtual/gda-vprovider-data-model.c | 3 +++
 tests/data-models/check_vcnc.c                   | 6 ++++++
 3 files changed, 10 insertions(+)
---
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index 964ab97cf..0a271c9bd 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -71,6 +71,7 @@
 #include <libgda/gda-debug-macros.h>
 #include <libgda/gda-data-handler.h>
 #include <thread-wrapper/itsignaler.h>
+#include <libgda/gda-marshal.h>
 
 #include <glib/gstdio.h>
 #include <fcntl.h>
diff --git a/libgda/sqlite/virtual/gda-vprovider-data-model.c 
b/libgda/sqlite/virtual/gda-vprovider-data-model.c
index 81c3dea3d..695d53be3 100644
--- a/libgda/sqlite/virtual/gda-vprovider-data-model.c
+++ b/libgda/sqlite/virtual/gda-vprovider-data-model.c
@@ -1373,6 +1373,9 @@ map_sqlite3_info_to_gda_filter (sqlite3_index_info *info, GdaVconnectionDataMode
                        case SQLITE_INDEX_CONSTRAINT_MATCH:
                                filter->aConstraint[j].op = GDA_SQL_OPERATOR_TYPE_REGEXP;
                                break;
+                       case SQLITE_INDEX_CONSTRAINT_LIKE:
+                               filter->aConstraint[j].op = GDA_SQL_OPERATOR_TYPE_LIKE;
+                               break;
                        default:
                                g_assert_not_reached ();
                        }
diff --git a/tests/data-models/check_vcnc.c b/tests/data-models/check_vcnc.c
index 7e8483ced..0838b9910 100644
--- a/tests/data-models/check_vcnc.c
+++ b/tests/data-models/check_vcnc.c
@@ -66,10 +66,16 @@ main (int argc, char *argv[])
        file = g_build_filename (CHECK_FILES, "tests", "data-models", "city.csv", NULL);
        city_model = gda_data_model_import_new_file (file, TRUE, options);
        g_free (file);
+       g_print("Imported Data Model for CITIES:\n");
+       g_assert (GDA_IS_DATA_MODEL (city_model));
+       g_print ("%s", gda_data_model_dump_as_string (city_model));
        file = g_build_filename (CHECK_FILES, "tests", "data-models", "country.csv", NULL);
        country_model = gda_data_model_import_new_file (file, TRUE, options);
        g_free (file);
        g_object_unref (options);
+       g_print("Imported Data Model for COUNTRIES:\n");
+       g_assert (GDA_IS_DATA_MODEL (country_model));
+       g_print ("%s", gda_data_model_dump_as_string (country_model));
 
        /* Add data models to connection */
        if (!gda_vconnection_data_model_add_model (GDA_VCONNECTION_DATA_MODEL (virtual), city_model, "city", 
&error)) 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]