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/information_schema_dictionary/dictionary.h"
24
using namespace drizzled;
26
static CheckConstraints *check_constraints;
27
static ColumnDomainUsage *column_domain_usage;
28
static ColumnPrivileges *column_privileges;
29
static Columns *columns;
30
static ConstraintColumnUsage *constraint_column_usage;
31
static ConstraintTableUsage *constraint_table_usage;
32
static DomainConstraints *domain_constraints;
33
static Domains *domains;
34
static KeyColumnUsage *key_column_usage;
35
static Parameters *parameters;
36
static ReferentialConstraints *referential_constraints;
37
static Routines *routines;
38
static RoutineColumns *routine_columns;
39
static Schemata *schemata;
40
static TableConstraints *table_constraints;
41
static TablePriviledges *table_privileges;
42
static Tables *tables;
43
static ViewColumnUsage *view_column_usage;
44
static ViewTableUsage *view_table_usage;
47
static int init(drizzled::plugin::Registry ®istry)
49
check_constraints = new(std::nothrow)CheckConstraints;
50
column_domain_usage = new(std::nothrow)ColumnDomainUsage;
51
column_privileges = new(std::nothrow)ColumnPrivileges;
52
columns = new(std::nothrow)Columns;
53
constraint_column_usage = new(std::nothrow)ConstraintColumnUsage;
54
constraint_table_usage = new(std::nothrow)ConstraintTableUsage;
55
domain_constraints = new(std::nothrow)DomainConstraints;
56
domains = new(std::nothrow)Domains;
57
key_column_usage = new(std::nothrow)KeyColumnUsage;
58
parameters = new(std::nothrow)Parameters;
59
referential_constraints = new(std::nothrow)ReferentialConstraints;
60
routines = new(std::nothrow)Routines;
61
routine_columns = new(std::nothrow)RoutineColumns;
62
schemata = new(std::nothrow)Schemata;
63
table_constraints = new(std::nothrow)TableConstraints;
64
table_privileges = new(std::nothrow)TablePriviledges;
65
tables = new(std::nothrow)Tables;
66
view_column_usage = new(std::nothrow)ViewColumnUsage;
67
view_table_usage = new(std::nothrow)ViewTableUsage;
68
views = new(std::nothrow)Views;
70
registry.add(check_constraints);
71
registry.add(column_domain_usage);
72
registry.add(column_privileges);
73
registry.add(columns);
74
registry.add(constraint_column_usage);
75
registry.add(constraint_table_usage);
76
registry.add(domain_constraints);
77
registry.add(domains);
78
registry.add(key_column_usage);
79
registry.add(parameters);
80
registry.add(referential_constraints);
81
registry.add(routines);
82
registry.add(routine_columns);
83
registry.add(schemata);
84
registry.add(table_constraints);
85
registry.add(table_privileges);
87
registry.add(view_column_usage);
88
registry.add(view_table_usage);
94
static int finalize(drizzled::plugin::Registry ®istry)
96
registry.remove(check_constraints);
97
registry.remove(column_domain_usage);
98
registry.remove(column_privileges);
99
registry.remove(columns);
100
registry.remove(constraint_column_usage);
101
registry.remove(constraint_table_usage);
102
registry.remove(domain_constraints);
103
registry.remove(domains);
104
registry.remove(key_column_usage);
105
registry.remove(parameters);
106
registry.remove(referential_constraints);
107
registry.remove(routines);
108
registry.remove(routine_columns);
109
registry.remove(schemata);
110
registry.remove(table_constraints);
111
registry.remove(table_privileges);
112
registry.remove(tables);
113
registry.remove(view_column_usage);
114
registry.remove(view_table_usage);
115
registry.remove(views);
117
delete check_constraints;
118
delete column_domain_usage;
119
delete column_privileges;
121
delete constraint_column_usage;
122
delete constraint_table_usage;
123
delete domain_constraints;
125
delete key_column_usage;
127
delete referential_constraints;
129
delete routine_columns;
131
delete table_constraints;
132
delete table_privileges;
134
delete view_column_usage;
135
delete view_table_usage;
141
DRIZZLE_DECLARE_PLUGIN
144
"information_schema_dictionary",
147
"Data Dictionary for ANSI information schema, etc",
154
DRIZZLE_DECLARE_PLUGIN_END;