Command Line Interface¶
felis¶
Felis command line tools
felis [OPTIONS] COMMAND [ARGS]...
Options
- --version¶
 Show the version and exit.
- --log-level <log_level>¶
 Felis log level
- Options:
 CRITICAL | FATAL | ERROR | WARNING | INFO | DEBUG
- --log-file <log_file>¶
 Felis log file path
- --id-generation, --no-id-generation¶
 Generate IDs for all objects that do not have them
Environment variables
- FELIS_LOGLEVEL
 Provide a default for
--log-level
- FELIS_LOGFILE
 Provide a default for
--log-file
create¶
Create database objects from the Felis file
felis create [OPTIONS] FILE
Options
- --engine-url <engine_url>¶
 SQLAlchemy Engine URL
- --schema-name <schema_name>¶
 Alternate schema name to override Felis file
- --initialize¶
 Create the schema in the database if it does not exist (error if already exists)
- --drop¶
 Drop schema if it already exists in the database (implies –initialize)
- --echo¶
 Echo database commands as they are executed
- --dry-run¶
 Dry run only to print out commands instead of executing
- -o, --output-file <output_file>¶
 Write SQL commands to a file instead of executing
- --ignore-constraints¶
 Ignore constraints when creating tables
Arguments
- FILE¶
 Required argument
Environment variables
- FELIS_ENGINE_URL
 Provide a default for
--engine-url
diff¶
Compare two schemas or a schema and a database for changes
Examples:
felis diff schema1.yaml schema2.yaml
felis diff -c alembic schema1.yaml schema2.yaml
felis diff –engine-url sqlite:///test.db schema.yaml
felis diff [OPTIONS] [FILES]...
Options
- --engine-url <engine_url>¶
 SQLAlchemy Engine URL
- -c, --comparator <comparator>¶
 Comparator to use for schema comparison
- Options:
 alembic | deepdiff
- -E, --error-on-change¶
 Exit with error code if schemas are different
Arguments
- FILES¶
 Optional argument(s)
Environment variables
- FELIS_ENGINE_URL
 Provide a default for
--engine-url
dump¶
Dump a schema file to YAML or JSON format
Example:
felis dump schema.yaml schema.json
felis dump schema.yaml schema_dump.yaml
felis dump [OPTIONS] FILES...
Options
- --strip-ids, --no-strip-ids¶
 Strip IDs from the output schema
Arguments
- FILES¶
 Required argument(s)
init-tap-schema¶
Initialize a standard TAP_SCHEMA database
felis init-tap-schema [OPTIONS]
Options
- --engine-url <engine_url>¶
 Required SQLAlchemy Engine URL
- --tap-schema-name <tap_schema_name>¶
 Name of the TAP_SCHEMA schema in the database
- --tap-tables-postfix <tap_tables_postfix>¶
 Postfix which is applied to standard TAP_SCHEMA table names
- --insert-metadata, --no-insert-metadata¶
 Insert metadata describing TAP_SCHEMA itself
Environment variables
- FELIS_ENGINE_URL
 Provide a default for
--engine-url
load-tap-schema¶
Load metadata from a Felis file into a TAP_SCHEMA database
felis load-tap-schema [OPTIONS] FILE
Options
- --engine-url <engine_url>¶
 SQLAlchemy Engine URL
- -n, --tap-schema-name <tap_schema_name>¶
 Name of the TAP_SCHEMA schema in the database (default: TAP_SCHEMA)
- -p, --tap-tables-postfix <tap_tables_postfix>¶
 Postfix which is applied to standard TAP_SCHEMA table names
- -i, --tap-schema-index <tap_schema_index>¶
 TAP_SCHEMA index of the schema in this environment
- -D, --dry-run¶
 Execute dry run only. Does not insert any data.
- -e, --echo¶
 Print out the generated insert statements to stdout
- -o, --output-file <output_file>¶
 Write SQL commands to a file
- --force-unbounded-arraysize¶
 Use unbounded arraysize by default for all variable length string columns, e.g.,
votable:arraysize: *(workaround for astropy bug #18099)
- -u, --unique-keys¶
 Generate unique key_id values for keys and key_columns tables by prepending the schema name
Arguments
- FILE¶
 Required argument
Environment variables
- FELIS_ENGINE_URL
 Provide a default for
--engine-url
validate¶
Validate one or more Felis YAML files
felis validate [OPTIONS] [FILES]...
Options
- --check-description¶
 Check that all objects have a description
- --check-redundant-datatypes¶
 Check for redundant datatype overrides
- --check-tap-table-indexes¶
 Check that every table has a unique TAP table index
- --check-tap-principal¶
 Check that at least one column per table is flagged as TAP principal
Arguments
- FILES¶
 Optional argument(s)