[tracker/wip/carlosg/more-sparql-fixes: 7/9] libtracker-data: Add column to triples table to get raw value
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/more-sparql-fixes: 7/9] libtracker-data: Add column to triples table to get raw value
- Date: Sun, 27 Mar 2022 21:11:43 +0000 (UTC)
commit e47d94a89269b91c4c765445d105cbcebe411102
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Mar 26 20:22:16 2022 +0100
libtracker-data: Add column to triples table to get raw value
This column contains the object value as stored in the actual tables,
not a string representation.
src/libtracker-data/tracker-vtab-triples.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-data/tracker-vtab-triples.c b/src/libtracker-data/tracker-vtab-triples.c
index 469a6f02e..6879da38b 100644
--- a/src/libtracker-data/tracker-vtab-triples.c
+++ b/src/libtracker-data/tracker-vtab-triples.c
@@ -44,6 +44,7 @@ enum {
COL_PREDICATE,
COL_OBJECT,
COL_OBJECT_TYPE,
+ COL_OBJECT_RAW,
N_COLS
};
@@ -158,7 +159,8 @@ triples_connect (sqlite3 *db,
" subject INTEGER, "
" predicate INTEGER, "
" object INTEGER, "
- " object_type INTEGER"
+ " object_type INTEGER, "
+ " object_raw INTEGER"
")");
if (rc == SQLITE_OK) {
@@ -200,7 +202,8 @@ triples_best_index (sqlite3_vtab *vtab,
* translation to strings can be done.
*/
if (info->aConstraint[i].iColumn == COL_OBJECT ||
- info->aConstraint[i].iColumn == COL_OBJECT_TYPE)
+ info->aConstraint[i].iColumn == COL_OBJECT_TYPE ||
+ info->aConstraint[i].iColumn == COL_OBJECT_RAW)
continue;
if (info->aConstraint[i].iColumn == COL_ROWID) {
@@ -478,13 +481,15 @@ init_stmt (TrackerTriplesCursor *cursor)
"SELECT %" G_GINT64_FORMAT ", t.ID, "
" (SELECT ID From Resource WHERE Uri = \"%s\"), "
" %s, "
- " %d "
+ " %d, "
+ " t.\"%s\" "
"FROM \"%s\".\"%s\" AS t "
"WHERE 1 ",
graph_id,
tracker_property_get_uri (property),
string_expr,
tracker_property_get_data_type (property),
+ tracker_property_get_name (property),
graph,
tracker_property_get_table_name (property));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]