1
1
mirror of https://github.com/dbcli/pgcli.git synced 2024-09-19 09:48:19 +03:00
Commit Graph

1371 Commits

Author SHA1 Message Date
Amjith Ramanujam
83442f8ebf Merge pull request #655 from dbcli/koljonen/parse_function_body
Parse function bodies
2017-03-08 18:50:59 -08:00
koljonen
1277752d62
Find statements inside function body
Consider this script
```
CREATE FUNCTION foo() returns text LANGUAGE SQL AS $func$
SELECT 1 FROM Bar;
SELECT <cursor> FROM Baz;
$func$;
```
The change here is that `SELECT <cursor> FROM Baz;` will be seen as the
current statement, instead of the whole function definition.
This means we'll no longer get column suggestions from `Bar`.
2017-03-09 01:41:11 +01:00
Joakim Koljonen
4904a982dd Merge pull request #656 from dbcli/amjith/support-unicode-expanded-display
Add support for unicode chars in expanded mode.
2017-03-07 15:02:52 +01:00
Amjith Ramanujam
7f009c630f Add support for unicode chars in expanded mode. 2017-03-06 19:20:34 -08:00
Irina Truong
6e38853c99 Merge pull request #653 from dbcli/koljonen/materialized_view_keywords
Add MATERIALIZED VIEW keywords
2017-03-06 16:57:50 -08:00
Amjith Ramanujam
de83ec24f0 Releasing version 1.5.0 2017-03-06 16:36:02 -08:00
Irina Truong
54d08ba9cd Merge pull request #648 from dbcli/amjith/release-1.5.0
Changelog update for 1.5.0
2017-03-06 16:18:21 -08:00
Joakim Koljonen
6b8c62d0ec
Add MATERIALIZED VIEW keywords 2017-03-06 23:16:29 +01:00
Amjith Ramanujam
0ab1cade0e Changelog update for 1.5.0 2017-03-03 15:55:39 -08:00
Irina Truong
5b2c3151e0 Merge pull request #645 from dbcli/amjith/add-py36
Add python 3.5 and 3.6 to test suite.
2017-03-03 11:19:33 -08:00
Irina Truong
132f2bd758 Merge pull request #644 from dbcli/amjith/operational-error
Reconnect on OperationalError.
2017-03-03 11:17:51 -08:00
Amjith Ramanujam
bdabb6cee3 Reconnect on OperationalError. 2017-03-03 11:05:44 -08:00
Amjith Ramanujam
3cb3b4cd62 Add python 3.5 and 3.6 to test suite. 2017-03-03 11:05:26 -08:00
Irina Truong
b273d13755 Merge pull request #647 from dbcli/amjith/fix-psycopg2-bug
Adjust the connection order to work around psycopg2 restriction.
2017-03-03 10:26:24 -08:00
Amjith Ramanujam
01f8f9f771 Adjust the connection order to work around psycopg2 restriction. 2017-03-03 06:04:53 -08:00
Irina Truong
9cc58b7087 Merge pull request #642 from dbcli/darikg/reserve-more-menu-space
User config to reserve more menu space
2017-02-25 14:23:35 -08:00
Irina Truong
b07d63be4c Merge pull request #641 from dbcli/darikg/keywords-after-alter
Suggest keywords after ALTER
2017-02-25 14:16:12 -08:00
Darik Gamble
fe44cd4b37 Add a config option for the number of menu lines to reserve 2017-02-25 09:18:54 -05:00
Darik Gamble
f314f8301b Suggest keywords after ALTER 2017-02-25 09:01:11 -05:00
Amjith Ramanujam
e574f48e16 Update README.rst 2017-02-18 09:25:13 -08:00
Amjith Ramanujam
5d2c084d1b Merge pull request #639 from jnth/master
Switch the shorted prompt when prompt length is too long.
2017-02-09 20:40:55 -08:00
Jonathan Virga
0559c5119e Switch the shorted prompt when prompt length is too long. Connect #587 2017-02-08 10:32:01 +01:00
Amjith Ramanujam
4ad7c0f11b Merge pull request #638 from dbcli/bugfix/document-tabulate-number-formatting
Added documantation about tabulate's number formatting. Connect #617.
2017-02-04 19:42:05 -08:00
Irina Truong
fdda8c4e5d Added documantation about tabulate's number formatting. Connect #617. 2017-02-04 18:56:20 -08:00
Irina Truong
2a83436f14 Merge pull request #633 from AGhost-7/master
Per #298, make expand modes configurable.
2017-01-21 13:56:38 -08:00
AGhost-7
81aad79cab Per #298, make expand modes configurable.
This makes it possible to enable through the configuration the always
expand and automatic expansion modes in pgcli.
2017-01-21 12:51:12 -05:00
Irina Truong
ba9d59ee79 Merge pull request #632 from dbcli/j-bennet/bump-pgspecial
Bumped pgspecial to 1.7.0. Connect #627.
2017-01-12 16:59:52 -08:00
Irina Truong
411c175679 Bumped pgspecial to 1.7.0. Connect #627. 2017-01-12 08:33:57 -08:00
Irina Truong
c7bcc7ac74 Fixed release script and author email, because pypi made some breaking changes. 2017-01-11 18:33:36 -08:00
Irina Truong
8a76a75523 Releasing version 1.4.0 2017-01-11 17:56:06 -08:00
Irina Truong
67ed13498d Merge pull request #631 from dbcli/j-bennet/release-1.4.0
Changelog and version update for release v1.4.0.
2017-01-11 17:54:31 -08:00
Irina Truong
3fed66df97 Reverted version bump. 2017-01-11 17:48:41 -08:00
Irina Truong
d9649db2e8 Release v1.4.0. 2017-01-10 16:35:59 -08:00
darikg
44c7eb10c6 Merge pull request #624 from dbcli/koljonen/search_by_alias
Search suggestions by initialism
2017-01-09 10:54:31 -05:00
Joakim Koljonen
3cb73cc02c
Changes after review 2017-01-09 03:35:55 +09:00
Stuart Quin
77e21b0379 Merge pull request #630 from dbcli/amjith/data-formatting-1
Set default data_formatting to nothing.
2017-01-07 11:53:00 +00:00
Amjith Ramanujam
17d3f05d56 Set default data_formatting to nothing. 2017-01-06 09:47:32 -08:00
Irina Truong
4edd124c0d Merge pull request #621 from dbcli/koljonen/show_transaction_status
Add transaction status to toolbar
2016-12-12 15:06:51 -08:00
Joakim Koljonen
ce55abc660
Initialism search for columns and functions
E.g. for table `Foo` with columns `FooBar` and `Fabulous`, inputting
`SELECT * FROM Foo F WHERE F.fb` will suggest `FooBar` as the #1 choice.
Likewise, given the functions `baz_baz()` and `baab()`, inputting
`SELECT bb` will have `baz_baz()` as the first option.
2016-12-12 02:45:39 +01:00
Joakim Koljonen
813afcaf11
Search table suggestions using initialisms
The idea is that if you have e.g. a table called `FooBar`, where we'd
use the initialism `FB` as an alias (suggesting `FooBar FB`),
inputting e.g. `SELECT * FROM FB` should suggest `FooBar FB` (or
`FooBar` if aliasing is disabled). Ditto for functions, views and joins.
The solution is that we send `FB` as a `synonym` to `find_matches`,
which results in the `FooBar` suggestion rising to the top (above e.g.
`FabulousTable`).
2016-12-12 02:45:39 +01:00
Joakim Koljonen
36568270fd
Clean up some leftovers 2016-12-12 02:45:39 +01:00
darikg
a9352bdb22 Merge pull request #619 from dbcli/koljonen/qualify_columns
Table-qualifying column suggestions
2016-12-10 10:42:26 -05:00
Joakim Koljonen
466b8e74be
Better status-bar transaction-status colors 2016-12-10 05:13:29 +01:00
Joakim Koljonen
8f9c35f024
Optimization after code review 2016-12-10 05:11:52 +01:00
Amjith Ramanujam
8dc435f6b1 Merge pull request #622 from dbcli/koljonen/show_vi_mode
Increased minimum prompt_toolkit requirement to 1.0.9.
2016-12-07 10:43:42 -08:00
Irina Truong
7827790cd2 Increased minimum prompt_toolkit requirement to 1.0.9. 2016-12-07 10:22:53 -08:00
Irina Truong
062d9dcc2e Merge pull request #620 from dbcli/koljonen/show_vi_mode
Display vi mode in the toolbar
2016-12-06 21:41:45 -08:00
Joakim Koljonen
f8b1647ae8
Add transaction status to toolbar 2016-12-07 04:39:03 +01:00
Joakim Koljonen
0129e49f7f
Display vi mode in the toolbar
I've been confused about what mode I'm in so many times ...
2016-12-07 03:00:50 +01:00
koljonen
45326335e6
Support for table-qualifying column suggestions
... i.e. suggesting foo.fooid instead of just fooid
Controlled using a config-file setting:
**qualify_columns**: always/never/**if_more_than_one_table**.

To enable the proper sorting of qualified column suggestions, we
introduce the concept of synonyms for suggestions
(in `pgcompleter.find_matches`). They way synonyms work is that a
number of synonyms may be provided for a suggestion sent to
`find_matches`. If synonyms are provided, sorting is based on how
well the best synonym matches the input, instead of only comparing
the input to the suggestion text.
In this case, the unqualified name acts as a synonym.
I have a couple of other ideas of use cases where we can use synonyms
to get better completions with less typing for the user, which I intend
to explore later.
2016-12-05 03:15:53 +01:00