13 std::list<MSSQLDatabaseFileSpec> _filespecs;
14 std::list<std::wstring> _database_options;
15 std::wstring _database_collate;
16 std::wstring _database_purpose;
18 std::wstring _connection_string;
19 std::wstring _database_name;
23 const std::wstring
GetName()
const {
return _database_name; }
25 void SetName(
const std::wstring& value) { _database_name = value; }
27 const std::wstring
GetCollate()
const {
return _database_collate; }
29 void SetCollate(
const std::wstring& value) { _database_collate = value; }
31 const std::wstring
GetPurpose()
const {
return _database_purpose; }
33 void SetPurpose(
const std::wstring& value) { _database_purpose = value; }
35 const std::list<MSSQLDatabaseFileSpec>&
GetFileSpecs()
const {
return _filespecs; }
39 const std::list<std::wstring>&
GetOptions()
const {
return _database_options; }
41 void AddOption(
const std::wstring& value) { _database_options.push_back(value); }
std::wstring GetCreateQuery() const
Definition: MSSQLDatabase.cpp:37
void Disconnect()
disconnect from the database server
Definition: MSSQLDatabase.cpp:116
const std::list< MSSQLDatabaseFileSpec > & GetFileSpecs() const
get the database file specs
Definition: MSSQLDatabase.h:35
const AppSecInc::Databases::ODBC::ODBCConnection & GetConnection() const
Definition: MSSQLDatabase.h:44
A Microsoft SQL Server database.
Definition: MSSQLDatabase.h:10
void Drop()
drop the database
Definition: MSSQLDatabase.cpp:105
void CreateIfNotExists()
create the database if it doesn't exist
Definition: MSSQLDatabase.cpp:121
void SetCollate(const std::wstring &value)
set the database collate
Definition: MSSQLDatabase.h:29
void Connect()
connect to the database server
Definition: MSSQLDatabase.cpp:110
A generic connection info.
Definition: ConnectionInfo.h:10
std::vector< std::wstring > GetOptionQueries() const
Definition: MSSQLDatabase.cpp:25
void Load(AppSecInc::Xml::XmlDocument &xmldoc, MSXML2::IXMLDOMNodePtr root)
deserialize database from xml
Definition: MSSQLDatabase.cpp:154
A Microsoft SQL Server database file specification.
Definition: MSSQLDatabaseFileSpec.h:10
An MSXML document.
Definition: XmlDocument.h:8
void SetPurpose(const std::wstring &value)
set the database for
Definition: MSSQLDatabase.h:33
void DropIfExists()
drop the database if it exists
Definition: MSSQLDatabase.cpp:128
std::wstring GetExistsQuery() const
Definition: MSSQLDatabase.cpp:75
void AddFileSpec(const MSSQLDatabaseFileSpec &value)
add a database file spec
Definition: MSSQLDatabase.h:37
std::wstring GetDropQuery() const
Definition: MSSQLDatabase.cpp:68
A generic database.
Definition: Database.h:10
MSSQLDatabase()
constructors/destructors
Definition: MSSQLDatabase.cpp:7
const std::list< std::wstring > & GetOptions() const
get the database with options
Definition: MSSQLDatabase.h:39
AppSecInc::Databases::ODBC::ODBCConnection & GetConnection()
returns the connection object
Definition: MSSQLDatabase.h:43
MSXML2::IXMLDOMNodePtr Save(AppSecInc::Xml::XmlDocument &xmldoc, MSXML2::IXMLDOMNodePtr parent) const
serialize database to xml
Definition: MSSQLDatabase.cpp:135
void Create()
create the database, fail if exists
Definition: MSSQLDatabase.cpp:89
const std::wstring GetName() const
get the database name
Definition: MSSQLDatabase.h:23
void AddOption(const std::wstring &value)
add a database file spec
Definition: MSSQLDatabase.h:41
bool Exists()
returns true if database exists
Definition: MSSQLDatabase.cpp:98
std::wstring GetNotExistsQuery() const
Definition: MSSQLDatabase.cpp:82
An ODBC connection.
Definition: Connection.h:27
const std::wstring GetCollate() const
get the database collate
Definition: MSSQLDatabase.h:27
const std::wstring GetPurpose() const
get the database purpose, eg. ATTACH or ATTACH_REBUILD_LOG
Definition: MSSQLDatabase.h:31
void SetName(const std::wstring &value)
set the database name
Definition: MSSQLDatabase.h:25
~MSSQLDatabase()
Definition: MSSQLDatabase.cpp:21