quasardb 3.14.2.dev1__cp311-cp311-macosx_11_0_arm64.whl → 3.14.2.dev4__cp311-cp311-macosx_11_0_arm64.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 (95) hide show
  1. quasardb/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  2. quasardb/Makefile +20 -20
  3. quasardb/__init__.py +33 -4
  4. quasardb/cmake_install.cmake +7 -1
  5. quasardb/date/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  6. quasardb/date/CMakeFiles/Export/a52b05f964b070ee926bcad51d3288af/dateTargets.cmake +13 -13
  7. quasardb/date/Makefile +20 -20
  8. quasardb/date/cmake_install.cmake +7 -1
  9. quasardb/date/dateConfigVersion.cmake +9 -2
  10. quasardb/date/dateTargets.cmake +4 -8
  11. quasardb/libqdb_api.dylib +0 -0
  12. quasardb/numpy/__init__.py +58 -10
  13. quasardb/pandas/__init__.py +58 -102
  14. quasardb/pybind11/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  15. quasardb/pybind11/Makefile +20 -20
  16. quasardb/pybind11/cmake_install.cmake +7 -1
  17. quasardb/quasardb.cpython-311-darwin.so +0 -0
  18. quasardb/range-v3/CMakeFiles/CMakeDirectoryInformation.cmake +1 -1
  19. quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +13 -13
  20. quasardb/range-v3/CMakeFiles/range.v3.headers.dir/DependInfo.cmake +6 -2
  21. quasardb/range-v3/CMakeFiles/range.v3.headers.dir/build.make +7 -4
  22. quasardb/range-v3/Makefile +20 -20
  23. quasardb/range-v3/cmake_install.cmake +19 -1
  24. quasardb/range-v3/range-v3-config-version.cmake +9 -2
  25. quasardb/range-v3/range-v3-config.cmake +4 -8
  26. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/METADATA +15 -10
  27. quasardb-3.14.2.dev4.dist-info/RECORD +45 -0
  28. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/WHEEL +1 -1
  29. quasardb/CMakeLists.txt +0 -510
  30. quasardb/batch_column.hpp +0 -80
  31. quasardb/batch_inserter.hpp +0 -248
  32. quasardb/blob.hpp +0 -150
  33. quasardb/cluster.cpp +0 -89
  34. quasardb/cluster.hpp +0 -551
  35. quasardb/concepts.hpp +0 -278
  36. quasardb/continuous.cpp +0 -149
  37. quasardb/continuous.hpp +0 -106
  38. quasardb/convert/array.hpp +0 -282
  39. quasardb/convert/point.hpp +0 -330
  40. quasardb/convert/range.hpp +0 -282
  41. quasardb/convert/unicode.hpp +0 -598
  42. quasardb/convert/util.hpp +0 -22
  43. quasardb/convert/value.hpp +0 -711
  44. quasardb/convert.hpp +0 -38
  45. quasardb/detail/qdb_resource.hpp +0 -129
  46. quasardb/detail/ts_column.hpp +0 -224
  47. quasardb/direct_blob.hpp +0 -108
  48. quasardb/direct_handle.hpp +0 -83
  49. quasardb/direct_integer.hpp +0 -94
  50. quasardb/dispatch.hpp +0 -157
  51. quasardb/double.hpp +0 -87
  52. quasardb/entry.hpp +0 -273
  53. quasardb/error.hpp +0 -318
  54. quasardb/handle.cpp +0 -29
  55. quasardb/handle.hpp +0 -98
  56. quasardb/integer.hpp +0 -88
  57. quasardb/logger.cpp +0 -106
  58. quasardb/logger.hpp +0 -228
  59. quasardb/masked_array.hpp +0 -651
  60. quasardb/metrics.cpp +0 -103
  61. quasardb/metrics.hpp +0 -112
  62. quasardb/module.cpp +0 -76
  63. quasardb/module.hpp +0 -24
  64. quasardb/node.hpp +0 -123
  65. quasardb/numpy.cpp +0 -6
  66. quasardb/numpy.hpp +0 -489
  67. quasardb/object_tracker.hpp +0 -283
  68. quasardb/options.hpp +0 -244
  69. quasardb/perf.hpp +0 -336
  70. quasardb/pytypes.hpp +0 -221
  71. quasardb/query.cpp +0 -420
  72. quasardb/query.hpp +0 -92
  73. quasardb/reader/ts_row.hpp +0 -281
  74. quasardb/reader/ts_value.hpp +0 -245
  75. quasardb/remove_cvref.hpp +0 -31
  76. quasardb/string.hpp +0 -160
  77. quasardb/table.cpp +0 -289
  78. quasardb/table.hpp +0 -325
  79. quasardb/table_reader.hpp +0 -220
  80. quasardb/tag.hpp +0 -77
  81. quasardb/timestamp.hpp +0 -97
  82. quasardb/traits.hpp +0 -619
  83. quasardb/ts_iterator.hpp +0 -193
  84. quasardb/utils/blob_deque.hpp +0 -96
  85. quasardb/utils/ostream.hpp +0 -17
  86. quasardb/utils/permutation.hpp +0 -50
  87. quasardb/utils/stable_sort.hpp +0 -25
  88. quasardb/utils/unzip_view.hpp +0 -89
  89. quasardb/utils.cpp +0 -28
  90. quasardb/utils.hpp +0 -174
  91. quasardb/writer.cpp +0 -534
  92. quasardb/writer.hpp +0 -396
  93. quasardb-3.14.2.dev1.dist-info/RECORD +0 -109
  94. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/LICENSE.md +0 -0
  95. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/top_level.txt +0 -0
