mirror of
https://github.com/dbcli/pgcli.git
synced 2024-10-04 01:08:51 +03:00
97a1fd6c16
* fix psycopg.sql.Identifier in \ev handling (#1384) * Allow defining a json file with preferred aliases At $WORK we have a lot of tables with names like `foo_noun_verb` or `foo_noun_related-noun_verb` and so while the default aliasing is very helpful for shortening unwieldy names we do end up with lots of aliases like `LEFT JOIN fnv on fnv2.id = fnv.fnv2_id` This change will allow defining a json file of preferred aliases ``` > cat ~/.config/pgcli/aliases.json { "foo_user": "user", "foo_user_group": "user_group" } ``` so the alias suggestion for `SELECT * FROM foo_user` will be `SELECT * FROM foo_user AS user` instead of the default `SELECT * FROM foo_user AS fu` * When cannot open or parse alias_map_file raise error Raise a (hopefully) helpful exception when the alias_map_file cannot be parsed or does not exist * Add tests for load_alias_map_file * Add tests for generate_alias * Update AUTHORS file * Remove comment. Discussed this on the PR with a project maintainer --------- Co-authored-by: Andy Schoenberger <akschoenberger@gmail.com> Co-authored-by: Rob B <rob@example.com> Co-authored-by: Irina Truong <i.chernyavska@gmail.com> |
||
---|---|---|
.. | ||
features | ||
formatter | ||
parseutils | ||
conftest.py | ||
metadata.py | ||
pytest.ini | ||
test_auth.py | ||
test_completion_refresher.py | ||
test_config.py | ||
test_fuzzy_completion.py | ||
test_main.py | ||
test_naive_completion.py | ||
test_pgcompleter.py | ||
test_pgexecute.py | ||
test_pgspecial.py | ||
test_prioritization.py | ||
test_prompt_utils.py | ||
test_rowlimit.py | ||
test_smart_completion_multiple_schemata.py | ||
test_smart_completion_public_schema_only.py | ||
test_sqlcompletion.py | ||
test_ssh_tunnel.py | ||
utils.py |