summaryrefslogtreecommitdiff
path: root/src/libtracker-sparql/tracker-connection.h
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2021-07-25 11:56:05 +0200
committerCarlos Garnacho <carlosg@gnome.org>2021-11-06 15:07:13 +0100
commit3e9e17ad6c2b6a7f3c28276106f23ac6ac27557c (patch)
tree29d5d5e4f26bbc54ba4e8693eb70fed7e8d22d49 /src/libtracker-sparql/tracker-connection.h
parentea72f2283760fe670c92db95f726666cf5492522 (diff)
downloadtracker-3e9e17ad6c2b6a7f3c28276106f23ac6ac27557c.tar.gz
libtracker-sparql: Add method to create statement from a resource file
This TrackerSparqlConnection method creates a TrackerSparqlStatement from a query located in a resource path. This could allow a better code/model separation where all Tracker resources are separately editable in the source tree (e.g. distinct per-query .rq files, with syntax highlighting, etc), and still directly available at runtime without further disk reads. There's other nice side effects of this, like having queries nicely indented in logging output (instead of the usual string concatenation in code that makes queries alright to see in the source code, but a mess when logged), or avoiding hard to follow code changes (e.g. mass reindenting) when only query changes are required. Also, queries would be easily readable with the "gresource list/extract" command line tool without looking across the source code.
Diffstat (limited to 'src/libtracker-sparql/tracker-connection.h')
-rw-r--r--src/libtracker-sparql/tracker-connection.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libtracker-sparql/tracker-connection.h b/src/libtracker-sparql/tracker-connection.h
index e8969860f..00840cd16 100644
--- a/src/libtracker-sparql/tracker-connection.h
+++ b/src/libtracker-sparql/tracker-connection.h
@@ -212,6 +212,12 @@ gboolean tracker_sparql_connection_close_finish (TrackerSparqlConnection *conne
GAsyncResult *res,
GError **error);
+TRACKER_AVAILABLE_IN_3_3
+TrackerSparqlStatement * tracker_sparql_connection_load_statement_from_gresource (TrackerSparqlConnection *connection,
+ const gchar *resource_path,
+ GCancellable *cancellable,
+ GError **error);
+
G_END_DECLS
#endif /* __TRACKER_SPARQL_CONNECTION_H__ */