MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / HandleNSClientDropTable

Function HandleNSClientDropTable

src/cmd/fedb.cc:810–833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

808}
809
810void HandleNSClientDropTable(const std::vector<std::string>& parts,
811 ::fedb::client::NsClient* client) {
812 if (parts.size() < 2) {
813 std::cout << "Bad format" << std::endl;
814 return;
815 }
816 if (FLAGS_interactive) {
817 printf("Drop table %s? yes/no\n", parts[1].c_str());
818 std::string input;
819 std::cin >> input;
820 std::transform(input.begin(), input.end(), input.begin(), ::tolower);
821 if (input != "yes") {
822 printf("'drop %s' cmd is canceled!\n", parts[1].c_str());
823 return;
824 }
825 }
826 std::string msg;
827 bool ret = client->DropTable(parts[1], msg);
828 if (!ret) {
829 std::cout << "failed to drop. error msg: " << msg << std::endl;
830 return;
831 }
832 std::cout << "drop ok" << std::endl;
833}
834
835void HandleNSClientSyncTable(const std::vector<std::string>& parts,
836 ::fedb::client::NsClient* client) {

Callers 1

StartNsClientFunction · 0.85

Calls 2

sizeMethod · 0.45
DropTableMethod · 0.45

Tested by

no test coverage detected