Debian Codegraph @

DatabaseExplorer/SqliteDbAdapter.h

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : SqliteDbAdapter.h
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 #ifndef SQLITEDBADAPTER_H
27 #define SQLITEDBADAPTER_H
28
29 #include <wx/wx.h>
30 #include "IDbAdapter.h"
31 #include "table.h"
32 #include "view.h"
33 #include "database.h"
34
35
36 #ifdef DBL_USE_SQLITE
37 #include <wx/dblayer/include/SqliteDatabaseLayer.h>
38 #endif
39
40 #include <wx/dblayer/include/DatabaseLayer.h>
41 #include "SqliteType.h"
42
43 class SQLiteDbAdapter : public IDbAdapter {
44 public:
45 SQLiteDbAdapter();
46 SQLiteDbAdapter(const wxString& fileName) ;
47 ~SQLiteDbAdapter();
48 virtual void CloseConnection();
49 virtual DatabaseLayerPtr GetDatabaseLayer(const wxString& dbName) ;
50
51
52 virtual void GetDatabases(DbConnection* dbCon);
53 virtual void GetTables(Database* db, bool includeViews);
54 virtual bool GetColumns(Table* pTab);
55 virtual void GetViews(Database* db);
56
57
58
59 virtual IDbType* GetDbTypeByName(const wxString& typeName);
60 virtual wxArrayString* GetDbTypes();
61
62 virtual IDbAdapter* Clone();
63 virtual bool CanConnect();
64 virtual bool IsConnected();
65
66 virtual wxString GetUseDb(const wxString& dbName);
67
68 virtual wxString GetDefaultSelect(const wxString& dbName, const wxString& tableName);
69 virtual wxString GetDefaultSelect(const wxString& cols, const wxString& dbName, const wxString& tableName);
70 virtual wxString GetCreateTableSql(Table* tab, bool dropTable);
71 virtual wxString GetCreateViewSql(View* view, bool dropView);
72 virtual wxString GetAlterTableConstraintSql(Table* tab);
73 virtual wxString GetCreateDatabaseSql(const wxString& dbName);
74 virtual wxString GetDropTableSql(Table* pTab);
75 virtual wxString GetDropViewSql(View* pView);
76 virtual wxString GetDropDatabaseSql(Database* pDb);
77
78
79 virtual IDbType* GetDbTypeByUniversalName(IDbType::UNIVERSAL_TYPE type);
80 virtual void ConvertTable(Table* pTab);
81 virtual IDbType* ConvertType(IDbType* pType);
82
83
84 protected:
85 wxString m_sFileName;
86 };
87 #endif // SQLITEDBADAPTER_H