22 #include <plugin/schema_dictionary/dictionary.h>
25 using namespace drizzled;
27 SchemasTool::SchemasTool() :
30 add_field(
"SCHEMA_NAME");
31 add_field(
"DEFAULT_COLLATION_NAME");
32 add_field(
"SCHEMA_CREATION_TIME");
33 add_field(
"SCHEMA_UPDATE_TIME");
34 add_field(
"SCHEMA_UUID", plugin::TableFunction::STRING, 36,
true);
35 add_field(
"SCHEMA_VERSION", plugin::TableFunction::NUMBER, 0,
true);
36 add_field(
"SCHEMA_USE_COUNT", plugin::TableFunction::NUMBER, 0,
true);
37 add_field(
"IS_REPLICATED", plugin::TableFunction::BOOLEAN, 0,
false);
38 add_field(
"SCHEMA_DEFINER", plugin::TableFunction::STRING, 64,
true);
43 schema_generator(getSession())
47 bool SchemasTool::Generator::populate()
49 drizzled::message::schema::shared_ptr schema_ptr;
50 while ((schema_ptr= schema_generator))
53 push(schema_ptr->name());
56 push(schema_ptr->collation());
59 time_t time_arg= schema_ptr->creation_timestamp();
63 localtime_r(&time_arg, &tm_buffer);
64 strftime(buffer,
sizeof(buffer),
"%a %b %d %H:%M:%S %Y", &tm_buffer);
68 time_arg= schema_ptr->update_timestamp();
69 localtime_r(&time_arg, &tm_buffer);
70 strftime(buffer,
sizeof(buffer),
"%a %b %d %H:%M:%S %Y", &tm_buffer);
74 push(schema_ptr->uuid());
77 push(schema_ptr->version());
80 push(schema_ptr->version());
83 push(message::is_replicated(*schema_ptr));
86 if (message::has_definer(*schema_ptr))
88 push(message::definer(*schema_ptr));