Skip to content

[RFC] libtracker-sparql: Add method to create statement from a resource file

Carlos Garnacho requested to merge wip/carlosg/statement-from-resource into master

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.

Edited by Carlos Garnacho

Merge request reports