#include <sqlimport.h>
|
virtual QString | advance () |
|
void | fillSource (const QString &word) |
|
bool | parseCreateTable (QString &token) |
|
bool | parseAlterTable (QString &token) |
|
QString | parseIdentifier (QString &token) |
|
QString | parseDefaultExpression (QString &token) |
|
QStringList | parseFieldType (QString &token) |
|
QStringList | parseIdentifierList (QString &token) |
|
ColumnConstraints | parseColumnConstraints (QString &token) |
|
TableConstraints | parseTableConstraints (QString &token) |
|
bool | parseCreateDefinition (QString &token, UMLEntity *entity) |
|
UMLObject * | addDatatype (const QStringList &type) |
|
bool | addPrimaryKey (UMLEntity *entity, const QString &name, const QStringList &fields) |
|
bool | addUniqueConstraint (UMLEntity *entity, const QString &name, const QStringList &fields) |
|
bool | addForeignConstraint (UMLEntity *entityA, const QString &name, const QStringList &fieldNames, const QString &referencedTable, const QStringList &referencedFields) |
|
void | initialize () |
|
void | setMultiLineComment (const QString &intro, const QString &end) |
|
void | setMultiLineAltComment (const QString &intro, const QString &end) |
|
virtual bool | parseFile (const QString &filename) |
|
virtual void | initVars () |
|
void | scan (const QString &line) |
|
virtual bool | preprocess (QString &line) |
|
virtual QStringList | split (const QString &line) |
|
void | skipStmt (const QString &until=QLatin1String(";")) |
|
bool | skipToClosing (QChar opener) |
|
QString | current () |
|
QString | lookAhead () |
|
void | pushScope (UMLPackage *p) |
|
UMLPackage * | popScope () |
|
UMLPackage * | currentScope () |
|
int | scopeIndex () |
|
virtual void | initPerFile () |
|
void | log (const QString &file, const QString &text) |
|
void | log (const QString &text) |
|
◆ SQLImport()
Constructor.
- Parameters
-
thread | thread in which the code import runs |
◆ ~SQLImport()
SQLImport::~SQLImport |
( |
| ) |
|
|
virtual |
◆ addDatatype()
UMLObject * SQLImport::addDatatype |
( |
const QStringList & |
type | ) |
|
|
protected |
◆ addForeignConstraint()
bool SQLImport::addForeignConstraint |
( |
UMLEntity * |
entityA, |
|
|
const QString & |
_name, |
|
|
const QStringList & |
fieldNames, |
|
|
const QString & |
referencedTable, |
|
|
const QStringList & |
referencedFields |
|
) |
| |
|
protected |
Add UML object foreign constraint.
- Parameters
-
entityA | entity object the foreign constraint belongs |
_name | name of foreign constraint |
fieldNames | list of field names |
referencedTable | referenced table name |
referencedFields | list of referenced field names |
- Returns
- true on success
-
false on error
◆ addPrimaryKey()
bool SQLImport::addPrimaryKey |
( |
UMLEntity * |
entity, |
|
|
const QString & |
name, |
|
|
const QStringList & |
fields |
|
) |
| |
|
protected |
◆ addUniqueConstraint()
bool SQLImport::addUniqueConstraint |
( |
UMLEntity * |
entity, |
|
|
const QString & |
_name, |
|
|
const QStringList & |
fields |
|
) |
| |
|
protected |
Add UML object for unique constraint.
- Parameters
-
entity | entity object |
_name | unique constraint name |
fields | field list |
- Returns
- true on success
-
false on error
◆ advance()
QString SQLImport::advance |
( |
| ) |
|
|
protectedvirtual |
Implement virtual method
- Returns
- string with next token
Reimplemented from NativeImportBase.
◆ fillSource()
void SQLImport::fillSource |
( |
const QString & |
word | ) |
|
|
protectedvirtual |
◆ parseAlterTable()
bool SQLImport::parseAlterTable |
( |
QString & |
token | ) |
|
|
protected |
Parse alter table statement.
- Parameters
-
token | string with current token |
- Returns
- true on success
-
false on error
◆ parseColumnConstraints()
Parse column constraint.
pgsql: [ CONSTRAINT constraint_name ] { NOT NULL | NULL | CHECK ( expression ) | COLLATE collation | DEFAULT default_expr | UNIQUE index_parameters | PRIMARY KEY index_parameters | REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
mysql: [ PRIMARY KEY index_parameters | KEY key_name ( fields ) CHARACTER SET charset_name | COLLATE collation ]
- Parameters
-
token | string with current token |
- Returns
- column constraints
◆ parseCreateDefinition()
bool SQLImport::parseCreateDefinition |
( |
QString & |
token, |
|
|
UMLEntity * |
entity |
|
) |
| |
|
protected |
Parse table create definition.
- Parameters
-
token | string with current token |
entity | entity to save the definition into |
- Returns
- true on success
-
false on error
◆ parseCreateTable()
bool SQLImport::parseCreateTable |
( |
QString & |
token | ) |
|
|
protected |
Parse create table statement.
- Parameters
-
token | string with current token |
- Returns
- true on success
-
false on error
◆ parseDefaultExpression()
QString SQLImport::parseDefaultExpression |
( |
QString & |
token | ) |
|
|
protected |
Parse default expression.
The expression could be in the form (expression)::<type> function(expression)
- Parameters
-
token | string with current token |
- Returns
- string with default expression
◆ parseFieldType()
QStringList SQLImport::parseFieldType |
( |
QString & |
token | ) |
|
|
protected |
Parse field type.
- Parameters
-
token | string with current token |
- Returns
- string list containing field type (index 0), size/count (index 1) and optional values (index > 2)
◆ parseIdentifier()
QString SQLImport::parseIdentifier |
( |
QString & |
token | ) |
|
|
protected |
Parse identifier.
- Parameters
-
token | string with current token |
- Returns
- parsed identifier
◆ parseIdentifierList()
QStringList SQLImport::parseIdentifierList |
( |
QString & |
token | ) |
|
|
protected |
Parse identifier list.
- Parameters
-
token | string with current token |
- Returns
- string list with identifiers
◆ parseStmt()
bool SQLImport::parseStmt |
( |
| ) |
|
|
virtual |
◆ parseTableConstraints()
Parse table constraint.
pgsql:
[ CONSTRAINT constraint_name ] { CHECK ( expression ) | UNIQUE ( column_name [, ... ] ) index_parameters | PRIMARY KEY ( column_name [, ... ] ) index_parameters | EXCLUDE [ USING index_method ] ( exclude_element WITH operator [, ... ] ) index_parameters [ WHERE ( predicate ) ] | FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] } [ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
mysql: PRIMARY KEY (`uid`, `pid`) | KEY `t3ver_oid` (`t3ver_oid`,`t3ver_wsid`) UNIQUE KEY `entry_identifier` (`entry_namespace`,`entry_key`)
- Parameters
-
token | string with current token |
- Returns
- table constraints
The documentation for this class was generated from the following files: