|
|
This is an abstract class to implement part of an extractor for a database. Observe that an extractor must be stateless and threadsafe except for constructors and destructors. Use the toExtract::context function for saving context.
void registerExtract (const QString &db,
const QString &oper,
const QString &type)
| registerExtract |
[protected]
Register an operation to be handled by this extractor.
Parameters:
db | Database this extractor works on. |
oper | What kind of operation to implement. Can be one of CREATE, DESCRIBE, MIGRATE or DROP. |
type | The type of object that this is implemented for. Database specific. |
void unregisterExtract (const QString &db,
const QString &oper,
const QString &type)
| unregisterExtract |
[protected]
Unregister an operation to be handled by this extractor.
Parameters:
db | Database this extractor works on. |
oper | What kind of operation to implement. Can be one of CREATE, DESCRIBE, MIGRATE or DROP. |
type | The type of object that this is implemented for. Database specific. |
extractor ()
| extractor |
Create an extractor. Normally called from a statical instantiator. Should register objects it can handle registerExtract. Apart from the objects it handles one extractor per database can also register an empty operation and type parameter to registerExtract which will be called to initialize an extractor once per constructed toExtract object. operation.
~extractor ()
| ~extractor |
[virtual]
Destructor.
void initialize (toExtract &ext)
| initialize |
[const virtual]
Initiate an extractor for a given connection. Can be used to set up states necessary for further processing. Should probably set blocksize to be used for resizing (toExtract::setBlocksize).
Parameters:
ext | Extractor to generate script. |
void create (toExtract &ext,
QTextStream &stream,
const QString &type,
const QString &schema,
const QString &owner,
const QString &name)
| create |
[const virtual]
Called to generate a script to recreate a database object.
Parameters:
ext | Extractor to generate script. |
stream | Stream to write script to. |
type | Type of object to recreate. |
schema | Specify the schema of the output script or description. If empty don't specify any object. If the string "1" use same object as input. Otherwise use the specified schema. |
owner | Owner of database object. |
name | Name of database object. |
Returns: A string containing a script to recreate an object.
void describe (toExtract &ext,
std::list<QString> &lst,
const QString &type,
const QString &schema,
const QString &owner,
const QString &name)
| describe |
[const virtual]
Called to describe a database object.
Parameters:
ext | Extractor to generate script. |
lst | List of descriptions for the object. Should be appended. |
type | Type of object to recreate. |
schema | Specify the schema of the output script or description. If empty don't specify any object. If the string "1" use same object as input. Otherwise use the specified schema. |
owner | Owner of database object. |
name | Name of database object. |
void migrate (toExtract &ext,
QTextStream &stream,
const QString &type,
std::list<QString> &src,
std::list<QString> &dst)
| migrate |
[const virtual]
Called to generate a script to migrate a database object from one description to another description.
Parameters:
ext | Extractor to generate script. |
type | Type of object to migrate. |
src | Source description list. |
dst | Destination description list. |
Returns: A script to change the src database object to dst.
void drop (toExtract &ext,
QTextStream &stream,
const QString &type,
const QString &schema,
const QString &owner,
const QString &name)
| drop |
[const virtual]
Called to generate a script to drop an object.
Parameters:
ext | Extractor to generate script. |
type | Type of object to recreate. |
schema | Specify the schema of the output script or description. If empty don't specify any object. If the string "1" use same object as input. Otherwise use the specified schema. |
owner | Owner of database object. |
name | Name of database object. |
Returns: A string containing a script to recreate an object.