DbUpdate Class Reference
[Public API]
DbUpdate use DbUpdateScriptsParser interface to get collection of SQL statements for database schema update.
More...
#include <dbupdate.h>
Collaboration diagram for DbUpdate:
[legend]List of all members.
Detailed Description
DbUpdate use DbUpdateScriptsParser interface to get collection of SQL statements for database schema update.
This interface allows progress bar implementation for derived classes.
This interface requires SQL table db_version to exists in database with following schema: CREATE TABLE db_version (
version VARCHAR(128)
);
Constructor & Destructor Documentation
|
|
Constructor.
- Parameters:
-
| pArchive | already open SQL database where update will be performed |
| pFileParser | parser capable of reading update scripts |
|
Member Function Documentation
| virtual int onSendUpdate |
( |
SQLOStream & |
pOStream, |
|
|
std::string & |
pQuery |
|
) |
[protected, virtual] |
|
|
|
Send single query to database.
- Warning:
- all BEGIN (TRANSACTION) and COMMIT statements are removed
all CREATE DATABASE statements are querying outside transaction
- Parameters:
-
| pOStream | stream used to send query |
| pQuery | query contents |
- Returns:
- number of updated records
|
| void update |
( |
const std::string & |
pVersion = "" |
) |
|
|
|
|
Update database.
This is done by reading query list by passed DbUpdateScruptParser and calling onSendUpdate for every read query. After update new version string is set in database - Parameters:
-
| pVersion | target version for update. If empty, then update will call all available scripts from sets. |
|
The documentation for this class was generated from the following file:
|
|
|