1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 Brian Aker
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#include "plugin/schema_dictionary/dictionary.h"
24
using namespace drizzled;
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;
38
static int init(drizzled::plugin::Registry ®istry)
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;
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);
65
static int finalize(drizzled::plugin::Registry ®istry)
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);
81
delete referential_constraints;
84
delete table_constraints;
91
DRIZZLE_DECLARE_PLUGIN
97
"Data Dictionary for schema, table, column, indexes, etc",
105
DRIZZLE_DECLARE_PLUGIN_END;