Usage: skeema init [<options>] [<environment>]
Creates a filesystem representation of the schemas on a DB instance. For each schema on the instance (or just the single schema specified by schema), a subdir with a .skeema config file will be created. Each directory will be populated with .sql files containing CREATE statements for every table and routine in the schema.
You may optionally pass an environment name as a CLI arg. This will affect which section of .skeema config files the host-related options are written to. For example, running skeema init staging
will add config directives to the [staging] section of config files. If no environment name is supplied, the default is “production”, so directives will be written to the [production] section of the file.
Init Options
Option | Description |
---|---|
dir | Subdir name to use for this host’s schemas |
host | Database hostname or IP address |
include-auto-inc | Include starting auto-inc values in table files |
port | Port to use for database host |
schema | Only import the one specified schema; skip creation of subdirs for each schema |
socket | Absolute path to Unix socket file used if host is localhost |
strip-partitioning | Omit PARTITION BY clause when writing partitioned tables to filesystem |
Global Options
Option | Description |
---|---|
connect-options | Comma-separated session options to set upon connecting to each database instance |
debug | Enable debug logging |
help | Display usage information for the specified command |
host-wrapper | External bin to shell out to for host lookup; see manual for template vars |
ignore-schema | Ignore schemas that match regex |
ignore-table | Ignore tables that match regex |
my-cnf | Parse ~/.my.cnf for configuration (enabled by default) |
password | Password for database user; omit value to prompt from TTY (default no password) |
user | Username to connect to database host |
version | Display program version |