1
0
Fork 0

Merging upstream version 1.6.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 17:42:20 +01:00
parent 4b3dd727fd
commit 12edc19d72
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
17 changed files with 95 additions and 53 deletions

View file

@ -54,6 +54,7 @@ wider_completion_menu = False
# litecli prompt
# \D - The full current date
# \d - Database name
# \f - File basename of the "main" database
# \m - Minutes of the current time
# \n - Newline
# \P - AM/PM

View file

@ -36,7 +36,9 @@ def test_order_by_suggests_cols_with_qualified_table_scope():
"SELECT * FROM sch.tabl ORDER BY ", "SELECT * FROM sch.tabl ORDER BY "
)
assert sorted_dicts(suggestions) == sorted_dicts(
[{"type": "column", "tables": [("sch", "tabl", None)]},]
[
{"type": "column", "tables": [("sch", "tabl", None)]},
]
)

View file

@ -367,15 +367,17 @@ def test_auto_escaped_col_names(completer, complete_event):
Document(text=text, cursor_position=position), complete_event
)
)
assert result == [
Completion(text="*", start_position=0),
Completion(text="`ABC`", start_position=0),
Completion(text="`insert`", start_position=0),
Completion(text="id", start_position=0),
] + list(map(Completion, completer.functions)) + [
Completion(text="`select`", start_position=0)
] + list(
map(Completion, sorted(completer.keywords))
assert (
result
== [
Completion(text="*", start_position=0),
Completion(text="`ABC`", start_position=0),
Completion(text="`insert`", start_position=0),
Completion(text="id", start_position=0),
]
+ list(map(Completion, completer.functions))
+ [Completion(text="`select`", start_position=0)]
+ list(map(Completion, sorted(completer.keywords)))
)

View file

@ -101,6 +101,17 @@ def test_unicode_support_in_output(executor):
assert_result_equal(results, headers=["t"], rows=[(u"é",)])
@dbtest
def test_invalid_unicode_values_dont_choke(executor):
run(executor, "create table unicodechars(t text)")
# \xc3 is not a valid utf-8 char. But we can insert it into the database
# which can break querying if not handled correctly.
run(executor, u"insert into unicodechars (t) values (cast(x'c3' as text))")
results = run(executor, u"select * from unicodechars")
assert_result_equal(results, headers=["t"], rows=[("\\xc3",)])
@dbtest
def test_multiple_queries_same_line(executor):
results = run(executor, "select 'foo'; select 'bar'")
@ -186,6 +197,7 @@ def test_bind_parameterized_favorite_query(executor):
with pytest.raises(ProgrammingError):
results = run(executor, "\\f+ q_param 1 2")
@dbtest
def test_verbose_feature_of_favorite_query(executor):
set_expanded_output(False)
@ -198,11 +210,7 @@ def test_verbose_feature_of_favorite_query(executor):
results = run(executor, "\\f sh_param 1")
assert_result_equal(
results,
title=None,
headers=["a", "id"],
rows=[("abc", 1)],
auto_status=False,
results, title=None, headers=["a", "id"], rows=[("abc", 1)], auto_status=False,
)
results = run(executor, "\\f+ sh_param 1")
@ -214,6 +222,7 @@ def test_verbose_feature_of_favorite_query(executor):
auto_status=False,
)
@dbtest
def test_shell_parameterized_favorite_query(executor):
set_expanded_output(False)