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
static ColumnsTool *columns;
25
static IndexPartsTool *index_parts;
26
static IndexesTool *indexes;
27
static ReferentialConstraintsTool *referential_constraints;
28
static SchemasTool *schemas;
29
static SchemaNames *schema_names;
30
static TableConstraintsTool *table_constraints;
31
static TablesTool *tables;
32
static TableNames *local_tables;
33
static TableStatus *table_status;
36
static int init(drizzled::plugin::Registry ®istry)
38
columns= new(std::nothrow)ColumnsTool;
39
index_parts= new(std::nothrow)IndexPartsTool;
40
indexes= new(std::nothrow)IndexesTool;
41
referential_constraints= new(std::nothrow)ReferentialConstraintsTool;
42
schemas= new(std::nothrow)SchemasTool;
43
local_tables= new(std::nothrow)TableNames;
44
schema_names= new(std::nothrow)SchemaNames;
45
table_constraints= new(std::nothrow)TableConstraintsTool;
46
table_status= new(std::nothrow)TableStatus;
47
tables= new(std::nothrow)TablesTool;
49
registry.add(columns);
50
registry.add(index_parts);
51
registry.add(indexes);
52
registry.add(local_tables);
53
registry.add(referential_constraints);
54
registry.add(schema_names);
55
registry.add(schemas);
56
registry.add(table_constraints);
57
registry.add(table_status);
63
static int finalize(drizzled::plugin::Registry ®istry)
65
registry.remove(columns);
66
registry.remove(index_parts);
67
registry.remove(indexes);
68
registry.remove(local_tables);
69
registry.remove(referential_constraints);
70
registry.remove(schema_names);
71
registry.remove(schemas);
72
registry.remove(table_constraints);
73
registry.remove(table_status);
74
registry.remove(tables);
79
delete referential_constraints;
82
delete table_constraints;
89
DRIZZLE_DECLARE_PLUGIN
95
"Data Dictionary for schema, table, column, indexes, etc",
103
DRIZZLE_DECLARE_PLUGIN_END;