MCPcopy Create free account
hub / github.com/MariaDB/server / get_tables

Method get_tables

libmysqld/examples/builder-sample/emb_samples.cpp:148–171  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

146}
147//---------------------------------------------------------------------------
148bool __fastcall TForm1::get_tables(String db_name)
149{
150 MYSQL_RES *res;
151 AnsiString s_cmd;
152
153 TableView->Items->Clear();
154 s_cmd = "use ";
155 s_cmd+= db_name.c_str();
156
157 if (mysql_query(MySQL, s_cmd.c_str()) ||
158 !(res=mysql_list_tables(MySQL,"%")))
159 return false;
160
161 tables_node = TableView->Items->Add(NULL, db_name.c_str());
162 tables_node->ImageIndex = 1;
163 tables_node->SelectedIndex = 1;
164
165 deque<string> rows = fill_rows(res);
166
167 mysql_free_result(res);
168 fill_tree(rows,tables_tree,tables_node,TableView,2);
169
170 return true;
171}
172//---------------------------------------------------------------------------
173bool __fastcall TForm1::get_dbs(void)
174{

Callers

nothing calls this directly

Calls 5

mysql_queryFunction · 0.85
fill_rowsFunction · 0.85
mysql_free_resultFunction · 0.85
ClearMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected