| 95 | |
| 96 | |
| 97 | void ZVecPyCollection::bind_ddl_methods( |
| 98 | py::class_<Collection, Collection::Ptr> &col) { |
| 99 | // bind collection properties |
| 100 | col.def("Path", |
| 101 | [](const Collection &self) { |
| 102 | auto ret = self.Path(); |
| 103 | return unwrap_expected(ret); |
| 104 | }) |
| 105 | .def("Options", |
| 106 | [](const Collection &self) { |
| 107 | auto ret = self.Options(); |
| 108 | return unwrap_expected(ret); |
| 109 | }) |
| 110 | .def("Schema", |
| 111 | [](const Collection &self) { |
| 112 | auto ret = self.Schema(); |
| 113 | return unwrap_expected(ret); |
| 114 | }) |
| 115 | .def("Stats", [](const Collection &self) { |
| 116 | auto ret = self.Stats(); |
| 117 | return unwrap_expected(ret); |
| 118 | }); |
| 119 | |
| 120 | // bind collection ddl methods |
| 121 | col.def("Destroy", |
| 122 | [](Collection &self) { |
| 123 | Status status; |
| 124 | { |
| 125 | py::gil_scoped_release release; |
| 126 | status = self.Destroy(); |
| 127 | } |
| 128 | throw_if_error(status); |
| 129 | }) |
| 130 | .def("Flush", [](Collection &self) { |
| 131 | Status status; |
| 132 | { |
| 133 | py::gil_scoped_release release; |
| 134 | status = self.Flush(); |
| 135 | } |
| 136 | throw_if_error(status); |
| 137 | }); |
| 138 | |
| 139 | // binding index ddl methods |
| 140 | col.def("CreateIndex", |
| 141 | [](Collection &self, const std::string &column_name, |
| 142 | const IndexParams::Ptr &index_options, |
| 143 | const CreateIndexOptions &options) { |
| 144 | Status status; |
| 145 | { |
| 146 | py::gil_scoped_release release; |
| 147 | status = self.CreateIndex(column_name, index_options, options); |
| 148 | } |
| 149 | throw_if_error(status); |
| 150 | }) |
| 151 | .def("DropIndex", |
| 152 | [](Collection &self, const std::string &column_name) { |
| 153 | Status status; |
| 154 | { |
nothing calls this directly
no test coverage detected