quasardb 3.14.2.dev0__cp39-cp39-win_amd64.whl → 3.14.2.dev4__cp39-cp39-win_amd64.whl

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.

Potentially problematic release.


This version of quasardb might be problematic. Click here for more details.

Files changed (96) hide show
  1. quasardb/INSTALL.vcxproj +9 -4
  2. quasardb/__init__.py +33 -4
  3. quasardb/cmake_install.cmake +6 -0
  4. quasardb/date/ALL_BUILD.vcxproj +9 -8
  5. quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake +13 -13
  6. quasardb/date/CMakeFiles/generate.stamp.depend +4 -4
  7. quasardb/date/INSTALL.vcxproj +9 -4
  8. quasardb/date/cmake_install.cmake +6 -0
  9. quasardb/date/dateConfigVersion.cmake +0 -5
  10. quasardb/date/dateTargets.cmake +4 -8
  11. quasardb/numpy/__init__.py +58 -10
  12. quasardb/pandas/__init__.py +58 -102
  13. quasardb/pybind11/ALL_BUILD.vcxproj +9 -8
  14. quasardb/pybind11/CMakeFiles/generate.stamp.depend +14 -14
  15. quasardb/pybind11/INSTALL.vcxproj +9 -4
  16. quasardb/pybind11/cmake_install.cmake +6 -0
  17. quasardb/qdb_api.dll +0 -0
  18. quasardb/quasardb.cp39-win_amd64.pyd +0 -0
  19. quasardb/range-v3/ALL_BUILD.vcxproj +9 -8
  20. quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +13 -13
  21. quasardb/range-v3/CMakeFiles/generate.stamp.depend +11 -11
  22. quasardb/range-v3/INSTALL.vcxproj +9 -4
  23. quasardb/range-v3/cmake_install.cmake +42 -0
  24. quasardb/range-v3/range-v3-config-version.cmake +0 -5
  25. quasardb/range-v3/range-v3-config.cmake +4 -8
  26. quasardb/range-v3/range.v3.headers.vcxproj +9 -8
  27. {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/METADATA +15 -10
  28. quasardb-3.14.2.dev4.dist-info/RECORD +54 -0
  29. {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/WHEEL +1 -1
  30. quasardb/CMakeLists.txt +0 -500
  31. quasardb/batch_column.hpp +0 -80
  32. quasardb/batch_inserter.hpp +0 -248
  33. quasardb/blob.hpp +0 -150
  34. quasardb/cluster.cpp +0 -89
  35. quasardb/cluster.hpp +0 -551
  36. quasardb/concepts.hpp +0 -278
  37. quasardb/continuous.cpp +0 -149
  38. quasardb/continuous.hpp +0 -106
  39. quasardb/convert/array.hpp +0 -282
  40. quasardb/convert/point.hpp +0 -330
  41. quasardb/convert/range.hpp +0 -282
  42. quasardb/convert/unicode.hpp +0 -598
  43. quasardb/convert/util.hpp +0 -22
  44. quasardb/convert/value.hpp +0 -711
  45. quasardb/convert.hpp +0 -38
  46. quasardb/detail/qdb_resource.hpp +0 -129
  47. quasardb/detail/ts_column.hpp +0 -224
  48. quasardb/direct_blob.hpp +0 -108
  49. quasardb/direct_handle.hpp +0 -83
  50. quasardb/direct_integer.hpp +0 -94
  51. quasardb/dispatch.hpp +0 -157
  52. quasardb/double.hpp +0 -87
  53. quasardb/entry.hpp +0 -273
  54. quasardb/error.hpp +0 -318
  55. quasardb/handle.cpp +0 -29
  56. quasardb/handle.hpp +0 -98
  57. quasardb/integer.hpp +0 -88
  58. quasardb/logger.cpp +0 -106
  59. quasardb/logger.hpp +0 -228
  60. quasardb/masked_array.hpp +0 -651
  61. quasardb/metrics.cpp +0 -103
  62. quasardb/metrics.hpp +0 -112
  63. quasardb/module.cpp +0 -76
  64. quasardb/module.hpp +0 -24
  65. quasardb/node.hpp +0 -123
  66. quasardb/numpy.cpp +0 -6
  67. quasardb/numpy.hpp +0 -489
  68. quasardb/object_tracker.hpp +0 -283
  69. quasardb/options.hpp +0 -244
  70. quasardb/perf.hpp +0 -336
  71. quasardb/pytypes.hpp +0 -221
  72. quasardb/query.cpp +0 -420
  73. quasardb/query.hpp +0 -92
  74. quasardb/reader/ts_row.hpp +0 -281
  75. quasardb/reader/ts_value.hpp +0 -245
  76. quasardb/remove_cvref.hpp +0 -31
  77. quasardb/string.hpp +0 -160
  78. quasardb/table.cpp +0 -289
  79. quasardb/table.hpp +0 -325
  80. quasardb/table_reader.hpp +0 -220
  81. quasardb/tag.hpp +0 -77
  82. quasardb/timestamp.hpp +0 -97
  83. quasardb/traits.hpp +0 -619
  84. quasardb/ts_iterator.hpp +0 -193
  85. quasardb/utils/blob_deque.hpp +0 -96
  86. quasardb/utils/ostream.hpp +0 -17
  87. quasardb/utils/permutation.hpp +0 -50
  88. quasardb/utils/stable_sort.hpp +0 -25
  89. quasardb/utils/unzip_view.hpp +0 -89
  90. quasardb/utils.cpp +0 -28
  91. quasardb/utils.hpp +0 -174
  92. quasardb/writer.cpp +0 -534
  93. quasardb/writer.hpp +0 -396
  94. quasardb-3.14.2.dev0.dist-info/RECORD +0 -118
  95. {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/LICENSE.md +0 -0
  96. {quasardb-3.14.2.dev0.dist-info → quasardb-3.14.2.dev4.dist-info}/top_level.txt +0 -0
quasardb/query.cpp DELETED
@@ -1,420 +0,0 @@
1
- /*
2
- *
3
- * Official Python API
4
- *
5
- * Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
6
- * All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are met:
10
- *
11
- * * Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * * Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- * * Neither the name of quasardb nor the names of its contributors may
17
- * be used to endorse or promote products derived from this software
18
- * without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY QUASARDB AND CONTRIBUTORS ``AS IS'' AND ANY
21
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
24
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
- */
31
-
32
- #include "query.hpp"
33
- #include "masked_array.hpp"
34
- #include "metrics.hpp"
35
- #include "numpy.hpp"
36
- #include "traits.hpp"
37
- #include "utils.hpp"
38
- #include "convert/value.hpp"
39
- #include "detail/qdb_resource.hpp"
40
- #include <pybind11/stl.h>
41
- #include <iostream>
42
- #include <set>
43
- #include <sstream>
44
- #include <string>
45
-
46
- namespace py = pybind11;
47
-
48
- namespace qdb
49
- {
50
-
51
- /**
52
- * Options that define whether or not to return blobs as bytearrays or string. Defaults to
53
- * strings.
54
- */
55
- typedef enum query_blobs_type_t
56
- {
57
- query_blobs_type_none = 0,
58
- query_blobs_type_all = 1,
59
- query_blobs_type_columns = 2
60
- } qdb_blobs_type_t;
61
-
62
- typedef struct
63
- {
64
- query_blobs_type_t type;
65
- std::vector<std::string> columns;
66
- } query_blobs_t;
67
-
68
- /**
69
- * Blobs can be provided in a boolean (blobs=True or blobs=False) or as as specific array
70
- * (blobs=['packet', 'other_packet']).
71
- *
72
- * Takes a python object and an array of column names, and returns a bitmap which denotes
73
- * whether a column needs to be returned as a blob (True) or as a string (False).
74
- */
75
- static std::vector<bool> coerce_blobs_opt(
76
- const std::vector<std::string> & column_names, const py::object & opts)
77
- {
78
- // First try the most common case, a boolean
79
- try
80
- {
81
- bool all_blobs = py::cast<bool>(opts);
82
- return std::vector<bool>(column_names.size(), all_blobs);
83
- }
84
- catch (const std::runtime_error & /*_*/)
85
- {
86
- std::vector<std::string> specific_blobs = py::cast<std::vector<std::string>>(opts);
87
- std::vector<bool> ret;
88
- ret.reserve(column_names.size());
89
-
90
- for (auto const & col : column_names)
91
- {
92
- ret.push_back(
93
- std::find(specific_blobs.begin(), specific_blobs.end(), col) != specific_blobs.end());
94
- }
95
-
96
- return ret;
97
- }
98
- }
99
-
100
- static py::handle coerce_point(qdb_point_result_t p, bool parse_blob)
101
- {
102
- switch (p.type)
103
- {
104
- case qdb_query_result_none:
105
- return Py_None;
106
-
107
- case qdb_query_result_double:
108
- return PyFloat_FromDouble(p.payload.double_.value);
109
-
110
- case qdb_query_result_blob: {
111
- return PyBytes_FromStringAndSize(static_cast<char const *>(p.payload.blob.content),
112
- static_cast<Py_ssize_t>(p.payload.blob.content_length));
113
- }
114
-
115
- case qdb_query_result_string:
116
- return PyUnicode_FromStringAndSize(static_cast<char const *>(p.payload.string.content),
117
- static_cast<Py_ssize_t>(p.payload.string.content_length));
118
-
119
- case qdb_query_result_int64:
120
- return PyLong_FromLongLong(p.payload.int64_.value);
121
-
122
- case qdb_query_result_count:
123
- return PyLong_FromLongLong(p.payload.count.value);
124
-
125
- case qdb_query_result_timestamp:
126
- return qdb::numpy::datetime64(p.payload.timestamp.value);
127
- }
128
-
129
- throw std::runtime_error("Unable to cast QuasarDB type to Python type");
130
- }
131
-
132
- static std::vector<std::string> coerce_column_names(const qdb_query_result_t & r)
133
- {
134
- std::vector<std::string> xs;
135
- xs.reserve(r.column_count);
136
-
137
- for (qdb_size_t i = 0; i < r.column_count; ++i)
138
- {
139
- xs.push_back(qdb::to_string(r.column_names[i]));
140
- }
141
-
142
- return xs;
143
- }
144
-
145
- static dict_query_result_t convert_query_results(const qdb_query_result_t * r,
146
- const std::vector<std::string> & column_names,
147
- const std::vector<bool> & parse_blobs)
148
- {
149
- qdb::dict_query_result_t ret;
150
-
151
- for (qdb_size_t i = 0; i < r->row_count; ++i)
152
- {
153
- std::map<std::string, py::handle> row;
154
-
155
- for (qdb_size_t j = 0; j < r->column_count; ++j)
156
- {
157
- const auto & column_name = column_names[j];
158
- auto value = coerce_point(r->rows[i][j], parse_blobs[j]);
159
-
160
- row[column_name] = value;
161
- }
162
-
163
- ret.push_back(row);
164
- }
165
-
166
- return ret;
167
- }
168
-
169
- dict_query_result_t convert_query_results(const qdb_query_result_t * r, const py::object & blobs)
170
- {
171
- if (!r) return dict_query_result_t{};
172
- const std::vector<std::string> column_names = coerce_column_names(*r);
173
- const std::vector<bool> parse_blobs = coerce_blobs_opt(column_names, blobs);
174
- return convert_query_results(r, column_names, parse_blobs);
175
- }
176
-
177
- qdb::masked_array numpy_null_array(qdb_size_t row_count)
178
- {
179
- py::array::ShapeContainer shape{row_count};
180
- auto data = qdb::numpy::array::initialize<std::double_t>(
181
- shape, std::numeric_limits<std::double_t>::quiet_NaN());
182
-
183
- return qdb::masked_array::masked_all(data);
184
- }
185
-
186
- template <qdb_query_result_value_type_t ResultType>
187
- struct numpy_util
188
- {
189
- static constexpr decltype(auto) get_value(qdb_point_result_t const &);
190
- };
191
-
192
- template <>
193
- struct numpy_util<qdb_query_result_double>
194
- {
195
-
196
- using value_type = std::double_t;
197
- using dtype = traits::float64_dtype;
198
-
199
- static constexpr std::double_t get_value(qdb_point_result_t const & row) noexcept
200
- {
201
- return row.payload.double_.value;
202
- }
203
- };
204
-
205
- template <>
206
- struct numpy_util<qdb_query_result_int64>
207
- {
208
- using value_type = std::int64_t;
209
- using dtype = traits::int64_dtype;
210
-
211
- static constexpr std::int64_t get_value(qdb_point_result_t const & row) noexcept
212
- {
213
- return row.payload.int64_.value;
214
- }
215
- };
216
-
217
- template <>
218
- struct numpy_util<qdb_query_result_blob>
219
- {
220
- using value_type = py::object;
221
- using dtype = traits::pyobject_dtype;
222
-
223
- static inline py::object get_value(qdb_point_result_t const & row) noexcept
224
- {
225
- return py::bytes{
226
- static_cast<char const *>(row.payload.blob.content), row.payload.blob.content_length};
227
- }
228
- };
229
-
230
- template <>
231
- struct numpy_util<qdb_query_result_string>
232
- {
233
- using value_type = py::object;
234
- using dtype = traits::pyobject_dtype;
235
-
236
- static inline py::object get_value(qdb_point_result_t const & row) noexcept
237
- {
238
- return py::str{row.payload.string.content, row.payload.string.content_length};
239
- }
240
- };
241
-
242
- template <>
243
- struct numpy_util<qdb_query_result_count>
244
- {
245
- using value_type = std::int64_t;
246
- using dtype = traits::int64_dtype;
247
-
248
- static constexpr std::int64_t get_value(qdb_point_result_t const & row) noexcept
249
- {
250
- return row.payload.count.value;
251
- }
252
- };
253
-
254
- template <>
255
- struct numpy_util<qdb_query_result_timestamp>
256
- {
257
- using value_type = std::int64_t;
258
- using dtype = traits::datetime64_ns_dtype;
259
-
260
- static constexpr std::int64_t get_value(qdb_point_result_t const & row) noexcept
261
- {
262
- return convert::value<qdb_timespec_t, std::int64_t>(row.payload.timestamp.value);
263
- }
264
- };
265
-
266
- template <qdb_query_result_value_type_t ResultType>
267
- struct numpy_converter
268
- {
269
- using dtype = typename numpy_util<ResultType>::dtype;
270
-
271
- static decltype(auto) convert(qdb_size_t column, qdb_point_result_t ** rows, qdb_size_t row_count)
272
- {
273
- using value_type = typename numpy_util<ResultType>::value_type;
274
- py::dtype dtype_ = dtype::dtype();
275
-
276
- auto fn = numpy_util<ResultType>::get_value;
277
-
278
- py::array data(dtype_, py::array::ShapeContainer{row_count});
279
- qdb::mask mask = qdb::mask::of_all<true>(row_count);
280
-
281
- auto data_f = data.template mutable_unchecked<value_type, 1>();
282
-
283
- bool * mask_ = mask.mutable_data();
284
-
285
- for (qdb_size_t i = 0; i < row_count; ++i, ++mask_)
286
- {
287
- bool masked = (rows[i][column].type == qdb_query_result_none);
288
- *mask_ = masked;
289
-
290
- if (!masked)
291
- {
292
- data_f(i) = fn(rows[i][column]);
293
- }
294
- }
295
-
296
- return qdb::masked_array{data, mask};
297
- }
298
- };
299
-
300
- /**
301
- * Nothing to convert for columns without type, just return an array filled with null
302
- * values.
303
- */
304
- template <>
305
- struct numpy_converter<qdb_query_result_none>
306
- {
307
- static qdb::masked_array convert(
308
- qdb_size_t /* column */, qdb_point_result_t ** /* rows */, qdb_size_t row_count)
309
- {
310
- return numpy_null_array(row_count);
311
- }
312
- };
313
-
314
- qdb_query_result_value_type_t probe_column_type(qdb_query_result_t const & r, qdb_size_t column)
315
- {
316
- // Probe a column for its value type, by returning the type of the first non-null
317
- // value.
318
- for (qdb_size_t row = 0; row < r.row_count; ++row)
319
- {
320
- if (r.rows[row][column].type != qdb_query_result_none)
321
- {
322
- return r.rows[row][column].type;
323
- }
324
- }
325
-
326
- // No non-null values were part of the dataset.
327
- return qdb_query_result_none;
328
- }
329
-
330
- qdb::masked_array numpy_query_array(qdb_query_result_t const & r, qdb_size_t column)
331
- {
332
-
333
- switch (probe_column_type(r, column))
334
- {
335
-
336
- #define CASE(t) \
337
- case t: \
338
- return numpy_converter<t>::convert(column, r.rows, r.row_count);
339
-
340
- CASE(qdb_query_result_double);
341
- CASE(qdb_query_result_int64);
342
- CASE(qdb_query_result_string);
343
- CASE(qdb_query_result_blob);
344
- CASE(qdb_query_result_timestamp);
345
- CASE(qdb_query_result_count);
346
- CASE(qdb_query_result_none);
347
-
348
- default: {
349
- std::stringstream ss;
350
- ss << "unrecognized query result column type: " << r.rows[0][column].type;
351
- throw qdb::incompatible_type_exception(ss.str());
352
- }
353
- };
354
- }
355
-
356
- numpy_query_column_t numpy_query_column(qdb_query_result_t const & r, qdb_size_t column)
357
- {
358
-
359
- qdb::numpy_query_column_t ret;
360
- ret.first = qdb::to_string(r.column_names[column]);
361
- ret.second = py::cast(numpy_query_array(r, column));
362
- return ret;
363
- }
364
-
365
- numpy_query_result_t numpy_query_results(qdb_query_result_t const & r)
366
- {
367
- qdb::numpy_query_result_t ret{};
368
- ret.reserve(r.column_count);
369
-
370
- // First initialize the result vector. This means storing the column names,
371
- // and pre-allocating the column result arrays with data points for each .
372
- for (qdb_size_t j = 0; j < r.column_count; ++j)
373
- {
374
- ret.push_back(numpy_query_column(r, j));
375
- }
376
-
377
- return ret;
378
- }
379
-
380
- numpy_query_result_t numpy_query_results(const qdb_query_result_t * r)
381
- {
382
- if (!r || r->column_count == 0 || r->row_count == 0)
383
- {
384
- return numpy_query_result_t{};
385
- }
386
-
387
- const std::vector<std::string> column_names = coerce_column_names(*r);
388
- return numpy_query_results(*r);
389
- }
390
-
391
- dict_query_result_t dict_query(qdb::handle_ptr h, const std::string & q, const py::object & blobs)
392
- {
393
- detail::qdb_resource<qdb_query_result_t> r{*h};
394
-
395
- qdb_error_t err;
396
- {
397
- metrics::scoped_capture capture{"qdb_query"};
398
- err = qdb_query(*h, q.c_str(), &r);
399
- }
400
-
401
- qdb::qdb_throw_if_query_error(*h, err, r.get());
402
-
403
- return convert_query_results(r, blobs);
404
- }
405
-
406
- numpy_query_result_t numpy_query(qdb::handle_ptr h, const std::string & q)
407
- {
408
- detail::qdb_resource<qdb_query_result_t> r{*h};
409
-
410
- qdb_error_t err;
411
- {
412
- metrics::scoped_capture capture{"qdb_query"};
413
- err = qdb_query(*h, q.c_str(), &r);
414
- }
415
- qdb::qdb_throw_if_query_error(*h, err, r.get());
416
-
417
- return numpy_query_results(r);
418
- }
419
-
420
- } // namespace qdb
quasardb/query.hpp DELETED
@@ -1,92 +0,0 @@
1
- /*
2
- *
3
- * Official Python API
4
- *
5
- * Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
6
- * All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are met:
10
- *
11
- * * Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * * Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- * * Neither the name of quasardb nor the names of its contributors may
17
- * be used to endorse or promote products derived from this software
18
- * without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY QUASARDB AND CONTRIBUTORS ``AS IS'' AND ANY
21
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
24
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
- */
31
- #pragma once
32
-
33
- #include "handle.hpp"
34
- #include "utils.hpp"
35
- #include <qdb/query.h>
36
- #include <pybind11/numpy.h>
37
- #include <map>
38
- #include <string>
39
- #include <unordered_map>
40
- #include <vector>
41
-
42
- namespace py = pybind11;
43
-
44
- namespace qdb
45
- {
46
-
47
- class find_query
48
- {
49
- public:
50
- find_query(qdb::handle_ptr h, const std::string & query_string)
51
- : _handle{h}
52
- , _query_string{query_string}
53
- {}
54
-
55
- public:
56
- std::vector<std::string> run()
57
- {
58
- const char ** aliases = nullptr;
59
- size_t count = 0;
60
-
61
- qdb::qdb_throw_if_error(
62
- *_handle, qdb_query_find(*_handle, _query_string.c_str(), &aliases, &count));
63
-
64
- return convert_strings_and_release(_handle, aliases, count);
65
- }
66
-
67
- private:
68
- qdb::handle_ptr _handle;
69
- std::string _query_string;
70
- };
71
-
72
- using dict_query_result_t = std::vector<std::map<std::string, py::handle>>;
73
- using numpy_query_column_t = std::pair<std::string, py::object>;
74
- using numpy_query_result_t = std::vector<numpy_query_column_t>;
75
-
76
- dict_query_result_t convert_query_results(const qdb_query_result_t * r, const py::object & blobs);
77
- dict_query_result_t dict_query(qdb::handle_ptr h, const std::string & query, const py::object & blobs);
78
- numpy_query_result_t numpy_query(qdb::handle_ptr h, const std::string & query);
79
-
80
- template <typename Module>
81
- static inline void register_query(Module & m)
82
- {
83
- namespace py = pybind11;
84
-
85
- py::class_<qdb::find_query>{m, "FindQuery"} //
86
- .def(py::init<qdb::handle_ptr, const std::string &>()) //
87
- .def("run", &qdb::find_query::run); //
88
-
89
- m.def("dict_query", &qdb::dict_query);
90
- }
91
-
92
- } // namespace qdb