ExportSql
class ExportSql extends ExportPlugin (View source)
Handles the export for the SQL class
Properties
protected ExportPluginProperties | $properties | Object containing the specific export plugin type properties. |
from ExportPlugin |
static ExportType | $exportType | from ExportPlugin | |
static bool | $singleTable | from ExportPlugin | |
protected StructureOrData | $structureOrData | from ExportPlugin | |
string|null | $sqlAutoIncrements | ||
string|null | $sqlIndexes | ||
string|null | $sqlConstraints | ||
string | $sqlConstraintsQuery |
Methods
Outputs export header. It is the first method to be called, so all the required variables are initialized here.
Outputs export footer
Outputs database header
Outputs database footer
Outputs CREATE DATABASE statement
Outputs the content of a table in SQL format
Exports routines (procedures and functions)
Exports events
Outputs a raw query
Outputs table's structure
Exports metadata from Configuration Storage
Returns a stand-in CREATE definition to resolve view dependencies
Gets the export specific format plugin properties
Sets the export plugins properties and is implemented by each export plugin.
Initialize aliases
Search for alias of a identifier.
Gives the relation string and also substitutes with alias if required in this format: [Foreign Table] ([Foreign Field])
No description
No description
No description
Generates SQL for routines export
Returns $table's CREATE definition
replaces db/table/column names with their aliases
Generate comment
Details
final
__construct(Relation $relation, Export $export, Transformations $transformations)
No description
bool
exportHeader()
Outputs export header. It is the first method to be called, so all the required variables are initialized here.
bool
exportFooter()
Outputs export footer
bool
exportDBHeader(string $db, string $dbAlias = '')
Outputs database header
bool
exportDBFooter(string $db)
Outputs database footer
bool
exportDBCreate(string $db, string $dbAlias = '')
Outputs CREATE DATABASE statement
bool
exportData(string $db, string $table, string $sqlQuery, array $aliases = [])
Outputs the content of a table in SQL format
bool
exportRoutines(string $db, array $aliases = [])
Exports routines (procedures and functions)
bool
exportEvents(string $db)
Exports events
bool
exportRawQuery(string|null $db, string $sqlQuery)
Outputs a raw query
bool
exportStructure(string $db, string $table, string $exportMode, array $aliases = [])
Outputs table's structure
bool
exportMetadata(string $db, string|array $tables, array $metadataTypes)
Exports metadata from Configuration Storage
string
getTableDefStandIn(string $db, string $view, array $aliases = [])
Returns a stand-in CREATE definition to resolve view dependencies
protected void
init()
Plugin specific initializations.
PluginPropertyItem
getProperties()
Gets the export specific format plugin properties
protected ExportPluginProperties
setProperties()
Sets the export plugins properties and is implemented by each export plugin.
void
initAlias(array $aliases, string $db, string|null $table = null)
Initialize aliases
string
getAlias(array $aliases, string $id, string $type = 'dbtblcol', string $db = '', string $tbl = '')
Search for alias of a identifier.
string
getRelationString(array $foreigners, string $fieldName, string $db, array $aliases = [])
Gives the relation string and also substitutes with alias if required in this format: [Foreign Table] ([Foreign Field])
static bool
isAvailable()
No description
void
setExportOptions(ServerRequest $request, array $exportConfig)
No description
StructureOrData
getStructureOrData()
No description
protected StructureOrData
setStructureOrData(mixed $valueFromRequest, mixed $valueFromConfig, StructureOrData $defaultValue)
No description
string
getName()
No description
void
useSqlBackquotes(bool $useSqlBackquotes)
No description
protected string
exportRoutineSQL(string $db, array $aliases, string $type, string $name, array $routines, string $delimiter)
Generates SQL for routines export
string
getTableDef(string $db, string $table, bool $addSemicolon = true, bool $view = false, bool $updateIndexesIncrements = true, array $aliases = [])
Returns $table's CREATE definition
string
replaceWithAliases(string|null $delimiter, string $sqlQuery, array $aliases, string $db, bool|null $flag = null)
replaces db/table/column names with their aliases
protected string
generateComment(string|null $sqlStatement, string $comment1, string $comment2, string $tableAlias, string $compat)
Generate comment