1
0
Fork 0
Commit Graph

198 Commits

Author SHA1 Message Date
Damien Baty d8eb8b5b82 Apply black (version 23.1.0) 2023-03-18 14:00:38 +01:00
Irina Truong 87d9b2da77 Fix connecting with dsn. 2023-01-02 14:10:29 -08:00
Andy Schoenberger 2db54f14aa
fix psycopg.sql.Identifier in \ev handling (#1384) 2022-11-21 16:10:13 -08:00
ERYoung11 2850c83310 black'd the code. 2022-08-31 21:48:06 -05:00
ERYoung11 f7b1621e34 fixed comments with special see Issue #1362 2022-08-31 21:41:11 -05:00
Kian-Meng Ang d608ffe7c7
Fix typos (#1345)
Co-authored-by: Irina Truong <i.chernyavska@gmail.com>
2022-06-08 11:38:29 -07:00
Irina Truong 18071754bc
Port to psycopg3 (#1324)
* WIP.

* Add some comments about porting from psycopg 2 to 3 (#1318)

* WIP

* Disable _set_wait_callback()

* TransactionStatus.

* First working query.

* More pg3 changes.

* test_pgexecute still fails.

* Fix bytea support.

* Fix json and enum unicode.

* Get unit tests to pass.

* Behave tests still break, WIP.

* Prompt seems to be displayed fine, why don't the tests see the whitespace?

* Python version.

* Fix test.

* Black.

* Added black to dev reqs.

* nbu link for donations.

* Use psycopg.sql to format statement.

* Special case for show help in pgbouncer.

* Fix test.

* Added integration test.

* Install pgbouncer in ci.

* Fix integration test.

* Remove tmate session.

* Revert commenting out python versions.

* Pin pgspecial to >=2.

* Changelog.

Co-authored-by: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Co-authored-by: Amjith Ramanujam <amjith.r@gmail.com>
2022-06-06 11:20:48 -07:00
Daniel Kukula 372da81ec4
add explain visualizer (#1279)
* add explain visualizer

* format files

* remove humanize dependency

* disable by default

* add explain visualizer

* run black
2022-04-03 19:20:02 -07:00
Daniele Varrazzo 25eb9f541b
Add some comments about porting from psycopg 2 to 3 (#1318) 2022-02-22 09:02:16 -08:00
Edoardo Ceccarelli 5811515a96
no need to strip_comments (#1296) 2021-11-18 11:58:38 -08: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
Miroslav Šedivý 762fb4b8da
Modernize code to Python 3.6+ (#1229)
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`
2021-02-12 21:34:56 +02:00
laixintao 13bd678ccd
format code using black. 2020-09-14 10:27:46 +08:00
Irina Truong 106c6c7bf8 Fix for #1193 list index out of range on sql comment. 2020-06-26 14:01:24 -07:00
Georgy Frolov 61c81b05f5 removed py2-related stuff 2020-03-14 10:53:43 +08: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
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
Amjith Ramanujam 43e79d0027 Use libpq version instead of psycopg2 version. 2019-10-26 19:45:02 -07:00
Irina Truong 270e1ce7a2 Log message. 2019-10-26 13:21:23 -07:00
Irina Truong 4f0c4d5a38 Fix for PQconninfo not available. 2019-10-19 11:36:38 -07:00
Irina Truong 04a74fce2c Get server params, such as is_superuser and server_version, without extra queries. 2019-08-28 08:26:24 -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 9abb4f8560 Run black. 2019-06-02 18:02:02 -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
Amjith Ramanujam a45c67acf0 Handle password with spaces. 2019-05-13 15:13:15 -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 a6d44df4a7 Merge branch 'master' into pr1035 2019-05-06 07:18:46 -07:00
Amjith Ramanujam e5501cb83c Check if dsn and password values are passed in. 2019-05-06 06:34:24 -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
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
Xavier Francisco e0eac14c96 Revert main changes; Filter unwanted params when dsn present 2019-04-09 21:46:20 +01:00
Xavier Francisco 49582ccb7c Fix usage of pgservice 2019-04-08 19:46:29 +01:00
Irina Truong d25d27846a Fix for https://github.com/dbcli/pgcli/issues/1014. 2019-03-18 03:09:26 +00:00
Amjith Ramanujam 3652134bc5
Merge branch 'master' into system-error 2019-03-16 21:18:21 -07:00
Amjith Ramanujam 9df9c222d0 Remove the unnecessary try/except. 2019-03-16 13:36:32 -07:00
Amjith Ramanujam f4ebcd2383 Access only the required element from the tuple. 2019-03-16 13:34:36 -07:00
Amjith Ramanujam 951cfb28a7 Catch and ignore the system interrupt. 2019-03-15 20:28:40 -07:00
Irina Truong 33dbb602de Fix crash when using --single-connection. 2019-03-04 16:09:12 -08: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 0cae7e2036
Remove some functions completions (#982)
Remove extension and private functions from completer.
2019-01-02 16:15:59 -08:00
Lele Gaifax 05ec05c4cb Adapt the query used to get functions metadata to PG11
This fixes #919.
2018-07-25 08:13:17 +02:00
Irina Truong 22d184dc6b Change server version query. 2018-07-24 15:14:53 -07:00
Irina Truong 7653ea9c1f Print server version as part of welcome message. 2018-07-20 15:47:40 -07:00
Saif Hakim 80957c59c5 Fix lint, update AUTHORS, and changelog 2018-07-04 01:36:50 -07:00
Saif Hakim 5cdb151999 Avoid reconnect prompt after error if connection is still valid
Instead of whitelisting all errors that do not require reconnecting, we simply
only reconnect if we detect a disconnect has occurred.

psql notably behaves in a similar way: https://git.io/fbxuc#L1461

Fixes #807
2018-07-03 23:56:26 -07:00
Irina Truong a26b8b92a2 Pep8. 2018-06-17 14:34:20 -07:00