quasardb/convert.hpp DELETED
@@ -1,38 +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
- // Convenience include, includes $everything
34
-
35
- #include "convert/array.hpp"
36
- #include "convert/point.hpp"
37
- #include "convert/range.hpp"
38
- #include "convert/value.hpp"
@@ -1,129 +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 <qdb/client.h> // for qdb_handle_t
34
-
35
- namespace qdb
36
- {
37
-
38
- namespace detail
39
- {
40
-
41
- /**
42
- * Resource guard for QDB-native allocated resources. Automatically invokes
43
- * qdb_release() when the guard goes out of scope.
44
- */
45
- template <typename ValueType>
46
- class qdb_resource
47
- {
48
- public:
49
- /**
50
- * Default constructor, initializes nullpointer.
51
- */
52
- qdb_resource(qdb_handle_t h)
53
- : qdb_resource(h, nullptr)
54
- {}
55
-
56
- /**
57
- * Constructor and immediately initialize with pointer.
58
- */
59
- qdb_resource(qdb_handle_t h, ValueType * p)
60
- : h_(h)
61
- , p_(p)
62
- {}
63
-
64
- qdb_resource(qdb_resource const &) = delete;
65
- qdb_resource & operator=(qdb_resource const &) = delete;
66
-
67
- ~qdb_resource()
68
- {
69
- if (p_ != nullptr)
70
- {
71
- qdb_release(h_, p_);
72
- }
73
-
74
- p_ = nullptr;
75
- }
76
-
77
- constexpr operator ValueType *() const
78
- {
79
- return get();
80
- }
81
-
82
- operator ValueType *()
83
- {
84
- return get();
85
- }
86
-
87
- ValueType * get()
88
- {
89
- return p_;
90
- }
91
-
92
- constexpr ValueType const * get() const
93
- {
94
- return p_;
95
- }
96
-
97
- ValueType ** operator&()
98
- {
99
- return &p_;
100
- }
101
-
102
- ValueType & operator*()
103
- {
104
- return *p_;
105
- }
106
-
107
- ValueType * operator->()
108
- {
109
- return p_;
110
- }
111
-
112
- constexpr ValueType const * operator->() const
113
- {
114
- return p_;
115
- }
116
-
117
- constexpr ValueType const & operator*() const
118
- {
119
- return *p_;
120
- }
121
-
122
- private:
123
- qdb_handle_t h_;
124
- ValueType * p_;
125
- };
126
-
127
- } // namespace detail
128
-
129
- } // namespace qdb
@@ -1,224 +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 "../error.hpp"
34
- #include <qdb/ts.h>
35
- #include <cassert>
36
- #include <string>
37
-
38
- namespace qdb
39
- {
40
-
41
- namespace detail
42
- {
43
-
44
- inline std::string type_to_string(qdb_ts_column_type_t t)
45
- {
46
- switch (t)
47
- {
48
- case qdb_ts_column_double:
49
- return "double";
50
- case qdb_ts_column_blob:
51
- return "blob";
52
- case qdb_ts_column_int64:
53
- return "int64";
54
- case qdb_ts_column_timestamp:
55
- return "timestamp";
56
- case qdb_ts_column_string:
57
- return "string";
58
- case qdb_ts_column_symbol:
59
- return "symbol";
60
- default:
61
- return "uninitialized";
62
- }
63
- }
64
-
65
- struct column_info
66
- {
67
- column_info() = default;
68
-
69
- explicit column_info(qdb_ts_column_type_t t, const std::string & n)
70
- : column_info{t, n, std::string{}}
71
- {}
72
-
73
- explicit column_info(qdb_ts_column_type_t t, const std::string & n, const std::string & s)
74
- : type{t}
75
- , name{n}
76
- , symtable{s}
77
- {
78
- if (t == qdb_ts_column_symbol && s.empty()) [[unlikely]]
79
- {
80
- throw qdb::invalid_argument_exception{
81
- "column '" + n + "' is a symbol but no symbol table provided"};
82
- }
83
- else if (t != qdb_ts_column_symbol && s.empty() == false) [[unlikely]]
84
- {
85
- throw qdb::invalid_argument_exception{
86
- "column '" + n + "' is a not a symbol but symbol table provided: '" + s + "'"};
87
- }
88
- }
89
-
90
- explicit column_info(const qdb_ts_column_info_t & ci)
91
- : column_info{ci.type, ci.name, {}}
92
- {}
93
-
94
- explicit column_info(const qdb_ts_column_info_ex_t & ci)
95
- : column_info{ci.type, ci.name, ci.symtable}
96
- {}
97
-
98
- std::string repr() const
99
- {
100
- return "<quasardb.ColumnInfo name='" + name + "' type='" + type_to_string(type) + "'>";
101
- }
102
-
103
- operator qdb_ts_column_info_t() const noexcept
104
- {
105
- qdb_ts_column_info_t res;
106
-
107
- // WARNING(leon): we assume that the lifetime of `this` is longer
108
- // than `res`, and that the string does not need to be deep-copied.
109
- //
110
- // In our current code, this is the case.
111
- res.type = type;
112
- res.name = name.c_str();
113
-
114
- return res;
115
- }
116
-
117
- operator qdb_ts_column_info_ex_t() const noexcept
118
- {
119
- qdb_ts_column_info_ex_t res;
120
-
121
- // WARNING(leon): we assume that the lifetime of `this` is longer
122
- // than `res`, and that the string does not need to be deep-copied.
123
- //
124
- // In our current code, this is the case.
125
- res.type = type;
126
- res.name = name.c_str();
127
- res.symtable = symtable.c_str();
128
-
129
- return res;
130
- }
131
-
132
- qdb_ts_column_type_t type{qdb_ts_column_uninitialized};
133
- std::string name;
134
- std::string symtable;
135
- };
136
-
137
- static inline std::vector<qdb_ts_column_info_t> convert_columns(
138
- const std::vector<column_info> & columns)
139
- {
140
- std::vector<qdb_ts_column_info_t> res(columns.size());
141
-
142
- std::transform(columns.cbegin(), columns.cend(), res.begin(),
143
- [](const column_info & ci) -> qdb_ts_column_info_t { return ci; });
144
-
145
- return res;
146
- }
147
- static inline std::vector<qdb_ts_column_info_ex_t> convert_columns_ex(
148
- const std::vector<column_info> & columns)
149
- {
150
- std::vector<qdb_ts_column_info_ex_t> res(columns.size());
151
-
152
- std::transform(columns.cbegin(), columns.cend(), res.begin(),
153
- [](const column_info & ci) -> qdb_ts_column_info_ex_t { return ci; });
154
-
155
- return res;
156
- }
157
-
158
- static inline std::vector<column_info> convert_columns(
159
- const qdb_ts_column_info_ex_t * columns, size_t count)
160
- {
161
- std::vector<column_info> res(count);
162
-
163
- std::transform(columns, columns + count, res.begin(),
164
- [](const qdb_ts_column_info_ex_t & ci) { return column_info{ci}; });
165
-
166
- return res;
167
- }
168
-
169
- struct indexed_column_info
170
- {
171
- indexed_column_info() = default;
172
-
173
- indexed_column_info(qdb_ts_column_type_t t, qdb_size_t i, const std::string & s = {})
174
- : type{t}
175
- , index{i}
176
- , symtable{s}
177
- {
178
- assert((t != qdb_ts_column_symbol) == s.empty());
179
- }
180
-
181
- qdb_ts_column_type_t type{qdb_ts_column_uninitialized};
182
- qdb_size_t index;
183
- std::string symtable;
184
- };
185
-
186
- using indexed_columns_t = std::map<std::string, indexed_column_info>;
187
-
188
- template <typename ColumnType>
189
- static indexed_columns_t index_columns(const std::vector<ColumnType> & columns)
190
- {
191
- indexed_columns_t i_columns;
192
- for (qdb_size_t i = 0; i < columns.size(); ++i)
193
- {
194
- i_columns.insert(
195
- indexed_columns_t::value_type(columns[i].name, {columns[i].type, i, columns[i].symtable}));
196
- }
197
-
198
- return i_columns;
199
- }
200
-
201
- template <typename Module>
202
- static inline void register_ts_column(Module & m)
203
- {
204
- namespace py = pybind11;
205
-
206
- py::class_<column_info>{m, "ColumnInfo"} //
207
- .def(py::init<qdb_ts_column_type_t, const std::string &>()) //
208
- .def(py::init<qdb_ts_column_type_t, const std::string &, const std::string &>()) //
209
- .def("__repr__", &column_info::repr)
210
- .def_readwrite("type", &column_info::type) //
211
- .def_readwrite("name", &column_info::name) //
212
- .def_readwrite("symtable", &column_info::symtable); //
213
-
214
- py::class_<indexed_column_info>{m, "IndexedColumnInfo"} //
215
- .def(py::init<qdb_ts_column_type_t, qdb_size_t>()) //
216
- .def(py::init<qdb_ts_column_type_t, qdb_size_t, const std::string &>()) //
217
- .def_readonly("type", &indexed_column_info::type) //
218
- .def_readonly("index", &indexed_column_info::index) //
219
- .def_readonly("symtable", &indexed_column_info::symtable); //
220
- }
221
-
222
- } // namespace detail
223
-
224
- } // namespace qdb
quasardb/direct_blob.hpp DELETED
@@ -1,108 +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 "direct_handle.hpp"
34
- #include "error.hpp"
35
- #include "handle.hpp"
36
- #include <qdb/direct.h>
37
-
38
- namespace qdb
39
- {
40
-
41
- class direct_blob_entry
42
- {
43
- public:
44
- direct_blob_entry(handle_ptr h, direct_handle_ptr dh, std::string a) noexcept
45
- : _handle{h}
46
- , _direct_handle{dh}
47
- , _alias{a}
48
- {}
49
-
50
- pybind11::bytes get()
51
- {
52
- const void * content = nullptr;
53
- qdb_size_t content_length = 0;
54
-
55
- qdb::qdb_throw_if_error(
56
- *_handle, qdb_direct_blob_get(*_direct_handle, _alias.c_str(), &content, &content_length));
57
-
58
- return convert_and_release_content(content, content_length);
59
- }
60
-
61
- void put(std::string const & data)
62
- {
63
- qdb::qdb_throw_if_error(*_handle, qdb_direct_blob_put(*_direct_handle, _alias.c_str(),
64
- data.data(), data.size(), qdb_time_t{0}));
65
- }
66
-
67
- void update(std::string const & data)
68
- {
69
- qdb::qdb_throw_if_error(*_handle, qdb_direct_blob_update(*_direct_handle, _alias.c_str(),
70
- data.data(), data.size(), qdb_time_t{0}));
71
- }
72
-
73
- void remove()
74
- {
75
- qdb::qdb_throw_if_error(*_handle, qdb_direct_remove(*_direct_handle, _alias.c_str()));
76
- }
77
-
78
- private:
79
- pybind11::bytes convert_and_release_content(const void * content, qdb_size_t content_length)
80
- {
81
- if (!content || !content_length) return pybind11::bytes{};
82
-
83
- pybind11::bytes res(static_cast<const char *>(content), content_length);
84
-
85
- qdb_release(*_handle, content);
86
-
87
- return res;
88
- }
89
-
90
- handle_ptr _handle;
91
- direct_handle_ptr _direct_handle;
92
- std::string _alias;
93
- };
94
-
95
- template <typename Module>
96
- static inline void register_direct_blob(Module & m)
97
- {
98
- namespace py = pybind11;
99
-
100
- py::class_<qdb::direct_blob_entry>(m, "DirectBlob")
101
- .def(py::init<qdb::handle_ptr, qdb::direct_handle_ptr, std::string>())
102
- .def("get", &qdb::direct_blob_entry::get)
103
- .def("put", &qdb::direct_blob_entry::put, py::arg("data"))
104
- .def("update", &qdb::direct_blob_entry::update, py::arg("data"))
105
- .def("remove", &qdb::direct_blob_entry::remove);
106
- };
107
-
108
- } // namespace qdb
@@ -1,83 +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 <qdb/direct.h>
35
- #include <memory>
36
- #include <string>
37
-
38
- namespace qdb
39
- {
40
-
41
- class direct_handle
42
- {
43
- public:
44
- explicit direct_handle() noexcept
45
- {}
46
-
47
- ~direct_handle()
48
- {
49
- if (_handle)
50
- {
51
- qdb_direct_close(_handle);
52
- _handle = nullptr;
53
- }
54
- }
55
-
56
- void connect(const handle_ptr handle, const std::string & uri)
57
- {
58
- _handle = qdb_direct_connect(*handle, uri.c_str());
59
- if (_handle == nullptr)
60
- {
61
- // Throw here to detect an error as soon as possible.
62
- // Otherwise, C API would throw only when using the null handle.
63
- qdb_throw_if_error(*handle, qdb_e_invalid_argument);
64
- }
65
- }
66
-
67
- operator qdb_direct_handle_t() const noexcept
68
- {
69
- return _handle;
70
- }
71
-
72
- private:
73
- qdb_direct_handle_t _handle{nullptr};
74
- };
75
-
76
- using direct_handle_ptr = std::shared_ptr<direct_handle>;
77
-
78
- static inline direct_handle_ptr make_direct_handle_ptr()
79
- {
80
- return std::make_shared<qdb::direct_handle>(direct_handle());
81
- }
82
-
83
- } // namespace qdb
@@ -1,94 +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 "direct_handle.hpp"
34
- #include <qdb/integer.h>
35
-
36
- namespace qdb
37
- {
38
-
39
- class direct_integer_entry
40
- {
41
- public:
42
- direct_integer_entry(handle_ptr h, direct_handle_ptr dh, std::string a) noexcept
43
- : _handle{h}
44
- , _direct_handle{dh}
45
- , _alias{a}
46
- {}
47
-
48
- public:
49
- qdb_int_t get()
50
- {
51
- qdb_int_t result;
52
- qdb::qdb_throw_if_error(*_handle, qdb_direct_int_get(*_direct_handle, _alias.c_str(), &result));
53
- return result;
54
- }
55
-
56
- void put(qdb_int_t integer)
57
- {
58
- qdb::qdb_throw_if_error(
59
- *_handle, qdb_direct_int_put(*_direct_handle, _alias.c_str(), integer, qdb_time_t{0}));
60
- }
61
-
62
- void update(qdb_int_t integer)
63
- {
64
- qdb::qdb_throw_if_error(
65
- *_handle, qdb_direct_int_update(*_direct_handle, _alias.c_str(), integer, qdb_time_t{0}));
66
- }
67
-
68
- void remove()
69
- {
70
- qdb::qdb_throw_if_error(*_handle, qdb_direct_remove(*_direct_handle, _alias.c_str()));
71
- }
72
-
73
- private:
74
- handle_ptr _handle;
75
- direct_handle_ptr _direct_handle;
76
- std::string _alias;
77
- };
78
-
79
- template <typename Module>
80
- static inline void register_direct_integer(Module & m)
81
- {
82
- namespace py = pybind11;
83
-
84
- py::class_<qdb::direct_integer_entry>(m, "DirectInteger")
85
- .def(py::init<qdb::handle_ptr, qdb::direct_handle_ptr, std::string>())
86
- .def("get", &qdb::direct_integer_entry::get)
87
- .def("put", &qdb::direct_integer_entry::put, py::arg("integer"))
88
- .def("update", &qdb::direct_integer_entry::update, py::arg("integer"))
89
- .def("remove", &qdb::direct_integer_entry::remove)
90
-
91
- ; //
92
- }
93
-
94
- } // namespace qdb