diff options
author | Kevin Marsh <kevinmarsh@users.noreply.github.com> | 2020-12-01 16:03:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-01 16:03:38 -0800 |
commit | 34d6e080ff072a82a91a0dd8f60b92900051eb56 (patch) | |
tree | 999062eb7311568a0d2ce28c245a477f68b21a91 | |
parent | bbf5b2041576ebfcae120acacd27b99a7f0a9b72 (diff) |
dependencies: add support for sqlparse 0.4.x (#1224)
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | changelog.rst | 1 | ||||
-rw-r--r-- | pgcli/packages/parseutils/ctes.py | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | tests/test_sqlcompletion.py | 2 |
5 files changed, 5 insertions, 3 deletions
@@ -113,6 +113,7 @@ Contributors: * Seungyong Kwak (GUIEEN) * Tom Caruso (tomplex) * Jan Brun Rasmussen (janbrunrasmussen) + * Kevin Marsh (kevinmarsh) Creator: -------- diff --git a/changelog.rst b/changelog.rst index b303970f..dc197804 100644 --- a/changelog.rst +++ b/changelog.rst @@ -9,6 +9,7 @@ Features: * Update python version in Dockerfile * Support setting color for null, string, number, keyword value * Support Prompt Toolkit 2 +* Support sqlparse 0.4.x * Update functions, datatypes literals for auto-suggestion field * Add suggestion for schema in function auto-complete diff --git a/pgcli/packages/parseutils/ctes.py b/pgcli/packages/parseutils/ctes.py index 171d2002..e1f90885 100644 --- a/pgcli/packages/parseutils/ctes.py +++ b/pgcli/packages/parseutils/ctes.py @@ -16,7 +16,7 @@ TableExpression = namedtuple("TableExpression", "name columns start stop") def isolate_query_ctes(full_text, text_before_cursor): """Simplify a query by converting CTEs into table metadata objects""" - if not full_text: + if not full_text or not full_text.strip(): return full_text, text_before_cursor, tuple() ctes, remainder = extract_ctes(full_text) @@ -13,7 +13,7 @@ install_requirements = [ # see: https://github.com/dbcli/pgcli/pull/1197 "prompt_toolkit>=2.0.6,<4.0.0", "psycopg2 >= 2.8", - "sqlparse >=0.3.0,<0.4", + "sqlparse >=0.3.0,<0.5", "configobj >= 5.0.6", "pendulum>=2.1.0", "cli_helpers[styles] >= 2.0.0", diff --git a/tests/test_sqlcompletion.py b/tests/test_sqlcompletion.py index c5ef7b7d..3cbad0ad 100644 --- a/tests/test_sqlcompletion.py +++ b/tests/test_sqlcompletion.py @@ -816,7 +816,7 @@ def test_create_db_with_template(): assert set(suggestions) == set((Database(),)) -@pytest.mark.parametrize("initial_text", ("", " ", "\t \t")) +@pytest.mark.parametrize("initial_text", ("", " ", "\t \t", "\n")) def test_specials_included_for_initial_completion(initial_text): suggestions = suggest_type(initial_text, initial_text) |