MCPcopy Create free account
hub / github.com/alibaba/zvec / bind_ddl_methods

Method bind_ddl_methods

src/binding/python/model/python_collection.cc:168–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167
168void 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 {

Callers

nothing calls this directly

Calls 15

unwrap_expectedFunction · 0.85
throw_if_errorFunction · 0.85
pathMethod · 0.45
optionsMethod · 0.45
schemaMethod · 0.45
statsMethod · 0.45
closeMethod · 0.45
destroyMethod · 0.45
flushMethod · 0.45
create_indexMethod · 0.45
drop_indexMethod · 0.45
optimizeMethod · 0.45

Tested by

no test coverage detected