exp:ezsqldumpschema
Available before Exponential 6: the 4.x kernel had it already; the 4.x reference had no page for it.
Summary
Dump the database schema to a file or standard output (--type, --user)
Usage
./console exp:ezsqldumpschema [options] php bin/php/ezsqldumpschema.php [options]
Help
The output of ./console help exp:ezsqldumpschema (the script run with --help), without the standard options:
Usage: bin/php/ezsqldumpschema.php [OPTION]... [DATABASE] [FILENAME]
Exponential SQL Schema dump
Dump sql schema to specified file or standard output
ezsqldumpschema.php --type=mysql --user=root stable33 schema.sql
Options:
--type=VALUE Which database type to use for source, can be one of:
mysql, postgresql, oracle
--user=VALUE User for login to source database
--host=VALUE Connect to host source database
--password=VALUE Password to use when connecting to source database
--port=VALUE Port to connect to source database
--socket=VALUE Socket to connect to match and source database (only for MySQL)
--output-array Create file with array structures (Human readable)
--output-serialized Create file with serialized data (Saves space)
--output-sql Create file with SQL data (DB friendly)
--diff-friendly Will make the output friendlier towards the diff command (applies to SQL output only)
--meta-data Will include extra meta-data information specific to the database.
--table-type=VALUE The table storage type to use for SQL output when creating tables.
MySQL: bdb, innodb and myisam
PostgreSQL:
Oracle:
--table-charset=VALUE Defines the charset to use on tables, the names of the charset depends on database type
--compatible-sql Will turn SQL to be more compatible to existing dumps
--no-sort Do not sort table columns in the dumped data structure
--format=VALUE The output format (default is generic)
generic - Format which suits all databases
local - Format which suits only the database it was dumped from.
--output-types=VALUE A comma separated list of types to include in dump (default is schema only):
schema - Table schema
data - Table data
all - Both table schema and data
--allow-multi-insert Will create INSERT statements with multiple data entries (applies to data output only)
Multi-inserts will only be created for databases that support it
--schema-file=VALUE The schema file to use when dumping data structures, is only required when dumping from filesOptions
| Option | Value | Description |
|---|---|---|
| --type | required | |
| --user | required | |
| --host | required | |
| --password | optional | |
| --port | required | |
| --socket | required | |
| --output-array | - | |
| --output-serialized | - | |
| --output-sql | - | |
| --diff-friendly | - | |
| --meta-data | - | |
| --table-type | required | |
| --table-charset | required | |
| --compatible-sql | - | |
| --no-sort | - | |
| --format | required | |
| --output-types | required | |
| --allow-multi-insert | - | |
| --schema-file | required |
Arguments
[database][filename]
Standard options
Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.
Source
bin/php/ezsqldumpschema.php, kernel/private/classes/commands/ezsqldumpschema.php
See also
Generated example: exp:ezsqldumpschema
Added to the reference for Exponential 6.0.15.
Contributors
- Graham Brookins Updated
Comments
Add a comment