Skip to the content
Documentation

exp:ezsqlinsertschema

No ratings yet

Available before Exponential 6: the 4.x kernel had it already; the 4.x reference had no page for it.

Summary

Insert a database schema and data from a .dba file into a database (--type, --user)

Usage

./console exp:ezsqlinsertschema [options]
php bin/php/ezsqlinsertschema.php [options]

Help

The output of ./console help exp:ezsqlinsertschema (the script run with --help), without the standard options:

Usage: bin/php/ezsqlinsertschema.php [OPTION]... [FILENAME] [DATABASE]
Exponential SQL Schema insert

Insert database schema and data to specified database
ezsqlinsertschema.php --type=mysql --user=root share/db_schema.dba ezp35stable


Options:
  --type=VALUE           Which database type to use, can be one of:
                           mysql, postgresql or any other supported by extensions
  --user=VALUE           User for login to database
  --host=VALUE           Connect to host database
  --password=VALUE       Password to use when connecting to database
  --port=VALUE           Port to connect to database
  --socket=VALUE         Socket to connect to match and database (only for MySQL)
  --table-type=VALUE     The table storage type to use 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
  --insert-types=VALUE   A comma separated list of types to import (default is schema only):
                           schema - Table schema
                           data - Table data
                           all - Both table schema and data
                           none - Insert nothing (useful if you want to clean up schema only)
  --allow-multi-insert   Will create INSERT statements with multiple data entries (applies to data import only)
                           Multi-inserts will only be created for databases that support it
  --schema-file=VALUE    The schema file to use when importing data structures, is only required when importing a schema
  --clean-existing       Clean up existing schema (remove all database objects)

Options

Option Value Description
--type required  
--user required  
--host required  
--password optional  
--port required  
--socket required  
--table-type required  
--table-charset required  
--insert-types required  
--allow-multi-insert -  
--schema-file required  
--clean-existing -  

Arguments

[filename][database]

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/ezsqlinsertschema.php, kernel/private/classes/commands/ezsqlinsertschema.php

See also

Generated example: exp:ezsqlinsertschema

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.