class extractor

This is an abstract class to implement part of an extractor for a database. More...

Full nametoExtract::extractor
Definition#include <toextract.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

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:
dbDatabase this extractor works on.
operWhat kind of operation to implement. Can be one of CREATE, DESCRIBE, MIGRATE or DROP.
typeThe 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:
dbDatabase this extractor works on.
operWhat kind of operation to implement. Can be one of CREATE, DESCRIBE, MIGRATE or DROP.
typeThe 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:
extExtractor 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:
extExtractor to generate script.
streamStream to write script to.
typeType of object to recreate.
schemaSpecify 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.
ownerOwner of database object.
nameName 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:
extExtractor to generate script.
lstList of descriptions for the object. Should be appended.
typeType of object to recreate.
schemaSpecify 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.
ownerOwner of database object.
nameName 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:
extExtractor to generate script.
typeType of object to migrate.
srcSource description list.
dstDestination 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:
extExtractor to generate script.
typeType of object to recreate.
schemaSpecify 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.
ownerOwner of database object.
nameName of database object.

Returns: A string containing a script to recreate an object.