gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: pq: expose array-type->oid mapping via f


From: gnunet
Subject: [gnunet] branch master updated: pq: expose array-type->oid mapping via function
Date: Wed, 26 Jul 2023 03:52:37 +0200

This is an automated email from the git hooks/post-receive script.

oec pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new b14eee0fd pq: expose array-type->oid mapping via function
b14eee0fd is described below

commit b14eee0fdd9c3f5283788fd60733b5a08d39a17f
Author: Özgür Kesim <oec-taler@kesim.org>
AuthorDate: Wed Jul 26 03:51:17 2023 +0200

    pq: expose array-type->oid mapping via function
    
    NEWS: added GNUNET_PQ_get_oid()
---
 src/include/gnunet_pq_lib.h | 14 +++++++++++++-
 src/pq/pq_connect.c         | 10 ++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index 69cf84583..edb0519b0 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -31,13 +31,13 @@
 #include "gnunet_time_lib.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_db_lib.h"
+#include "postgres_ext.h"
 
 /**
  * Postgres context.
  */
 struct GNUNET_PQ_Context;
 
-
 /* ************************* pq_query_helper.c functions 
************************ */
 
 
@@ -197,6 +197,18 @@ enum GNUNET_PQ_DataTypes
   GNUNET_PQ_DATATYPE_MAX, /* Must be last */
 };
 
+/**
+ * Returns the oid for a given datatype
+ *
+ * @param db The db-connection
+ * @param typ the Datatype
+ * @return The oid
+ */
+Oid
+GNUNET_PQ_get_oid (
+  const struct GNUNET_PQ_Context *db,
+  enum GNUNET_PQ_DataTypes typ);
+
 /**
  * Generate query parameter for an array of bool in host byte order.
  *
diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c
index 9493eb2d7..f30f989ea 100644
--- a/src/pq/pq_connect.c
+++ b/src/pq/pq_connect.c
@@ -420,6 +420,16 @@ get_array_type_oids (struct GNUNET_PQ_Context *db)
 }
 
 
+Oid
+GNUNET_PQ_get_oid (
+  const struct GNUNET_PQ_Context *db,
+  enum GNUNET_PQ_DataTypes typ)
+{
+  GNUNET_assert (GNUNET_PQ_DATATYPE_MAX > typ);
+  return db->oids[typ];
+}
+
+
 void
 GNUNET_PQ_reconnect (struct GNUNET_PQ_Context *db)
 {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]