DbDumpCommand
class DbDumpCommand extends DbCommandBase (View source)
Provides a command to dump the current database to a script.
This script exports all tables in the given database, and all data (except for tables denoted as schema-only). The resulting script creates the tables and populates them with the exported data.
Properties
| protected array | $excludeTables | An array of table patterns to exclude completely. |
Methods
{@inheritdoc}
Parse input options decide on a database.
{@inheritdoc}
Adds primary key, unique keys, and index information to the schema.
Set the table collation.
Given a database field type, return a Drupal type.
Given a database field type, return a Drupal size.
The script template.
The part of the script for each table.
Details
protected
configure()
{@inheritdoc}
protected Connection
getDatabaseConnection(InputInterface $input)
Parse input options decide on a database.
protected int
execute(InputInterface $input, OutputInterface $output)
{@inheritdoc}
protected string
generateScript(Connection $connection, array $schema_only = [])
Generates the database script.
protected array
getTables(Connection $connection)
Returns a list of tables, not including those set to be excluded.
protected array
getTableSchema(Connection $connection, string $table)
Returns a schema array for a given table.
protected
getTableIndexes(Connection $connection, string $table, array $definition)
Adds primary key, unique keys, and index information to the schema.
protected
getTableCollation(Connection $connection, string $table, array $definition)
Set the table collation.
protected array
getTableData(Connection $connection, string $table)
Gets all data from a given table.
If a table is set to be schema only, and empty array is returned.
protected string
fieldTypeMap(Connection $connection, string $type)
Given a database field type, return a Drupal type.
protected string|null
fieldSizeMap(Connection $connection, string $type)
Given a database field type, return a Drupal size.
protected string
getFieldOrder(Connection $connection, string $table)
Gets field ordering for a given table.
protected string
getTemplate()
The script template.
protected string
getTableScript(string $table, array $schema, array $data)
The part of the script for each table.