1
0
Fork 0
Commit Graph

379 Commits

Author SHA1 Message Date
Amjith Ramanujam 5137a125f2 Update changelog. 2022-01-18 12:57:53 -08:00
Amjith Ramanujam a981564f9d
Upgrade cli_helpers to workaround the Pygments regression. (#1310) 2022-01-18 12:33:26 -08:00
Amjith Ramanujam a082b7cb72 Fix the changelog format again. 2022-01-13 13:05:58 -08:00
Amjith Ramanujam b5a523b7da Fix the changelog format 2022-01-13 12:59:07 -08:00
Amjith Ramanujam 2b2317e0b0 Update changelog. 2022-01-13 10:13:43 -08:00
Amjith Ramanujam 3bb7dd8256 Update changelog for 3.3.0 2022-01-11 08:37:27 -08:00
Saif Hakim 123e00a086
Re-run last query with bare `\watch` (#1283)
* Re-run last query with bare `\watch`

* add test

* clean up post test refactor

* lint

* rerun tests
2021-09-30 12:00:31 -07:00
Irina Truong c65495716d
Add setting in config to control truncating field values. (#1285)
* Add setting in config to truncate field value.

* Black.

* Changelog.

* Fix tests.
2021-09-03 16:58:03 -07:00
Amjith Ramanujam d10158dc72 Update changelog for 3.2.0 release. 2021-08-23 09:01:33 -07:00
Irina Truong e0a4c18c4a
Another attempt to fix pgbouncer error (1093.) (#1097)
* 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.
2021-05-21 15:32:34 -07:00
Amjith Ramanujam 1d2570f462 Include functions from search_path in completion. 2021-05-06 21:12:48 -07:00
Amjith Ramanujam 3a95530677
Merge branch 'master' into func-pr 2021-05-06 08:12:31 -07:00
Paweł Sacawa 26bdc4e759 Add missing function literals 2021-05-06 05:15:05 -04:00
Paweł Sacawa 773f69ba43 Modify changelog 2021-05-02 18:27:55 -04:00
Irina Truong 954b8c3902
Use configured pager if table format is csv. (#1260)
* Use configured pager if table format is csv.

* Changelog.

* Simplify.
2021-03-12 14:14:09 -08:00
Georgy Frolov a017fa96bf
fix IPython magic (#1253) 2021-03-12 10:16:14 -08:00
Irina Truong 469d22f2b6 Changelog. 2021-02-26 13:18:31 -08:00
Georgy Frolov c9fd72449e
skip initial comment in pg_session file (#1245)
* skip initial comment in pg_session file

* add test
2021-02-22 14:55:55 -08:00
Georgy Frolov 30212c6fc6
fixed unknown symbol REPLACE_SINGLE in prompt_toolkit < 3.0.6 (#1246)
* fixed unknown symbol REPLACE_SINGLE in prompt_toolkit < 3.0.6

* changelog
2021-02-22 14:54:23 -08:00
Irina Truong a3287c4ab2
Finer control over destructive warning. (#1242)
* Finer control over destructive warning.

* Review feedback.

* Changelog.

* Run integration tests with --warn=moderate.

* Fix typo.

* Black.
2021-02-12 21:09:38 -08:00
Eero Ruohola 87ffae295e
Fix issue where `syntax_style` config value would not have any effect (#1241)
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
2021-02-10 15:06:19 -08:00
Irina Truong 6627051819
Changelog update before release. (#1227) 2020-12-11 15:33:09 -08:00
Kevin Marsh 34d6e080ff
dependencies: add support for sqlparse 0.4.x (#1224) 2020-12-01 16:03:38 -08:00
Jan Brun Rasmussen 352ed41980
Add schema suggestion for functions (#1206)
* 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.
2020-09-08 10:02:25 -07:00
Tom Caruso 223015a1fa
More explicit error message when DSN alias is not found (#1198)
* add a specific error message when DSN with provided alias is not found

* update changelog & authors file
2020-07-31 10:25:06 -07:00
Sky.G.Uieen df1b40ca22
Update suggestion literals (#1195)
* Updated all data types literals

* Updated sql functions literals

* Updated changelog and auther

* Updated test code

* Added datatype test case
2020-07-31 10:21:58 -07:00
Tom Caruso 8f7e314508
Move from humanize to pendulum library for displaying query durations (#1199) 2020-07-28 23:08:19 -07:00
Dick Marinus 80bf05a3b3
Keep support for prompt_toolkit 2 (#1197)
* Keep support for prompt_toolkit 2

* include prompt toolkit 3
2020-07-08 12:28:24 -07:00
Sky.G.Uieen 41dd24e8da
Add custom color (#1196)
* Updated author, changelog for supporting color of string, number, keyword

* Added string, number, keyword custom color
2020-07-07 20:19:22 -07:00
Irina Truong 106c6c7bf8 Fix for #1193 list index out of range on sql comment. 2020-06-26 14:01:24 -07:00
laixintao 0c24e8bda2
Support style for missing value. (#1186)
* Support style for missing value.

* update changelog.

* upgrade minimal version of cli_helpers, in order to use style for null.
2020-05-28 15:29:50 -07:00
anthonydb 635eaaa25b Add name 2020-05-26 14:00:05 -04:00
anthonydb d492000675 Add info to changelog.rst and AUTHORS 2020-05-26 09:12:42 -04:00
Igor Kim b994c75701
Update python version from 2.7 to 3.8 in Dockerfile (#1181)
* Update python version from 2.7 to 3.8 in Dockerfile

* Update AUTHORS and changelog.rst
2020-05-11 09:51:23 -07:00
pmav99 bcb0c8bce7
Add support for using pspg as the pager. (#1173)
* 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
2020-04-23 10:17:40 -07:00
Amjith Ramanujam 3071de14f5 Update changelog for the compact output. 2020-04-18 19:08:07 -07:00
Stephano Paraskeva 936475258d
show_bottom_toolbar - Feature to Show/Hide Toolbar (#1170)
* 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
2020-04-17 22:58:13 -07:00
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
Irina Truong 63b87ba3a8
New release 3.0.0. (#1165) 2020-04-10 15:14:56 -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
赖信涛 e9874e2f96
python3.8: add travis test and setup.py class. (#1157) 2020-03-18 09:11:10 -07:00
g.denis 0f3d4602ef
Fix: Unable to drop previously connected-to database (#1152)
* close connections + added to authors + changelog

* check conn exists
2020-03-12 13:45:59 -07:00
赖信涛 bc7a5d0100
Drop Python3.5. (#1154)
* Drop Python3.5.

* delete 3.5 from setup.py

* fix black format. Using python3.7 for development now.

* black target to py36
2020-03-11 13:58:13 -07: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
lazydba247 91263c37b9
Add Support for partitioned tables. (#1145)
* partitioned tables: add support

Starting from 9.6+ relkind has new members (more info here: https://www.postgresql.org/docs/12/catalog-pg-class.html)

* Update AUTHORS

* Update changelog.rst

* foreign tables: add support

Starting from 9.6+ relkind has new members (more info here: https://www.postgresql.org/docs/12/catalog-pg-class.html)
2020-02-13 14:24:37 -08:00
赖信涛 8fe316e537 Drop Python 3.4 support (#1141)
* remove python3.4 support.

Python 3.4 has reached end-of-life.
https://www.python.org/downloads/release/python-340/

* drop maximun version of pytest

* update changelog

* add laixintao to contributors, delete py34 from tox
2020-01-15 22:45:16 -08:00
George Thomas 77a361966a Fix warning raised for using `is not` to compare string literal (#1139)
Using `is not` for comparing string literals raises warning that != should be
used.

Fixes #1138
2020-01-14 20:56:07 -08:00
Amjith Ramanujam c74bfe37ac
Merge branch 'master' into main-file 2020-01-07 06:55:17 -08:00
BrownShibaDog eb2718ba05 Add my name to changelog. 2020-01-03 08:50:34 +09:00
BrownShibaDog cc27ec3b9a Add lines to changelog.rst. 2020-01-01 21:48:32 +09:00
Jonas Jelten bc66b85730 add main file to allow python3 -m pgcli execution 2019-12-19 00:18:14 +01:00
Amjith Ramanujam 901812a7bf
Merge pull request #1122 from TheJJ/prompt-colors
support ansi escape sequences for prompt colors
2019-12-08 19:19:43 -08:00
Irina Truong 51d4d4a04c
J bennet/release 2.2.0 (#1126)
* Changelog.

* Bump pgspecial.

* Restrict prompt_toolkit to <3.0.0.
2019-12-04 09:24:17 -08:00
Jonas Jelten 36605174a4 support ansi escape sequences for prompt colors 2019-11-25 22:51:15 +01:00
Irina Truong d758781858 Changelog. 2019-10-28 09:19:59 -07:00
Irina Truong 76133a3740 Changelog. 2019-10-26 13:22:54 -07:00
Amjith Ramanujam a713b5d08b
Merge pull request #1107 from owst/function_arg_completions_with_alias
Take account of table aliases when completing function args (#1048)
2019-10-16 20:57:19 -07:00
Owen Stephens 629a931aed fixup! fixup! Handle a multi-line query on Enter key-press (fixes #1031) 2019-10-16 22:26:25 +01:00
Owen Stephens 7f44748149 Handle a multi-line query on Enter key-press (fixes #1031)
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)
2019-10-13 01:07:57 +01:00
Owen Stephens b401b16d9a Take account of table aliases when completing function args (#1048) 2019-10-12 16:19:15 +01:00
Dick Marinus 67799b98ab add optional but default squash merge request to PULL_REQUEST_TEMPLATE (#1095) 2019-09-27 19:34:34 -07:00
Irina Truong 2e6ef5a84d Changelog. 2019-09-02 12:35:49 -07: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
Pedro Ferrari 19c3e0eeb8 Add key bindings to consistently move up and down in history (#1084) 2019-07-29 13:00:33 -07:00
Sebastian Janko f85642da67 Issue 1019 stacktrace on empty query (#1078)
* 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.
2019-07-12 17:24:39 -07:00
Irina Truong 10cc4ce2b9 Partial fix for #1058. (#1068) 2019-06-09 17:05:28 +02:00
Amjith Ramanujam f27ac1c110
Merge pull request #1064 from dbcli/amjith/slash-G
Add \G as a temporary way to use expanded mode.
2019-06-03 17:12:38 -07:00
Pablo 6d6ab3dab7 Add keybinding for alt-enter to introduce a line break (#1065)
* Add keybinding for alt-enter to introduce a line break.

* Update changelog.

* Added myself to AUTHORS file

* Fixed quote issue by pre-commit
2019-06-02 19:15:16 -07:00
Amjith Ramanujam d4f4cc317d Update changelog. 2019-06-02 17:59:31 -07:00
Irina Truong a2ed5e46d1
Changelog update before release. (#1062) 2019-05-30 17:10:15 -07:00
Alexander Zawadzki df4dd00585 README.rst: tidy up redundant instructions (#1061)
* README.rst: tidy up redundant instructions 

Remove the README section which detailed how to force `psycopg2` 2.7 dependency installation from source rather than binary.

`psycopg2` 2.7 would automatically favour installation from binary. A bug affecting some users made it desirable to have the option to install from source instead. The README detailed how to do this using pip's `--no-binary` option (nice!).

`psycopg2` 2.8 has now split the binary and source dependencies into different packages with different names (source: [psycopg2 docs](http://initd.org/psycopg/docs/install.html#change-in-binary-packages-between-psycopg-2-7-and-2-8)) which makes the `--no-binary` instructions redundant. To specify source/binary you now need to explicitly specify the desired package.

As of #1060, installing `pgcli` from pip will result in the installation of `psycopg2` 2.8 from source.

* README: additional instructions for psycopg2 2.7 users

Anyone limited to psycopg2 2.7 may still encounter some known issues when installing from binary.
Add a link to the README to acknowledge this, and help those users install it from source.

* Update changelog.rst

* Update AUTHORS

* Update changelog
2019-05-30 10:03:47 -07:00
Telmo "Trooper 8c597751fd Allow psycopg2 up to 2.8.2 (#1060)
* Allow psycopg2 up to 2.8.2

This fixes the issue with pgcli not working on Arch Linux, since the package `python2-psycopg2` is already on 2.8.2.

* Added name to 'AUTHORS' and contribution to 'changelog.rst' referring to #2de6266

* Allow for newer versions of psycopg2 to be used
2019-05-29 21:14:32 -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 300febccdd Dsn parameters not always present. (#1054)
* Dsn parameters not always present.
2019-05-11 07:57:45 +02:00
Amjith Ramanujam fe1b202c55
Merge branch 'master' into pr1047 2019-05-06 11:11:47 -07:00
Amjith Ramanujam dc43430a9a Update changelog. 2019-05-06 07:29:48 -07:00
Irina Truong f1fc864281 changelog. 2019-05-04 07:33:28 -04:00
VVelox 1421da3c33
Update changelog.rst 2019-05-03 04:24:27 -05:00
zzl 6d1b653e24 lazy load keyring. (#1046)
fix issue: https://github.com/dbcli/pgcli/issues/1041
2019-05-01 08:53:55 -07:00
Irina Truong 3fd91012f2
More intelligent dsn format (#1045)
* Psycopg2 already has a method to format a dsn. We should use it. Fix for #1043.

* Changelog.

* pep8.
2019-04-28 15:06:01 -07:00
Irina Truong 9a53fe859a Possibly fix #1040. (#1042)
Fix #1040
2019-04-28 08:00:40 +02: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
Nathan Vērzemnieks 4af4e33e31 Allow escape to switch to vi navigation mode (#1039) 2019-04-13 13:22:03 -07:00
Irina Truong ab18b08903
Changelog update before release. Bump cli_helpers. (#1030) 2019-04-05 17:24:10 -07:00
Irina Truong b0529bcc4f Changelog. 2019-03-22 16:55:16 +00:00
Irina Truong 21e7c7cbc1 Changelog. 2019-03-18 03:10:52 +00:00
Amjith Ramanujam 3652134bc5
Merge branch 'master' into system-error 2019-03-16 21:18:21 -07:00
Amjith Ramanujam cbd944ffab
Merge branch 'master' into tab-on-line-start 2019-03-16 14:06:24 -07:00
Amjith Ramanujam 5d55e6822b Changelog update. 2019-03-15 20:32:23 -07:00
Irina Truong c447ffc887 Changelog. 2019-03-04 16:16:47 -08:00
Scott Brenstuhl 1c66dece59 Add reconnect automatically enhancement (#1009)
* Adding reconnect automatically enhancement

* files for pr checklist

* changelog fixes

* setting auto-reconnect to be the default

* fix issue of getting logged queries instead of most recent

* travisci pep8 check issue
2019-02-23 16:37:26 -08:00
ಠ_ಠ bd0aaefdd2 keybinding for dismissing autocompletelist (#1007)
* +added esc key to dismiss the autocomple list

* +added esc key to dismiss the autocomple list
2019-02-12 16:18:32 -08:00
Dick Marinus 351135b61e fix unhashable formatted text 2019-02-08 21:24:36 +01:00
Dick Marinus 862706ff03 Remove build dir before running sdist (#1002) 2019-01-25 12:37:17 -08: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 a88c693c49 fixup! Clean up and add behave logging (#956) 2019-01-22 19:18:39 +01: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
Marcin Cieślak ef8aac61c4 Determine hstore OID from the system view (#992)
Avoid error message on the server side if hstore
extension is not installed in the current database.

Issue: https://github.com/dbcli/pgcli/issues/991
2019-01-21 16:00:25 -08: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 b3bf7ec188
Changelog update for bugfix release. (#984) 2019-01-02 16:31:05 -08:00