MCPcopy Create free account
hub / github.com/activeloopai/deeplake / erase_view

Method erase_view

cpp/deeplake_pg/table_storage.cpp:1208–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1206}
1207
1208void table_storage::erase_view(const std::string& view_name)
1209{
1210 Oid view_oid = RelnameGetRelid(view_name.c_str());
1211 if (views_.erase(view_oid) == 0) {
1212 return;
1213 }
1214 up_to_date_ = false;
1215 pg::utils::memory_context_switcher context_switcher;
1216 if (!pg::utils::check_table_exists("pg_deeplake_views")) {
1217 return;
1218 }
1219 std::string delete_str = fmt::format("DELETE FROM public.pg_deeplake_views WHERE view_name = '{}'", view_name);
1220
1221 pg::utils::spi_connector connector;
1222 if (SPI_execute(delete_str.c_str(), false, 0) != SPI_OK_DELETE) {
1223 ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Failed to erase view metadata")));
1224 }
1225}
1226
1227} // namespace pg

Callers 1

process_utilityFunction · 0.80

Calls 2

check_table_existsFunction · 0.85
eraseMethod · 0.45

Tested by

no test coverage detected