Browse Source

Deprecation track for graph-based txn handling.

Stefano Cossu 1 year ago
parent
commit
1cc16d6c19
2 changed files with 17 additions and 0 deletions
  1. 12 0
      include/graph.h
  2. 5 0
      src/graph.c

+ 12 - 0
include/graph.h

@@ -111,6 +111,12 @@ LSUP_Term *
 LSUP_graph_uri (const LSUP_Graph *gr);
 
 
+/** @brief Underlying graph store handle.
+ */
+LSUP_Store *
+LSUP_graph_store (const LSUP_Graph *gr);
+
+
 /** Set the URI of a graph.
  *
  * Note that by changing the URI of a graph backed by a context-sensitive store
@@ -178,6 +184,8 @@ LSUP_graph_contains (const LSUP_Graph *gr, const LSUP_Triple *spo);
  * The transaction must be either committed with #LSUP_graph_commit() or
  * rolled back with #LSUP_graph_abort().
  *
+ * TODO Deprecate in favor of direct access to the store handle.
+ *
  * @param[in] gr Graph handle.
  *
  * @param[in] flags Unused for now, use 0. TODO
@@ -196,6 +204,8 @@ LSUP_graph_begin (LSUP_Graph *gr, int flags);
  * error, the transaction is left open and it is advisable to roll it back with
  * #LSUP_graph_abort().
  *
+ * TODO Deprecate in favor of direct access to the store handle.
+ *
  * @param[in] gr Graph handle.
  *
  * @return LSUP_OK if the transaction was committed successfully; LSUP_NOACTION
@@ -209,6 +219,8 @@ LSUP_rc LSUP_graph_commit (LSUP_Graph *gr);
  * If the underlying store supports it, abort an open transaction and abandon
  * all changes.
  *
+ * TODO Deprecate in favor of direct access to the store handle.
+ *
  * @param[in] gr Graph handle.
  */
 void LSUP_graph_abort (LSUP_Graph *gr);

+ 5 - 0
src/graph.c

@@ -189,6 +189,11 @@ LSUP_Term *
 LSUP_graph_uri (const LSUP_Graph *gr) { return gr->uri; }
 
 
+LSUP_Store *
+LSUP_graph_store (const LSUP_Graph *gr)
+{ return gr->store; }
+
+
 LSUP_rc
 LSUP_graph_set_uri (LSUP_Graph *gr, LSUP_Term *uri)
 {