btrievePython 16.10.30.0b0__tar.gz → 16.10.30.0b2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. {btrievepython-16.10.30.0b0/btrievePython.egg-info → btrievepython-16.10.30.0b2}/PKG-INFO +1 -1
  2. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/btrievePython/__init__.py +182 -8
  3. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/btrievePython/btrieveC.h +6 -4
  4. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/btrievePython/btrieveCpp.h +104 -39
  5. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/btrievePython/btrievePython.cpp +6971 -1449
  6. btrievepython-16.10.30.0b2/btrievePython/win32/btrieveCpp.lib +0 -0
  7. btrievepython-16.10.30.0b2/btrievePython/win64/btrieveCpp.lib +0 -0
  8. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2/btrievePython.egg-info}/PKG-INFO +1 -1
  9. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/pyproject.toml +1 -1
  10. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/setup.cfg +1 -1
  11. btrievepython-16.10.30.0b0/btrievePython/win32/btrieveCpp.lib +0 -0
  12. btrievepython-16.10.30.0b0/btrievePython/win64/btrieveCpp.lib +0 -0
  13. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/LICENSE.txt +0 -0
  14. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/MANIFEST.in +0 -0
  15. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/README.md +0 -0
  16. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/btrievePython.egg-info/SOURCES.txt +0 -0
  17. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/btrievePython.egg-info/dependency_links.txt +0 -0
  18. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/btrievePython.egg-info/top_level.txt +0 -0
  19. {btrievepython-16.10.30.0b0 → btrievepython-16.10.30.0b2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: btrievePython
3
- Version: 16.10.30.0b0
3
+ Version: 16.10.30.0b2
4
4
  Summary: Btrieve Python provides a Client API for Actian Zen
5
5
  Home-page: https://www.actian.com/databases/zen
6
6
  Author: Actian Corporation
@@ -64,6 +64,176 @@ class _SwigNonDynamicMeta(type):
64
64
 
65
65
  def buffer_view_attach(view: "Py_buffer *", obj: "PyObject *", buffer: "char **", size: "Py_ssize_t *") -> "int":
66
66
  return _btrievePython.buffer_view_attach(view, obj, buffer, size)
67
+
68
+ def buffer_view_attach_const(view: "Py_buffer *", obj: "PyObject *", buffer: "char const **", size: "Py_ssize_t *") -> "int":
69
+ return _btrievePython.buffer_view_attach_const(view, obj, buffer, size)
70
+ class SwigPyIterator(object):
71
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
72
+
73
+ def __init__(self, *args, **kwargs):
74
+ raise AttributeError("No constructor defined - class is abstract")
75
+ __repr__ = _swig_repr
76
+ __swig_destroy__ = _btrievePython.delete_SwigPyIterator
77
+
78
+ def value(self) -> "PyObject *":
79
+ return _btrievePython.SwigPyIterator_value(self)
80
+
81
+ def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
82
+ return _btrievePython.SwigPyIterator_incr(self, n)
83
+
84
+ def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *":
85
+ return _btrievePython.SwigPyIterator_decr(self, n)
86
+
87
+ def distance(self, x: "SwigPyIterator") -> "ptrdiff_t":
88
+ return _btrievePython.SwigPyIterator_distance(self, x)
89
+
90
+ def equal(self, x: "SwigPyIterator") -> "bool":
91
+ return _btrievePython.SwigPyIterator_equal(self, x)
92
+
93
+ def copy(self) -> "swig::SwigPyIterator *":
94
+ return _btrievePython.SwigPyIterator_copy(self)
95
+
96
+ def next(self) -> "PyObject *":
97
+ return _btrievePython.SwigPyIterator_next(self)
98
+
99
+ def __next__(self) -> "PyObject *":
100
+ return _btrievePython.SwigPyIterator___next__(self)
101
+
102
+ def previous(self) -> "PyObject *":
103
+ return _btrievePython.SwigPyIterator_previous(self)
104
+
105
+ def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
106
+ return _btrievePython.SwigPyIterator_advance(self, n)
107
+
108
+ def __eq__(self, x: "SwigPyIterator") -> "bool":
109
+ return _btrievePython.SwigPyIterator___eq__(self, x)
110
+
111
+ def __ne__(self, x: "SwigPyIterator") -> "bool":
112
+ return _btrievePython.SwigPyIterator___ne__(self, x)
113
+
114
+ def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
115
+ return _btrievePython.SwigPyIterator___iadd__(self, n)
116
+
117
+ def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &":
118
+ return _btrievePython.SwigPyIterator___isub__(self, n)
119
+
120
+ def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *":
121
+ return _btrievePython.SwigPyIterator___add__(self, n)
122
+
123
+ def __sub__(self, *args) -> "ptrdiff_t":
124
+ return _btrievePython.SwigPyIterator___sub__(self, *args)
125
+ def __iter__(self):
126
+ return self
127
+
128
+ # Register SwigPyIterator in _btrievePython:
129
+ _btrievePython.SwigPyIterator_swigregister(SwigPyIterator)
130
+
131
+ class FloatVector(object):
132
+ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
133
+ __repr__ = _swig_repr
134
+
135
+ def iterator(self) -> "swig::SwigPyIterator *":
136
+ return _btrievePython.FloatVector_iterator(self)
137
+ def __iter__(self):
138
+ return self.iterator()
139
+
140
+ def __nonzero__(self) -> "bool":
141
+ return _btrievePython.FloatVector___nonzero__(self)
142
+
143
+ def __bool__(self) -> "bool":
144
+ return _btrievePython.FloatVector___bool__(self)
145
+
146
+ def __len__(self) -> "std::vector< float >::size_type":
147
+ return _btrievePython.FloatVector___len__(self)
148
+
149
+ def __getslice__(self, i: "std::vector< float >::difference_type", j: "std::vector< float >::difference_type") -> "std::vector< float,std::allocator< float > > *":
150
+ return _btrievePython.FloatVector___getslice__(self, i, j)
151
+
152
+ def __setslice__(self, *args) -> "void":
153
+ return _btrievePython.FloatVector___setslice__(self, *args)
154
+
155
+ def __delslice__(self, i: "std::vector< float >::difference_type", j: "std::vector< float >::difference_type") -> "void":
156
+ return _btrievePython.FloatVector___delslice__(self, i, j)
157
+
158
+ def __delitem__(self, *args) -> "void":
159
+ return _btrievePython.FloatVector___delitem__(self, *args)
160
+
161
+ def __getitem__(self, *args) -> "std::vector< float >::value_type const &":
162
+ return _btrievePython.FloatVector___getitem__(self, *args)
163
+
164
+ def __setitem__(self, *args) -> "void":
165
+ return _btrievePython.FloatVector___setitem__(self, *args)
166
+
167
+ def pop(self) -> "std::vector< float >::value_type":
168
+ return _btrievePython.FloatVector_pop(self)
169
+
170
+ def append(self, x: "std::vector< float >::value_type const &") -> "void":
171
+ return _btrievePython.FloatVector_append(self, x)
172
+
173
+ def empty(self) -> "bool":
174
+ return _btrievePython.FloatVector_empty(self)
175
+
176
+ def size(self) -> "std::vector< float >::size_type":
177
+ return _btrievePython.FloatVector_size(self)
178
+
179
+ def swap(self, v: "FloatVector") -> "void":
180
+ return _btrievePython.FloatVector_swap(self, v)
181
+
182
+ def begin(self) -> "std::vector< float >::iterator":
183
+ return _btrievePython.FloatVector_begin(self)
184
+
185
+ def end(self) -> "std::vector< float >::iterator":
186
+ return _btrievePython.FloatVector_end(self)
187
+
188
+ def rbegin(self) -> "std::vector< float >::reverse_iterator":
189
+ return _btrievePython.FloatVector_rbegin(self)
190
+
191
+ def rend(self) -> "std::vector< float >::reverse_iterator":
192
+ return _btrievePython.FloatVector_rend(self)
193
+
194
+ def clear(self) -> "void":
195
+ return _btrievePython.FloatVector_clear(self)
196
+
197
+ def get_allocator(self) -> "std::vector< float >::allocator_type":
198
+ return _btrievePython.FloatVector_get_allocator(self)
199
+
200
+ def pop_back(self) -> "void":
201
+ return _btrievePython.FloatVector_pop_back(self)
202
+
203
+ def erase(self, *args) -> "std::vector< float >::iterator":
204
+ return _btrievePython.FloatVector_erase(self, *args)
205
+
206
+ def __init__(self, *args):
207
+ _btrievePython.FloatVector_swiginit(self, _btrievePython.new_FloatVector(*args))
208
+
209
+ def push_back(self, x: "std::vector< float >::value_type const &") -> "void":
210
+ return _btrievePython.FloatVector_push_back(self, x)
211
+
212
+ def front(self) -> "std::vector< float >::value_type const &":
213
+ return _btrievePython.FloatVector_front(self)
214
+
215
+ def back(self) -> "std::vector< float >::value_type const &":
216
+ return _btrievePython.FloatVector_back(self)
217
+
218
+ def assign(self, n: "std::vector< float >::size_type", x: "std::vector< float >::value_type const &") -> "void":
219
+ return _btrievePython.FloatVector_assign(self, n, x)
220
+
221
+ def resize(self, *args) -> "void":
222
+ return _btrievePython.FloatVector_resize(self, *args)
223
+
224
+ def insert(self, *args) -> "void":
225
+ return _btrievePython.FloatVector_insert(self, *args)
226
+
227
+ def reserve(self, n: "std::vector< float >::size_type") -> "void":
228
+ return _btrievePython.FloatVector_reserve(self, n)
229
+
230
+ def capacity(self) -> "std::vector< float >::size_type":
231
+ return _btrievePython.FloatVector_capacity(self)
232
+ __swig_destroy__ = _btrievePython.delete_FloatVector
233
+
234
+ # Register FloatVector in _btrievePython:
235
+ _btrievePython.FloatVector_swigregister(FloatVector)
236
+
67
237
  class Btrieve(object):
68
238
  thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
69
239
 
@@ -534,6 +704,7 @@ class Btrieve(object):
534
704
  STATUS_CODE_UT_THUNK_NOT_LOADED = _btrievePython.Btrieve_STATUS_CODE_UT_THUNK_NOT_LOADED
535
705
  STATUS_CODE_NO_RESOURCE_DLL = _btrievePython.Btrieve_STATUS_CODE_NO_RESOURCE_DLL
536
706
  STATUS_CODE_OS_ERROR = _btrievePython.Btrieve_STATUS_CODE_OS_ERROR
707
+ STATUS_CODE_FILTER_LIMIT_EXCEEDED = _btrievePython.Btrieve_STATUS_CODE_FILTER_LIMIT_EXCEEDED
537
708
  STATUS_CODE_MK_ROUTER_MEM_ERROR = _btrievePython.Btrieve_STATUS_CODE_MK_ROUTER_MEM_ERROR
538
709
  STATUS_CODE_MK_NO_LOCAL_ACCESS_ALLOWED = _btrievePython.Btrieve_STATUS_CODE_MK_NO_LOCAL_ACCESS_ALLOWED
539
710
  STATUS_CODE_MK_NO_RESOURCE_DLL = _btrievePython.Btrieve_STATUS_CODE_MK_NO_RESOURCE_DLL
@@ -1826,11 +1997,14 @@ class BtrieveSpace(object):
1826
1997
  _btrievePython.BtrieveSpace_swiginit(self, _btrievePython.new_BtrieveSpace())
1827
1998
  __swig_destroy__ = _btrievePython.delete_BtrieveSpace
1828
1999
 
2000
+ def VectorCreateFast(self, json: "char const *", vector: "FloatVector") -> "int":
2001
+ return _btrievePython.BtrieveSpace_VectorCreateFast(self, json, vector)
2002
+
1829
2003
  def VectorRetrieveEntityTag(self, id: "int") -> "int":
1830
2004
  return _btrievePython.BtrieveSpace_VectorRetrieveEntityTag(self, id)
1831
2005
 
1832
- def VectorDelete(self, id: "int", entityTag: "int"=-1) -> "Btrieve::StatusCode":
1833
- return _btrievePython.BtrieveSpace_VectorDelete(self, id, entityTag)
2006
+ def VectorDelete(self, *args) -> "Btrieve::StatusCode":
2007
+ return _btrievePython.BtrieveSpace_VectorDelete(self, *args)
1834
2008
 
1835
2009
  def Query(self, btrieveVectorSet: "BtrieveVectorSet", query: "char const *"=None) -> "Btrieve::StatusCode":
1836
2010
  return _btrievePython.BtrieveSpace_Query(self, btrieveVectorSet, query)
@@ -1847,22 +2021,22 @@ class BtrieveSpace(object):
1847
2021
  def SetLastStatusCode(self, statusCode: "Btrieve::StatusCode") -> "Btrieve::StatusCode":
1848
2022
  return _btrievePython.BtrieveSpace_SetLastStatusCode(self, statusCode)
1849
2023
 
1850
- def EuclideanDistanceSimilarity(self, vector: "char const *", limit: "int", query: "char const *"=None) -> "char const *":
2024
+ def EuclideanDistanceSimilarity(self, vector: "char const *", limit: "int", query: "char const *"=None) -> "std::string":
1851
2025
  return _btrievePython.BtrieveSpace_EuclideanDistanceSimilarity(self, vector, limit, query)
1852
2026
 
1853
- def CosineSimilarity(self, vector: "char const *", limit: "int", query: "char const *"=None) -> "char const *":
2027
+ def CosineSimilarity(self, vector: "char const *", limit: "int", query: "char const *"=None) -> "std::string":
1854
2028
  return _btrievePython.BtrieveSpace_CosineSimilarity(self, vector, limit, query)
1855
2029
 
1856
- def DotProductSimilarity(self, vector: "char const *", limit: "int", query: "char const *"=None) -> "char const *":
2030
+ def DotProductSimilarity(self, vector: "char const *", limit: "int", query: "char const *"=None) -> "std::string":
1857
2031
  return _btrievePython.BtrieveSpace_DotProductSimilarity(self, vector, limit, query)
1858
2032
 
1859
2033
  def VectorCreate(self, *args) -> "int":
1860
2034
  return _btrievePython.BtrieveSpace_VectorCreate(self, *args)
1861
2035
 
1862
- def VectorRetrieveBlob(self, id: "int", blobObject: "PyObject *", vectorBlobOffset: "int"=0, vectorBlobLength: "int"=0) -> "Btrieve::StatusCode":
1863
- return _btrievePython.BtrieveSpace_VectorRetrieveBlob(self, id, blobObject, vectorBlobOffset, vectorBlobLength)
2036
+ def VectorRetrieveBlob(self, *args) -> "Btrieve::StatusCode":
2037
+ return _btrievePython.BtrieveSpace_VectorRetrieveBlob(self, *args)
1864
2038
 
1865
- def VectorRetrieveJson(self, *args) -> "char const *":
2039
+ def VectorRetrieveJson(self, *args) -> "std::string":
1866
2040
  return _btrievePython.BtrieveSpace_VectorRetrieveJson(self, *args)
1867
2041
 
1868
2042
  def VectorUpdate(self, *args) -> "Btrieve::StatusCode":
@@ -403,6 +403,8 @@ typedef enum {
403
403
  BTRIEVE_STATUS_CODE_NO_RESOURCE_DLL = 2011,
404
404
  /// \brief 2012 - Operating system error.
405
405
  BTRIEVE_STATUS_CODE_OS_ERROR = 2012,
406
+ /// \brief 2013 - Filter limit exceeded.
407
+ BTRIEVE_STATUS_CODE_FILTER_LIMIT_EXCEEDED = 2013,
406
408
  /// \brief 3000 - MicroKernel router memory error.
407
409
  BTRIEVE_STATUS_CODE_MK_ROUTER_MEM_ERROR = 3000,
408
410
  /// \brief 3001 - MicroKernel no local access allowed.
@@ -2310,7 +2312,7 @@ extern LINKAGE btrieve_status_code_t BtrieveFileBulkRetrieveNext(btrieve_file_t
2310
2312
  /// \param[in] file The file. See BtrieveClientFileOpen().
2311
2313
  /// \param[in] comparison The comparison.
2312
2314
  /// \param[in] index The index.
2313
- /// \param[in] key The key.
2315
+ /// \param[inout] key The key.
2314
2316
  /// \param[in] keyLength The key length.
2315
2317
  /// \param[in] bulkRetrieveAttributes The bulk retrieve attributes. See BtrieveBulkRetrieveAttributesAllocate().
2316
2318
  /// \param[out] bulkRetrieveResult The bulk retrieve result. See BtrieveBulkRetrieveResultAllocate().
@@ -2342,7 +2344,7 @@ extern LINKAGE btrieve_status_code_t BtrieveFileBulkRetrievePrevious(btrieve_fil
2342
2344
  /// \param[in] file The file. See BtrieveClientFileOpen().
2343
2345
  /// \param[in] comparison The comparison.
2344
2346
  /// \param[in] index The index.
2345
- /// \param[in] key The key.
2347
+ /// \param[inout] key The key.
2346
2348
  /// \param[in] keyLength The key length.
2347
2349
  /// \param[in] bulkRetrieveAttributes The bulk retrieve attributes. See BtrieveBulkRetrieveAttributesAllocate().
2348
2350
  /// \param[out] bulkRetrieveResult The bulk retrieve result. See BtrieveBulkRetrieveResultAllocate().
@@ -2403,7 +2405,7 @@ extern LINKAGE btrieve_status_code_t BtrieveFileBulkDeleteNext(btrieve_file_t fi
2403
2405
  /// \param[in] file The file. See BtrieveClientFileOpen().
2404
2406
  /// \param[in] comparison The comparison.
2405
2407
  /// \param[in] index The index.
2406
- /// \param[in] key The key.
2408
+ /// \param[inout] key The key.
2407
2409
  /// \param[in] keyLength The key length.
2408
2410
  /// \param[in] bulkDeleteAttributes The bulk delete attributes. See BtrieveBulkDeleteAttributesAllocate().
2409
2411
  /// \param[out] bulkDeleteResult The bulk delete result. See BtrieveBulkDeleteResultAllocate().
@@ -2433,7 +2435,7 @@ extern LINKAGE btrieve_status_code_t BtrieveFileBulkDeletePrevious(btrieve_file_
2433
2435
  /// \param[in] file The file. See BtrieveClientFileOpen().
2434
2436
  /// \param[in] comparison The comparison.
2435
2437
  /// \param[in] index The index.
2436
- /// \param[in] key The key.
2438
+ /// \param[inout] key The key.
2437
2439
  /// \param[in] keyLength The key length.
2438
2440
  /// \param[in] bulkDeleteAttributes The bulk delete attributes. See BtrieveBulkDeleteAttributesAllocate().
2439
2441
  /// \param[out] bulkDeleteResult The bulk delete result. See BtrieveBulkDeleteResultAllocate().
@@ -14,6 +14,8 @@
14
14
 
15
15
  #include <cstddef>
16
16
  #include <deque>
17
+ #include <string>
18
+ #include <vector>
17
19
 
18
20
  #include "btrieveC.h"
19
21
 
@@ -1081,6 +1083,8 @@ public:
1081
1083
  STATUS_CODE_NO_RESOURCE_DLL = 2011,
1082
1084
  /// \brief 2012 - Operating system error.
1083
1085
  STATUS_CODE_OS_ERROR = 2012,
1086
+ /// \brief 2013 - Filter limit exceeded.
1087
+ STATUS_CODE_FILTER_LIMIT_EXCEEDED = 2013,
1084
1088
  /// \brief 3000 - MicroKernel router memory error.
1085
1089
  STATUS_CODE_MK_ROUTER_MEM_ERROR = 3000,
1086
1090
  /// \brief 3001 - MicroKernel no local access allowed.
@@ -1399,6 +1403,8 @@ public:
1399
1403
  /// \param[in] clientIdentifier The client identifier. Use 0 to automatically generate a client identifier based on the caller's thread identifier.
1400
1404
  /// \SNIPPET_CPP_PYTHON{BtrieveClient, btest.cpp, btest.py}
1401
1405
  BtrieveClient(int serviceAgentIdentifier, int clientIdentifier);
1406
+ /// \par
1407
+ /// Any open collections, files or spaces will remain open. See BtrieveClient::CollectionClose, BtrieveClient::FileClose, and BtrieveClient::SpaceClose. Also see BtrieveClient::Reset.
1402
1408
  ~BtrieveClient();
1403
1409
 
1404
1410
  /// \brief Get the version.
@@ -5089,14 +5095,17 @@ private:
5089
5095
  /// ---------- | ------------- | ---------------- | ------- | ------------------ | ---- | -----------
5090
5096
  /// _blobLength | no | yes | yes | yes | number | The vector blob length.
5091
5097
  /// _createTime | no | yes | yes | yes | number | The vector create time in microseconds since the Unix Epoch.
5092
- /// _id | no | yes | yes | no | number | The vector identifier.
5098
+ /// _id | yes | yes | yes | no | number | The vector identifier.
5093
5099
  /// _jsonLength | no | yes | yes | yes | number | The vector json length.
5094
5100
  /// _label | yes | no | yes | yes | string | The vector label.
5095
5101
  /// _updateTime | no | yes | yes | yes | number | The vector update time in microseconds since the Unix Epoch.
5102
+ /// _uuid | yes | yes | yes | no | string | The vector universally unique identifier.
5103
+ /// _vector | yes | no | no | yes | array | The vector as an array of numbers.
5096
5104
  /// \details
5097
5105
  /// Non-user settable JSON field names are silently ignored by BtrieveSpace::VectorCreate and BtrieveSpace::VectorUpdate.
5106
+ /// "_id" and "_uuid" are user settable on vector create only.
5098
5107
  /// Use of reserved JSON field names other than those listed above will generate an error.
5099
- /// Reserved JSON field names are added to the vector JSON retrieved by BtrieveSpace::VectorRetrieveJson and BtrieveSpace::VectorRetrieve.
5108
+ /// Reserved JSON field names are added to the vector JSON retrieved by BtrieveSpace::VectorRetrieveJson.
5100
5109
  ///
5101
5110
  /// The vector identifier is an autoincrement positive integer with a maximum value of 2147483647 (2^31 - 1).
5102
5111
  class LINKAGE BtrieveSpace
@@ -5119,6 +5128,7 @@ public:
5119
5128
  /// \retval -1 \ERROR_HAS_OCCURRED
5120
5129
  /// \TO_DETERMINE_STATUS_CODE{BtrieveSpace::GetLastStatusCode}
5121
5130
  int VectorCreate(const char *json);
5131
+ int VectorCreateFast(const char *json, const std::vector<float> &vector);
5122
5132
  /// \brief Create a vector.
5123
5133
  /// \param[in] json The json.
5124
5134
  /// \param[in] blob The blob.
@@ -5137,39 +5147,44 @@ public:
5137
5147
  /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5138
5148
  /// \see Btrieve::StatusCodeToString
5139
5149
  Btrieve::StatusCode VectorRetrieveBlob(int id, char *blob, int blobSize, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5150
+ /// \brief Retrieve a vector blob.
5151
+ /// \param[in] uuid The universally unique identifier.
5152
+ /// \param[out] blob The blob.
5153
+ /// \param[in] blobSize The blob size.
5154
+ /// \param[in] vectorBlobOffset The vector blob offset.
5155
+ /// \param[in] vectorBlobLength The vector blob length. If vector blob length is 0, then the entire vector blob will be retrieved beginning at vector blob offset.
5156
+ /// \retval "= Btrieve::STATUS_CODE_NO_ERROR" \SUCCESS
5157
+ /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5158
+ /// \see Btrieve::StatusCodeToString
5159
+ Btrieve::StatusCode VectorRetrieveBlob(const char *uuid, char *blob, int blobSize, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5140
5160
  /// \brief Retrieve a vector json.
5141
- /// \note This method is not thread safe. The string returned will be overwritten on subsequent calls.
5142
5161
  /// \param[in] id The identifier.
5143
- /// \retval "!= NULL" The json.
5144
- /// \retval NULL \ERROR_HAS_OCCURRED
5145
- const char *VectorRetrieveJson(int id);
5162
+ /// \retval !="" The json.
5163
+ /// \retval "" \ERROR_HAS_OCCURRED
5164
+ std::string VectorRetrieveJson(int id);
5165
+ /// \brief Retrieve a vector json.
5166
+ /// \param[in] uuid The universally unique identifier.
5167
+ /// \retval !="" The json.
5168
+ /// \retval "" \ERROR_HAS_OCCURRED
5169
+ std::string VectorRetrieveJson(const char *uuid);
5146
5170
  /// \brief Retrieve a vector json.
5147
- /// \note This method is not thread safe. The string returned will be overwritten on subsequent calls.
5148
5171
  /// \param[in] id The identifier.
5149
5172
  /// \param[out] blob The blob.
5150
5173
  /// \param[in] blobSize The blob size.
5151
5174
  /// \param[in] vectorBlobOffset The vector blob offset.
5152
5175
  /// \param[in] vectorBlobLength The vector blob length. If vector blob length is 0, then the entire vector blob will be retrieved beginning at vector blob offset.
5153
- /// \retval "!= NULL" The json.
5154
- /// \retval NULL \ERROR_HAS_OCCURRED
5155
- const char *VectorRetrieveJson(int id, char *blob, int blobSize, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5156
- #ifndef SWIG
5157
- /// \brief Retrieve a vector.
5158
- /// \note \METHOD_ONLY_CPP
5159
- /// \param[in] id The identifier.
5160
- /// \param[out] json The json.
5161
- /// \param[in] jsonSize The json size.
5176
+ /// \retval !="" The json.
5177
+ /// \retval "" \ERROR_HAS_OCCURRED
5178
+ std::string VectorRetrieveJson(int id, char *blob, int blobSize, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5179
+ /// \brief Retrieve a vector json.
5180
+ /// \param[in] uuid The universally unique identifier.
5162
5181
  /// \param[out] blob The blob.
5163
5182
  /// \param[in] blobSize The blob size.
5164
5183
  /// \param[in] vectorBlobOffset The vector blob offset.
5165
5184
  /// \param[in] vectorBlobLength The vector blob length. If vector blob length is 0, then the entire vector blob will be retrieved beginning at vector blob offset.
5166
- /// \par \DESCRIPTION
5167
- /// Remember to allocate enough space to retrieve not only the vector JSON but also the reserved JSON field names and values, e.g. "_bloblength" : 1234567890.
5168
- /// \retval "= Btrieve::STATUS_CODE_NO_ERROR" \SUCCESS
5169
- /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5170
- /// \see Btrieve::StatusCodeToString
5171
- Btrieve::StatusCode VectorRetrieve(int id, char *json = NULL, int jsonSize = 0, char *blob = NULL, int blobSize = 0, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5172
- #endif
5185
+ /// \retval !="" The json.
5186
+ /// \retval "" \ERROR_HAS_OCCURRED
5187
+ std::string VectorRetrieveJson(const char *uuid, char *blob, int blobSize, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5173
5188
  /// \brief Retrieve a vector entity tag.
5174
5189
  /// \param[in] id The identifier.
5175
5190
  /// \retval ">= 0" The vector entity tag.
@@ -5184,6 +5199,13 @@ public:
5184
5199
  /// \see Btrieve::StatusCodeToString
5185
5200
  Btrieve::StatusCode VectorUpdate(int id, const char *json);
5186
5201
  /// \brief Update a vector.
5202
+ /// \param[in] uuid The universally unique identifier.
5203
+ /// \param[in] json The json. If json is NULL, then the vector json will not be updated.
5204
+ /// \retval "= Btrieve::STATUS_CODE_NO_ERROR" \SUCCESS
5205
+ /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5206
+ /// \see Btrieve::StatusCodeToString
5207
+ Btrieve::StatusCode VectorUpdate(const char *uuid, const char *json);
5208
+ /// \brief Update a vector.
5187
5209
  /// \param[in] id The identifier.
5188
5210
  /// \param[in] json The json. If json is NULL, then the vector json will not be updated.
5189
5211
  /// \param[in] blob The blob. If blob is NULL, then the vector blob will not be updated.
@@ -5193,6 +5215,15 @@ public:
5193
5215
  /// \see Btrieve::StatusCodeToString
5194
5216
  Btrieve::StatusCode VectorUpdate(int id, const char *json, const char *blob, int blobLength);
5195
5217
  /// \brief Update a vector.
5218
+ /// \param[in] uuid The universally unique identifier.
5219
+ /// \param[in] json The json. If json is NULL, then the vector json will not be updated.
5220
+ /// \param[in] blob The blob. If blob is NULL, then the vector blob will not be updated.
5221
+ /// \param[in] blobLength The blob length. If blob is not NULL and blobLength is 0, then the vector blob will be deleted.
5222
+ /// \retval "= Btrieve::STATUS_CODE_NO_ERROR" \SUCCESS
5223
+ /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5224
+ /// \see Btrieve::StatusCodeToString
5225
+ Btrieve::StatusCode VectorUpdate(const char *uuid, const char *json, const char *blob, int blobLength);
5226
+ /// \brief Update a vector.
5196
5227
  /// \param[in] id The identifier.
5197
5228
  /// \param[in] entityTag The entity tag. The entity tag must either equal the entity tag of the vector or -1.
5198
5229
  /// \param[in] json The json. If json is NULL, then the vector json will not be updated.
@@ -5201,6 +5232,14 @@ public:
5201
5232
  /// \see Btrieve::StatusCodeToString
5202
5233
  Btrieve::StatusCode VectorUpdate(int id, int entityTag, const char *json);
5203
5234
  /// \brief Update a vector.
5235
+ /// \param[in] uuid The universally unique identifier.
5236
+ /// \param[in] entityTag The entity tag. The entity tag must either equal the entity tag of the vector or -1.
5237
+ /// \param[in] json The json. If json is NULL, then the vector json will not be updated.
5238
+ /// \retval "= Btrieve::STATUS_CODE_NO_ERROR" \SUCCESS
5239
+ /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5240
+ /// \see Btrieve::StatusCodeToString
5241
+ Btrieve::StatusCode VectorUpdate(const char *uuid, int entityTag, const char *json);
5242
+ /// \brief Update a vector.
5204
5243
  /// \param[in] id The identifier.
5205
5244
  /// \param[in] entityTag The entity tag. The entity tag must either equal the entity tag of the vector or -1.
5206
5245
  /// \param[in] json The json. If json is NULL, then the vector json will not be updated.
@@ -5210,6 +5249,16 @@ public:
5210
5249
  /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5211
5250
  /// \see Btrieve::StatusCodeToString
5212
5251
  Btrieve::StatusCode VectorUpdate(int id, int entityTag, const char *json, const char *blob, int blobLength);
5252
+ /// \brief Update a vector.
5253
+ /// \param[in] uuid The universally unique identifier.
5254
+ /// \param[in] entityTag The entity tag. The entity tag must either equal the entity tag of the vector or -1.
5255
+ /// \param[in] json The json. If json is NULL, then the vector json will not be updated.
5256
+ /// \param[in] blob The blob. If blob is NULL, then the vector blob will not be updated.
5257
+ /// \param[in] blobLength The blob length. If blob is not NULL and blobLength is 0, then the vector blob will be deleted.
5258
+ /// \retval "= Btrieve::STATUS_CODE_NO_ERROR" \SUCCESS
5259
+ /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5260
+ /// \see Btrieve::StatusCodeToString
5261
+ Btrieve::StatusCode VectorUpdate(const char *uuid, int entityTag, const char *json, const char *blob, int blobLength);
5213
5262
  /// \brief Delete a vector.
5214
5263
  /// \param[in] id The identifier.
5215
5264
  /// \param[in] entityTag The entity tag. The entity tag must either equal the entity tag of the vector or -1.
@@ -5217,6 +5266,13 @@ public:
5217
5266
  /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5218
5267
  /// \see Btrieve::StatusCodeToString
5219
5268
  Btrieve::StatusCode VectorDelete(int id, int entityTag = -1);
5269
+ /// \brief Delete a vector.
5270
+ /// \param[in] uuid The universally unique identifier.
5271
+ /// \param[in] entityTag The entity tag. The entity tag must either equal the entity tag of the vector or -1.
5272
+ /// \retval "= Btrieve::STATUS_CODE_NO_ERROR" \SUCCESS
5273
+ /// \retval "!= Btrieve::STATUS_CODE_NO_ERROR" \ERROR_HAS_OCCURRED
5274
+ /// \see Btrieve::StatusCodeToString
5275
+ Btrieve::StatusCode VectorDelete(const char *uuid, int entityTag = -1);
5220
5276
  /// \brief Query the space.
5221
5277
  /// \param[out] btrieveVectorSet The %Btrieve vector set.
5222
5278
  /// \param[in] query The query. The maximum query length is Btrieve::MAXIMUM_RECORD_LENGTH bytes.
@@ -5275,12 +5331,16 @@ public:
5275
5331
  /// "_sortOrder" : "descending" |
5276
5332
  /// "_updateTime" : <number> |
5277
5333
  /// "_updateTime" : { <time_operator> : <number> }
5334
+ /// "_uuid" : <string> |
5335
+ /// "_uuid" : { <uuid_operator> : <string> } |
5278
5336
  ///
5279
- /// <sort_field> := "_blobLength" | "_createTime" | "_id" | "_jsonLength" | "_label" | "_updateTime"
5337
+ /// <sort_field> := "_blobLength" | "_createTime" | "_id" | "_jsonLength" | "_label" | "_updateTime" | "_uuid"
5280
5338
  ///
5281
5339
  /// <time_operator> ::= "$eq" | "$gt" | "$gte" | "$lt" | "$lte"
5282
5340
  ///
5283
5341
  /// <string_operator> ::= "$eq" | "$gt" | "$gte" | "$like" | "$lt" | "$lte" | "$ne" | "$notlike"
5342
+ ///
5343
+ /// <uuid_operator> ::= "$eq" | "$gt" | "$gte" | "$lt" | "$lte" | "$ne"
5284
5344
  /// \endcode
5285
5345
  /// \par
5286
5346
  /// In a JSON expression, if the query value is not an array and the vector value is an array then each element in the array is evaluated. If any evaluation returns true then the JSON expression returns true.
@@ -5322,41 +5382,46 @@ public:
5322
5382
  Btrieve::StatusCode SetLastStatusCode(Btrieve::StatusCode statusCode);
5323
5383
  /// \endcond
5324
5384
  /// \brief Calculate the Euclidean distance similarity.
5325
- /// \note This method is not thread safe. The string returned will be overwritten on subsequent calls.
5326
5385
  /// \param[in] vector The vector.
5327
5386
  /// \param[in] limit The limit.
5328
5387
  /// \param[in] query The query. See BtrieveSpace::Query.
5329
- /// \retval "!= NULL" The similarity.
5330
- /// \retval NULL \ERROR_HAS_OCCURRED
5388
+ /// \retval !="" The json.
5389
+ /// \retval "" \ERROR_HAS_OCCURRED
5331
5390
  /// \TO_DETERMINE_STATUS_CODE{BtrieveSpace::GetLastStatusCode}
5332
- const char *EuclideanDistanceSimilarity(const char *vector, int limit, const char *query = NULL);
5391
+ std::string EuclideanDistanceSimilarity(const char *vector, int limit, const char *query = NULL);
5333
5392
  /// \brief Calculate the cosine similarity.
5334
- /// \note This method is not thread safe. The string returned will be overwritten on subsequent calls.
5335
5393
  /// \param[in] vector The vector.
5336
5394
  /// \param[in] limit The limit.
5337
5395
  /// \param[in] query The query. See BtrieveSpace::Query.
5338
- /// \retval "!= NULL" The similarity.
5339
- /// \retval NULL \ERROR_HAS_OCCURRED
5396
+ /// \retval !="" The json.
5397
+ /// \retval "" \ERROR_HAS_OCCURRED
5340
5398
  /// \TO_DETERMINE_STATUS_CODE{BtrieveSpace::GetLastStatusCode}
5341
- const char *CosineSimilarity(const char *vector, int limit, const char *query = NULL);
5399
+ std::string CosineSimilarity(const char *vector, int limit, const char *query = NULL);
5342
5400
  /// \brief Calculate the dot product similarity.
5343
- /// \note This method is not thread safe. The string returned will be overwritten on subsequent calls.
5344
5401
  /// \param[in] vector The vector.
5345
5402
  /// \param[in] limit The limit.
5346
5403
  /// \param[in] query The query. See BtrieveSpace::Query.
5347
- /// \retval "!= NULL" The similarity.
5348
- /// \retval NULL \ERROR_HAS_OCCURRED
5404
+ /// \retval !="" The json.
5405
+ /// \retval "" \ERROR_HAS_OCCURRED
5349
5406
  /// \TO_DETERMINE_STATUS_CODE{BtrieveSpace::GetLastStatusCode}
5350
- const char *DotProductSimilarity(const char *vector, int limit, const char *query = NULL);
5407
+ std::string DotProductSimilarity(const char *vector, int limit, const char *query = NULL);
5351
5408
 
5352
5409
  private:
5353
5410
  BtrieveClient *btrieveClient = NULL;
5354
5411
  BtrieveFile *btrieveFile = NULL;
5355
5412
  Btrieve::StatusCode lastStatusCode = Btrieve::STATUS_CODE_NO_ERROR;
5356
5413
  int vectorLength = 0;
5357
- const char *ProcessSimilarity(const char *vector, int limit, const char *query,
5358
- Btrieve::StatusCode (BtrieveBulkRetrieveAttributes::*addSimilarity)(const char *, int, int),
5359
- const char *similarityKey);
5414
+ std::string ProcessSimilarity(const char *vector, int limit, const char *query,
5415
+ Btrieve::StatusCode (BtrieveBulkRetrieveAttributes::*addSimilarity)(const char *, int, int), const char *similarityKey);
5416
+ Btrieve::StatusCode VectorRetrieveHelper(struct btrieveVector *btrieveVector, std::string *json = NULL,
5417
+ char *blob = NULL, int blobSize = 0, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5418
+ Btrieve::StatusCode VectorRetrieve(int id, std::string *json = NULL, char *blob = NULL,
5419
+ int blobSize = 0, int vectorBlobOffset = 0, int vectorBlobLength = 0);
5420
+ Btrieve::StatusCode VectorRetrieve(const char *uuid, std::string *json = NULL, char *blob = NULL, int blobSize = 0, int vectorBlobOffset = 0,
5421
+ int vectorBlobLength = 0);
5422
+ Btrieve::StatusCode VectorUpdateHelper(const char *uuid, int id, int entityTagIn, const char *json, const char *blob, int blobLength);
5423
+ Btrieve::StatusCode VectorDeleteHelper(const char *uuid, int id, int entityTagIn);
5424
+ int VectorCreateHelper(const char *json, const std::vector<float> *vector, const char *blob, int blobLength);
5360
5425
  };
5361
5426
 
5362
5427
  /// \brief The %Btrieve vector set class.