From 7b51842728b6ee99945afe401fca317c703a12d9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Jun 2021 11:28:56 +0200 Subject: Add support for bulk operations using pipeline mode in libpq 14 --- odb/pgsql/pgsql-types.hxx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'odb/pgsql/pgsql-types.hxx') diff --git a/odb/pgsql/pgsql-types.hxx b/odb/pgsql/pgsql-types.hxx index 93e4870..117a41e 100644 --- a/odb/pgsql/pgsql-types.hxx +++ b/odb/pgsql/pgsql-types.hxx @@ -14,8 +14,13 @@ namespace odb { namespace pgsql { - // The libpq result binding. This data structures is - // modelled after MYSQL_BIND from MySQL. + // The libpq result binding. This data structures is roughly modeled + // after MYSQL_BIND from MySQL. + // + // Types that may need to grow are bound as pointers to pointers to char + // array (normally in details::buffer) in order to allow simple offsetting + // in bulk operation support. Note that if we were to do the same for + // capacity, we could get rid of the buffer growth tracking altogether. // struct bind { @@ -27,14 +32,14 @@ namespace odb bigint, // Buffer is long long; size, capacity, truncated are unused. real, // Buffer is float; size, capacity, truncated are unused. double_, // Buffer is double; size, capacity, truncated are unused. - numeric, // Buffer is a char array. + numeric, // Buffer is a pointer to pointer to char array. date, // Buffer is int; size, capacity, truncated are unused. time, // Buffer is long long; size, capacity, truncated are unused. timestamp,// Buffer is long long; size, capacity, truncated are unused. - text, // Buffer is a char array. - bytea, // Buffer is a char array. - bit, // Buffer is a char array. - varbit, // Buffer is a char array. + text, // Buffer is a pointer to pointer to char array. + bytea, // Buffer is a pointer to pointer to char array. + bit, // Buffer is a pointer to char array. + varbit, // Buffer is a pointer to pointer to char array. uuid // Buffer is a 16-byte char array; size capacity, truncated // are unused. Note: big-endian, in RFC 4122/4.1.2 order. }; -- cgit v1.1