[tracker] tracker: Add remote connection support to "tracker sparql" CLI tool



commit e1936b68709621302a627d3703bdd7e06db26fcf
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Mar 20 12:55:09 2016 +0100

    tracker: Add remote connection support to "tracker sparql" CLI tool
    
    The -r/--remote switch can be used to specify the base url to be used
    in queries.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773031

 src/tracker/tracker-sparql.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker/tracker-sparql.c b/src/tracker/tracker-sparql.c
index 23cc691..0b4d267 100644
--- a/src/tracker/tracker-sparql.c
+++ b/src/tracker/tracker-sparql.c
@@ -98,6 +98,7 @@ static gchar *tree;
 static gchar *get_shorthand;
 static gchar *get_longhand;
 static gchar *search;
+static gchar *remote_url;
 
 static GOptionEntry entries[] = {
        { "file", 'f', 0, G_OPTION_ARG_FILENAME, &file,
@@ -148,6 +149,10 @@ static GOptionEntry entries[] = {
          N_("Returns the full namespace for a class."),
          N_("CLASS"),
        },
+       { "remote-service", 'r', 0, G_OPTION_ARG_STRING, &remote_url,
+         N_("Remote service to query to"),
+         N_("BASE_URL"),
+       },
        { NULL }
 };
 
@@ -1070,7 +1075,11 @@ sparql_run (void)
        TrackerSparqlCursor *cursor;
        GError *error = NULL;
 
-       connection = tracker_sparql_connection_get (NULL, &error);
+       if (remote_url != NULL) {
+               connection = tracker_sparql_connection_remote_new (remote_url);
+       } else {
+               connection = tracker_sparql_connection_get (NULL, &error);
+       }
 
        if (!connection) {
                g_printerr ("%s: %s\n",


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