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 ShowColumns *show_columns;
33
static ShowIndexes *show_indexes;
34
static TableConstraintsTool *table_constraints;
35
static TablesTool *tables;
36
static ShowTables *local_tables;
37
static ShowTableStatus *table_status;
38
static ShowTemporaryTables *show_temporary_tables;
41
static int init(drizzled::plugin::Registry ®istry)
43
columns= new(std::nothrow)ColumnsTool;
44
index_parts= new(std::nothrow)IndexPartsTool;
45
indexes= new(std::nothrow)IndexesTool;
46
local_tables= new(std::nothrow)ShowTables;
47
referential_constraints= new(std::nothrow)ReferentialConstraintsTool;
48
schema_names= new(std::nothrow)SchemaNames;
49
schemas= new(std::nothrow)SchemasTool;
50
show_columns= new(std::nothrow)ShowColumns;
51
show_indexes= new(std::nothrow)ShowIndexes;
52
show_temporary_tables= new(std::nothrow)ShowTemporaryTables;
53
table_constraints= new(std::nothrow)TableConstraintsTool;
54
table_status= new(std::nothrow)ShowTableStatus;
55
tables= new(std::nothrow)TablesTool;
57
registry.add(columns);
58
registry.add(index_parts);
59
registry.add(indexes);
60
registry.add(local_tables);
61
registry.add(referential_constraints);
62
registry.add(schema_names);
63
registry.add(schemas);
64
registry.add(show_columns);
65
registry.add(show_indexes);
66
registry.add(show_temporary_tables);
67
registry.add(table_constraints);
68
registry.add(table_status);
74
static int finalize(drizzled::plugin::Registry ®istry)
76
registry.remove(columns);
77
registry.remove(index_parts);
78
registry.remove(indexes);
79
registry.remove(local_tables);
80
registry.remove(referential_constraints);
81
registry.remove(schema_names);
82
registry.remove(schemas);
83
registry.remove(show_columns);
84
registry.remove(show_indexes);
85
registry.remove(show_temporary_tables);
86
registry.remove(table_constraints);
87
registry.remove(table_status);
88
registry.remove(tables);
93
delete referential_constraints;
98
delete show_temporary_tables;
99
delete table_constraints;
106
DRIZZLE_DECLARE_PLUGIN
112
"Data Dictionary for schema, table, column, indexes, etc",
119
DRIZZLE_DECLARE_PLUGIN_END;