~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/dictionary.cc

Merge Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
using namespace drizzled;
25
25
 
26
 
static int init(drizzled::module::Context &context)
 
26
static ColumnsTool *columns;
 
27
static IndexPartsTool *index_parts;
 
28
static IndexesTool *indexes;
 
29
static ReferentialConstraintsTool *referential_constraints;
 
30
static SchemasTool *schemas;
 
31
static SchemaNames *schema_names;
 
32
static TableConstraintsTool *table_constraints;
 
33
static TablesTool *tables;
 
34
static TableNames *local_tables;
 
35
static TableStatus *table_status;
 
36
 
 
37
 
 
38
static int init(drizzled::plugin::Registry &registry)
27
39
{
28
 
  context.add(new ColumnsTool());
29
 
  context.add(new IndexPartsTool());
30
 
  context.add(new IndexesTool());
31
 
  context.add(new ForeignKeysTool());
32
 
  context.add(new SchemasTool());
33
 
  context.add(new TableConstraintsTool());
34
 
  context.add(new TablesTool());
 
40
  columns= new(std::nothrow)ColumnsTool;
 
41
  index_parts= new(std::nothrow)IndexPartsTool;
 
42
  indexes= new(std::nothrow)IndexesTool;
 
43
  referential_constraints= new(std::nothrow)ReferentialConstraintsTool;
 
44
  schemas= new(std::nothrow)SchemasTool;
 
45
  local_tables= new(std::nothrow)TableNames;
 
46
  schema_names= new(std::nothrow)SchemaNames;
 
47
  table_constraints= new(std::nothrow)TableConstraintsTool;
 
48
  table_status= new(std::nothrow)TableStatus;
 
49
  tables= new(std::nothrow)TablesTool;
 
50
 
 
51
  registry.add(columns);
 
52
  registry.add(index_parts);
 
53
  registry.add(indexes);
 
54
  registry.add(local_tables);
 
55
  registry.add(referential_constraints);
 
56
  registry.add(schema_names);
 
57
  registry.add(schemas);
 
58
  registry.add(table_constraints);
 
59
  registry.add(table_status);
 
60
  registry.add(tables);
35
61
  
36
62
  return 0;
37
63
}
38
64
 
 
65
static int finalize(drizzled::plugin::Registry &registry)
 
66
{
 
67
  registry.remove(columns);
 
68
  registry.remove(index_parts);
 
69
  registry.remove(indexes);
 
70
  registry.remove(local_tables);
 
71
  registry.remove(referential_constraints);
 
72
  registry.remove(schema_names);
 
73
  registry.remove(schemas);
 
74
  registry.remove(table_constraints);
 
75
  registry.remove(table_status);
 
76
  registry.remove(tables);
 
77
  delete columns;
 
78
  delete index_parts;
 
79
  delete indexes;
 
80
  delete local_tables;
 
81
  delete referential_constraints;
 
82
  delete schema_names;
 
83
  delete schemas;
 
84
  delete table_constraints;
 
85
  delete table_status;
 
86
  delete tables;
 
87
 
 
88
  return 0;
 
89
}
 
90
 
39
91
DRIZZLE_DECLARE_PLUGIN
40
92
{
41
93
  DRIZZLE_VERSION_ID,
45
97
  "Data Dictionary for schema, table, column, indexes, etc",
46
98
  PLUGIN_LICENSE_GPL,
47
99
  init,
 
100
  finalize,
48
101
  NULL,
49
102
  NULL
50
103
}