1
0
Fork 0
Commit Graph

434 Commits

Author SHA1 Message Date
g.denis f3ac559844
Add pg_service.conf handling (#1155)
* add parse_service_info

* added tests

* changelog + AUTHORS

* py35
2020-04-17 14:52:19 -07:00
赖信涛 b6e2a229e5
upgrade prompt-toolit to 3.0 (#1149)
* upgrade prompt-toolit to 3.0

fix: https://github.com/dbcli/pgcli/issues/1148

related:
https://github.com/prompt-toolkit/python-prompt-toolkit/issues/886

in order to make the `behave` test pass, I have to:

- extend timeout for database connection test.
- extend timeout for basic command expect.
- extend timeout for features/steps/crud_table.py:: see data selected.
- disable cpr for features but "run the cli"

* [ci] disable CPR for all behave tests.

* bugfix: remove duplicated prompt expect.

* [ci] delete CPR env setting.

* Revert "[ci] delete CPR env setting."

This reverts commit fe4d5b565e.

* revert the extending timeout back.

* [ci] test when didn't disable CPR.

* Revert "[ci] test when didn't disable CPR."

This reverts commit d379b1e736.
2020-04-05 20:56:31 -07:00
Georgy Frolov 61c81b05f5 removed py2-related stuff 2020-03-14 10:53:43 +08:00
赖信涛 fd77549754
Deprecate Python2.7. (#1153)
* deprecate Python2.7.

So we can use latest version of prompt-toolit.
Relate: https://github.com/dbcli/pgcli/pull/1149

* black format, remove 2.7 support.

* using version py35 for black.

* Revert "black format, remove 2.7 support."

This reverts commit 4b6d0496cc.

* deprecated py27 using black.

* remove 2.7 from travis.

* update setup.py: delete python 2.7 support.
2020-03-09 20:14:51 -07:00
Martin Matějek 6b2e8df8bd
run black again 2019-10-29 17:47:18 +01:00
Amjith Ramanujam f658e3d1b4 Add a test to verify error message. 2019-10-23 21:00:45 -07:00
Owen Stephens a700f2b788 fixup! Take account of table aliases when completing function args (#1048) 2019-10-12 17:11:32 +01:00
Owen Stephens b401b16d9a Take account of table aliases when completing function args (#1048) 2019-10-12 16:19:15 +01:00
Irina Truong b2ebe0e95c
Issue 1018 display first 1k rows (#1092)
* Added changes to remove the prompt on >1000 rows queries

* Reformatted with black

* Changed comment on row_limit parameter

* Added contribution to changelog and name to AUTHORS

* Refactored test to reflect new functionality

* Removed argument

* Removed debug echo statement

* Reformatted with black

* Added changes to remove the prompt on >1000 rows queries

* Reformatted with black

* Changed comment on row_limit parameter

* Added contribution to changelog and name to AUTHORS

* Refactored test to reflect new functionality

* Removed argument

* Removed debug echo statement

* Reformatted with black

* Added missing issue numbers in changelog

* Reformatted code using black
2019-08-23 13:44:36 -07:00
Amjith Ramanujam 7da18ee794 Run black on test files. 2019-06-02 18:53:42 -07:00
Amjith Ramanujam 3a45620731 Add \G as a temporary way to use expanded mode.
This is similar to mycli.
2019-06-02 17:57:36 -07:00
Irina Truong 8cb7009bcd
black all the things. (#1049)
* added black to develop guide

* no need for pep8radius.

* changelog.

* Add pre-commit checkbox.

* Add pre-commit to dev reqs.

* Add pyproject.toml for black.

* Pre-commit config.

* Add black to travis and dev reqs.

* Install and run black in travis.

* Remove black from dev reqs.

* Lower black target version.

* Re-format with black.
2019-05-25 13:08:56 -07:00
Irina Truong d661f63eec pep8. 2019-05-21 20:28:05 -07:00
Irina Truong b4fbe28286 Fix for dsn_password behave test. 2019-05-21 20:21:58 -07:00
Amjith Ramanujam 5177c9922e Add a behave test with spaces in password. 2019-05-15 23:40:21 -07:00
Amjith Ramanujam 004f62e714 Add some behavioral tests for command line options. 2019-05-14 00:01:20 -07:00
Amjith Ramanujam 8b14029180 Fix the tests. 2019-05-06 09:12:42 -07:00
Amjith Ramanujam 1908142adb Upgrade to sqlparse 0.3.0. 2019-05-06 09:05:56 -07:00
raylu eef0e0d65c Allow application_name to be overridden (#1044)
* Allow application_name to be overridden

* Fixed broken link.

* Default password value is empty str?

* Make pep8 happier.
2019-04-27 21:25:19 -06:00
Irina Truong a8739c8c15 pep8. 2019-03-18 03:10:52 +00:00
Irina Truong 9d559cc41b Unit test. 2019-03-18 03:10:52 +00:00
Dick Marinus 351135b61e fix unhashable formatted text 2019-02-08 21:24:36 +01:00
Amjith Ramanujam 3eff3bbebd
Merge pull request #1001 from dbcli/internal/add_behave_logging
Missed logfile for earlier clean up and add behave logging changes
2019-01-22 10:46:31 -08:00
Dick Marinus 806532b496
Merge pull request #996 from saper/pexpect_exceptions
Use pexpect.TIMEOUT instead of pexpect.exceptions.TIMEOUT
2019-01-22 19:23:37 +01:00
Dick Marinus a88c693c49 fixup! Clean up and add behave logging (#956) 2019-01-22 19:18:39 +01:00
Marcin Cieślak 69118eddeb VISUAL overrides the value of EDITOR for the \e command
This is an ancient UNIX tradition universally respected.
2019-01-22 15:18:17 +00:00
Marcin Cieślak 4542637eff Use pexpect.TIMEOUT instead of pexpect.exceptions.TIMEOUT
All pexpect submodules have been moved into the pexpect package as of version 3.0.
2019-01-22 00:05:20 +00:00
Mikhail Elovskikh f614cef7ed Support multihost connection string (#978)
* Switch to psycopg2 parse_dsn instead of urlparse

* Added wronglink to contributors and updated changelog

* Fix test codestyle

* Support for PGPORT customization in tests

* Support for PGPORT customization in tests

* Refactored PGExecute init and moved short_host generation to object property

* Fix test util codestyle

* Fix local tests run

* Store PGExecute initial params in  _conn_params and added PGExecute.copy method

* Fix codestyle

* Added docstring to PGExecute.copy() method
2019-01-03 14:27:47 -08:00
Irina Truong 0cae7e2036
Remove some functions completions (#982)
Remove extension and private functions from completer.
2019-01-02 16:15:59 -08:00
Amjith Ramanujam 3b9041fe36 Fix special commands (#973)
* Add tests for special commands completion.
2018-11-27 07:49:54 -08:00
Dick Marinus 12ad10f697 Clean up and add behave logging (#956) 2018-10-14 13:53:19 -07:00
Irina Truong fcf0eb022e
Fix for pgcli --list. (#952)
Fix for pgcli --list
2018-10-02 17:10:43 -07:00
Irina Truong 392491a74d
Cherry-picked prompt-toolkit 2.0 changes. (#930)
* Cherry-picked prompt-toolkit 2.0 changes.

* Increase help timeout.

* Missed one.

* Fixes editor command.

* Expect exact to fix named query error.

* Unicode is non-optional with ptk 2.0.

* Unicode literals all the things (almost).

* PEP8.

* Change how we swap completers.

* By default, bottom toolbar styles are reversed. We don't want that.

* Adapt styles to 2.0.

* The future is now. Switch to ptk 2.0 style names.

* PEP8.

* Flag for enable_open_in_editor.

* add class:prompt to prompt

* Removed workaround for #668. Some renaming.

* use pgcli.completer instead of app.current_buffer.completer

* enable_system_prompt=True like old prompt toolkit

* keep search_ignore_case enabled (was ignore_case)

* fix closing parenthese

* keep marking class:continuation token for continuation

* capture KeyboardInterrupt manually

AbortAction has been removed in Prompt_toolkit 2.0

* replace C-J with enter, add more comments

* reversed ([...]) to [(...)] (oops)

* pep8 fixes

* Does Vi mode have to be applied to session every time?

* (workaround) also enable vi_mode after edit command

* Fixed test errors after rebasing on master.
2018-09-28 14:18:40 -07:00
Irina Truong 364ee6c33d
Merge pull request #871 from maxrothman/master
Respect \pset pager on expected behavior
2018-09-23 14:34:58 -07:00
Max Rothman 172c9cd271 Respect \pset pager on expected behavior
"\pset pager" has three possible values: "always", "on", and "off".
pgcli previously treated all non-"off" values as "always". This change
implements the expected behavior, which is to use the pager when the
output is larger than the terminal height (See \pset pager in
https://www.postgresql.org/docs/9.2/static/app-psql.html). Pgcli adds to
this by also using the pager when the output is wider than the terminal
width.

Fixes #813
2018-09-23 17:02:08 -04:00
Irina Truong 741a325953 pep8 2018-09-22 22:34:00 +00:00
Irina Truong e6e26d558f Revert abs imports in tests. 2018-09-22 22:19:25 +00:00
Irina Truong 7f2d83183e pep8 2018-09-22 04:28:13 +00:00
Irina Truong 683487a873 Attempt to fix failing tests. Add some debug info. Make imports py3-compatible. 2018-09-22 04:03:11 +00:00
Irina Truong a26b8b92a2 Pep8. 2018-06-17 14:34:20 -07:00
catherinedevlin 7812a7bad7 Remove minor whitespace changes 2018-06-16 21:47:18 -07:00
catherinedevlin 74daa23a45 switched view query to imitating psql 2018-06-16 21:47:18 -07:00
catherinedevlin 675e1dbff2 Moved code to pgexecute 2018-06-16 21:46:31 -07:00
Dick Marinus 95fda8218b Refactor destructive warning in behave tests 2018-05-26 15:49:41 +02:00
Amjith Ramanujam a274c731fc Fix typo in test fixture. 2018-05-20 21:38:43 -07:00
Dick Marinus d01b4eeb64
Merge pull request #885 from dbcli/pr884
Add confirmation prompt to destructive commands in behave tests.
2018-05-19 07:20:55 +02:00
Amjith Ramanujam 9ae9df624f
Merge branch 'master' into feature/get-last-sql-query 2018-05-18 21:48:21 -07:00
Amjith Ramanujam 3c26ddf4c3 Add confirmation prompt to destructive commands in behave tests. 2018-05-18 21:28:13 -07:00
Dan Clark 8fce953a8c ported the desctructive warning from mycli 2018-05-17 05:54:50 -04:00
Rishi Ramraj 024effd17e Style fixes for test docstrings 2018-05-15 12:24:45 -04:00