~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to plugins/db.mysql/backend/db_rev_eng_be.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License as
 
6
 * published by the Free Software Foundation; version 2 of the
 
7
 * License.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
12
 * GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
17
 * 02110-1301  USA
 
18
 */
 
19
 
 
20
#include "stdafx.h"
 
21
 
 
22
#include "wb_config.h"
 
23
#include "db_rev_eng_be.h"
 
24
#include "base/string_utilities.h"
 
25
 
 
26
void Db_rev_eng::grtm(bec::GRTManager *grtm)
 
27
{
 
28
  Db_plugin::grtm(grtm);
 
29
  Sql_import::grtm(grtm);
 
30
}
 
31
 
 
32
 
 
33
std::string Db_rev_eng::task_desc()
 
34
{
 
35
  return "Reverse engineer database";
 
36
}
 
37
 
 
38
 
 
39
db_CatalogRef Db_rev_eng::target_catalog()
 
40
{
 
41
  return Db_plugin::model_catalog();
 
42
}
 
43
 
 
44
 
 
45
std::string Db_rev_eng::sql_script()
 
46
{
 
47
  std::string sql_script;
 
48
  Db_plugin::dump_ddl(sql_script);
 
49
  return sql_script;
 
50
}
 
51
 
 
52
 
 
53
void Db_rev_eng::parse_sql_script(SqlFacade::Ref sql_parser, db_CatalogRef &catalog, const std::string &sql_script, grt::DictRef &options)
 
54
{
 
55
  grt::AutoUndo undo(_grtm->get_grt());
 
56
  sql_parser->parseSqlScriptStringEx(catalog, sql_script, options);
 
57
  undo.end(_("Reverse Engineer Database"));
 
58
}
 
59
 
 
60