* Another attempt to fix pgbouncer error (1093.)
* Fixes for various pgbouncer problems.
* different approach with custom cursor.
* Fix rebase.
* Missed this.
* Fix completion refresher test.
* Black.
* Unused import.
* Changelog.
* Fix race condition in test.
* Switch from is_pgbouncer to more generic is_virtual_database, and duck-type it. Add very dumb unit test for virtual cursor.
* Remove debugger code.
The format_output chooses to output as a table or in the expanded
format on the basis of the length of the first line of the table
formatter (`len`). However, this first line contains a lot of ANSI
excape codes, so this comparison is wrong, and the expanded mode
is used either way. This patch strips these escape codes before the
comparison.
1. `class A(object)` can be written as `class A:`
2. replace `dict([…])` and `set([…])` with `{…}`
3. use f-strings or compact `.format`
4. use `yield from` instead of `yield` in a `for` loop
5. import `mock` from `unittest`
6. expect `OSError` instead of `IOError` or `select` error
7. use Python3 defaults for file reading or `super()`
8. remove redundant parenthesis (keep those in tuples though)
9. shorten set intersection instead of creating lists
10. backslashes in strings do not have to be escaped if prepended with `r`
These config properties got introduced in 41dd24e8 as a means to have
more granular control over the syntax highlighting. The problem is that
these cannot be in the default config file since `get_config()` always
reads both the default config file and the user specified one, and there
is no way to unset these variables in the user specified config file to
restore their default behavior. Even if there would be a way, it
wouldn't be intuitive at all to be required to unset some random
settings under the `[colors]` section just to be able to use the well
documented `syntax_style` setting.
Note that one *can* still set these three lines in their user config
file if they want to utilize them.
Resolves#1212
* Add schema suggestion for functions
- Update sqlcompletion.py
- Update metadata files
* Move autocomletion for function under condition
- Make sure suggestion are only added under drop, alter etc.
InputMode.REPLACE_SINGLE was added to prompt-toolkit.
This fixes Exception <InputMode.REPLACE_SINGLE: 'vi-replace-single'>
in single-char replace mode when using prompt_toolkit>=3.0.6.
* Stop printing "status" when table_format is "csv"
* Use the "unix" dialect on *nix for CSV output.
* Use a pager when `pspg` has been configured with CSV "table_format".
Fix#1102
* adds ternary to decide whether bottom_toolbar is shown based on config value
* runs black format
* adds name to authors
* modifies changelog.rst
* removes change in changelog.rst
* formats config
* removes unused variable, adds change to changelog
* changes default back to true
* removed reference to var
* 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.
Escape then enter intended as two separate key presses is a very common
sequence when using vi mode - returning to normal mode from insert mode
(escape) and then submitting the query (enter). The presence of the
escape-enter key binding overrides this behaviour by inserting
undesirable newlines (newline is be easily inserted when in insert mode
by pressing enter) or by introducing a noticable delay/lag before enter
can be pressed after escape, due to prompt toolkit not being able to
recognise escape immediately (since it may form part of an escape-enter
sequence).
Use a (conditional) Enter key-binding to force-handle a multi-line
buffer, rather than doing so by (conditionally) disabling the multiline
mode of prompt_toolkit.
This has the benefit of being more efficient (the multiline Condition
filter is called very often, which (due to the repeated query parsing)
causes editing to become slow with a large buffer that ends in a
semicolon), clearer in intent (we want to force-handle the query, rather
than (temporarily) disable multiline mode which indirectly forces the
buffer to be handled) and avoids a bug in multi-line history search
(issue #1031)
* 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
* Added changes to skip empty queries
Empty queries consist of one or more semicolons
* Reformatted with black
* Added contribution to changelog and name to AUTHORS
* Black.
* 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.