| 166 | |
| 167 | |
| 168 | void ZVecPyCollection::bind_ddl_methods( |
| 169 | py::class_<Collection, Collection::Ptr> &col) { |
| 170 | // bind collection properties |
| 171 | col.def("Path", |
| 172 | [](const Collection &self) { |
| 173 | auto ret = self.path(); |
| 174 | return unwrap_expected(ret); |
| 175 | }) |
| 176 | .def("Options", |
| 177 | [](const Collection &self) { |
| 178 | auto ret = self.options(); |
| 179 | return unwrap_expected(ret); |
| 180 | }) |
| 181 | .def("Schema", |
| 182 | [](const Collection &self) { |
| 183 | auto ret = self.schema(); |
| 184 | return unwrap_expected(ret); |
| 185 | }) |
| 186 | .def("Stats", [](const Collection &self) { |
| 187 | auto ret = self.stats(); |
| 188 | return unwrap_expected(ret); |
| 189 | }); |
| 190 | |
| 191 | // bind collection ddl methods |
| 192 | col.def("Close", |
| 193 | [](Collection &self) { |
| 194 | Status status; |
| 195 | { |
| 196 | py::gil_scoped_release release; |
| 197 | status = self.close(); |
| 198 | } |
| 199 | throw_if_error(status); |
| 200 | }) |
| 201 | .def("Destroy", |
| 202 | [](Collection &self) { |
| 203 | Status status; |
| 204 | { |
| 205 | py::gil_scoped_release release; |
| 206 | status = self.destroy(); |
| 207 | } |
| 208 | throw_if_error(status); |
| 209 | }) |
| 210 | .def("Flush", [](Collection &self) { |
| 211 | Status status; |
| 212 | { |
| 213 | py::gil_scoped_release release; |
| 214 | status = self.flush(); |
| 215 | } |
| 216 | throw_if_error(status); |
| 217 | }); |
| 218 | |
| 219 | // binding index ddl methods |
| 220 | col.def("CreateIndex", |
| 221 | [](Collection &self, const std::string &column_name, |
| 222 | const IndexParams::Ptr &index_options, |
| 223 | const CreateIndexOptions &options) { |
| 224 | Status status; |
| 225 | { |
nothing calls this directly
no test coverage detected