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

Method bind_db_methods

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

Source from the content-addressed store, hash-verified

71}
72
73void ZVecPyCollection::bind_db_methods(
74 py::class_<Collection, Collection::Ptr> &col) {
75 col.def_static("CreateAndOpen",
76 [](const std::string &path, const CollectionSchema &schema,
77 const CollectionOptions &options) {
78 Result<Collection::Ptr> result;
79 {
80 py::gil_scoped_release release;
81 result = Collection::CreateAndOpen(path, schema, options);
82 }
83 return unwrap_expected(result);
84 })
85 .def_static("Open", [](const std::string &path,
86 const CollectionOptions &options) {
87 Result<Collection::Ptr> result;
88 {
89 py::gil_scoped_release release;
90 result = Collection::Open(path, options);
91 }
92 return unwrap_expected(result);
93 });
94}
95
96
97void ZVecPyCollection::bind_ddl_methods(

Callers

nothing calls this directly

Calls 1

unwrap_expectedFunction · 0.85

Tested by

no test coverage detected