Trace effects by running statements from SQL migration script
`eugene trace` will set up a temporary postgres server for tracing, unless disabled.
Reads $PGPASS for password to postgres, if ~/.pgpass is not found.
`eugene trace` exits with failure if any problems are detected.
Usage: eugene trace [OPTIONS] [paths]...
Arguments:
[paths]...
Path to SQL migration scripts, directories, or '-' to read from stdin
Options:
-v, --var <PLACEHOLDERS>
Provide name=value for replacing ${name} with value in the SQL script
Can be used multiple times to provide more placeholders.
-i, --ignore <IGNORED_HINTS>
Ignore the hints with these IDs, use `eugene hints` to see available hints
Can be used multiple times: `-i E3 -i E4`
Or comment your SQL statement like this:
`-- eugene ignore E3, E4`
alter table foo add column bar json;
This will ignore hints E3 and E4 for this statement only.
-f, --format <FORMAT>
Output format, plain, json or markdown
[default: plain]
[possible values: json, markdown, md, plain]
-a, --accept-failures
Exit successfully even if problems are detected.
Will still fail for syntax errors in the SQL script.
--sort-mode <SORT_MODE>
Sort mode for script discovery, auto, name or none
This is used to order scripts when a path is a directory, or many paths are provided.
`auto` will sort by versions or sequence numbers.
`auto` requires all files to have the same naming scheme, either flyway-style or leading sequence numbers.
`name` will sort lexically by name.
[default: auto]
[possible values: auto, name, none]
-s, --skip-summary
Skip the summary section for markdown output
-g, --git-diff <GIT_DIFF>
Filter out discovered scripts that have not been changed since this git ref
Pass a git ref, like a commit hash, tag, or branch name.
--skip <SKIP>
Skip SQL statements matching this regex (do not execute or lint them)
For example:
eugene trace --skip '.*flyway.*' --skip '.*moreToSkip.*'
See https://docs.rs/regex/latest/regex/#syntax
--disable-temporary
Disable creation of temporary postgres server for tracing
By default, trace will create a postgres server in a temporary directory
This relies on having `initdb` and `pg_ctl` in PATH, which eugene images have.
Eugene deletes the temporary database cluster when done tracing.
-o, --postgres-options <POSTGRES_OPTIONS>
Portgres options to pass to the temporary postgres server
Example: `eugene trace -o "-c fsync=off -c log_statement=all"`
[default: ""]
--initdb <INITDB_OPTIONS>
Initdb options to pass when creating the temporary postgres server
Example: `eugene trace --initdb "--encoding=UTF8"`
Supply it more than once to add multiple options.
-U, --user <USER>
Username to use for connecting to postgres
[default: postgres]
-d, --database <DATABASE>
Database to connect to
[default: postgres]
-H, --host <HOST>
Host to connect to
[default: localhost]
-p, --port <PORT>
Port to connect to
[default: 5432]
-c, --commit
Commit at the end of the transaction.
Commit is always enabled for the temporary server, otherwise rollback is default.
-e, --extra
Show locks that are normally not in conflict with application code
-h, --help
Print help (see a summary with '-h')