sqlsaber 0.22.0__py3-none-any.whl → 0.23.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sqlsaber might be problematic. Click here for more details.

sqlsaber/cli/display.py CHANGED
@@ -93,12 +93,15 @@ class LiveMarkdownRenderer:
93
93
  """Finalize and stop the current Live segment, if any."""
94
94
  if self._live is None:
95
95
  return
96
- if self._buffer:
97
- self._live.update(Markdown(self._buffer))
96
+ # Persist the *final* render exactly once, then shut Live down.
97
+ buf = self._buffer
98
98
  self._live.stop()
99
99
  self._live = None
100
100
  self._buffer = ""
101
101
  self._current_kind = None
102
+ # Print the complete markdown to scroll-back for permanent reference
103
+ if buf:
104
+ self.console.print(Markdown(buf))
102
105
 
103
106
  def end_if_active(self) -> None:
104
107
  self.end()
@@ -154,10 +157,12 @@ class LiveMarkdownRenderer:
154
157
  if self._live is not None:
155
158
  self.end()
156
159
  self._buffer = initial_markdown or ""
160
+ # NOTE: Use transient=True so the live widget disappears on exit,
161
+ # giving a clean transition to the final printed result.
157
162
  live = Live(
158
163
  Markdown(self._buffer),
159
164
  console=self.console,
160
- vertical_overflow="visible",
165
+ transient=True,
161
166
  refresh_per_second=12,
162
167
  )
163
168
  self._live = live
@@ -251,6 +256,15 @@ class DisplayManager:
251
256
  """Display error message."""
252
257
  self.console.print(f"\n[bold red]Error:[/bold red] {error_message}")
253
258
 
259
+ def show_sql_error(self, error_message: str, suggestions: list[str] | None = None):
260
+ """Display SQL-specific error with optional suggestions."""
261
+ self.show_newline()
262
+ self.console.print(f"[bold red]SQL error:[/bold red] {error_message}")
263
+ if suggestions:
264
+ self.console.print("[yellow]Hints:[/yellow]")
265
+ for suggestion in suggestions:
266
+ self.console.print(f" • {suggestion}")
267
+
254
268
  def show_processing(self, message: str):
255
269
  """Display processing message."""
256
270
  self.console.print() # Add newline
sqlsaber/cli/streaming.py CHANGED
@@ -114,8 +114,14 @@ class StreamingQueryHandler:
114
114
  pass
115
115
  elif isinstance(content, dict):
116
116
  data = content
117
- if isinstance(data, dict) and data.get("success") and data.get("results"):
118
- self.display.show_query_results(data["results"]) # type: ignore[arg-type]
117
+
118
+ if isinstance(data, dict):
119
+ if data.get("success") and data.get("results"):
120
+ self.display.show_query_results(data["results"]) # type: ignore[arg-type]
121
+ elif "error" in data:
122
+ self.display.show_sql_error(
123
+ data.get("error"), data.get("suggestions")
124
+ )
119
125
  # Add a blank line after tool output to separate from next segment
120
126
  self.display.show_newline()
121
127
  # Show status while agent sends a follow-up request to the model
sqlsaber/cli/threads.py CHANGED
@@ -131,6 +131,10 @@ def _render_transcript(
131
131
  and data.get("results")
132
132
  ):
133
133
  dm.show_query_results(data["results"]) # type: ignore[arg-type]
134
+ elif isinstance(data, dict) and "error" in data:
135
+ dm.show_sql_error(
136
+ data.get("error"), data.get("suggestions")
137
+ )
134
138
  else:
135
139
  console.print(
136
140
  Panel.fit(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlsaber
3
- Version: 0.22.0
3
+ Version: 0.23.0
4
4
  Summary: SQLsaber - Open-source agentic SQL assistant
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -9,12 +9,12 @@ sqlsaber/cli/auth.py,sha256=jTsRgbmlGPlASSuIKmdjjwfqtKvjfKd_cTYxX0-QqaQ,7400
9
9
  sqlsaber/cli/commands.py,sha256=mjLG9i1bXf0TEroxkIxq5O7Hhjufz3Ad72cyJz7vE1k,8128
10
10
  sqlsaber/cli/completers.py,sha256=HsUPjaZweLSeYCWkAcgMl8FylQ1xjWBWYTEL_9F6xfU,6430
11
11
  sqlsaber/cli/database.py,sha256=JKtHSN-BFzBa14REf0phFVQB7d67m1M5FFaD8N6DdrY,12966
12
- sqlsaber/cli/display.py,sha256=bul9Yzw8KFYkof-kDzeajpx2TtG9CjTaUiwWaTv95dQ,14293
12
+ sqlsaber/cli/display.py,sha256=9uXg0GqFXGAwBj1O7-i6aLPQkGq-iURrsKHk6PWTq1E,15025
13
13
  sqlsaber/cli/interactive.py,sha256=7uM4LoXbhPJr8o5yNjICSzL0uxZkp1psWrVq4G9V0OI,13118
14
14
  sqlsaber/cli/memory.py,sha256=OufHFJFwV0_GGn7LvKRTJikkWhV1IwNIUDOxFPHXOaQ,7794
15
15
  sqlsaber/cli/models.py,sha256=ZewtwGQwhd9b-yxBAPKePolvI1qQG-EkmeWAGMqtWNQ,8986
16
- sqlsaber/cli/streaming.py,sha256=BeG7H38-I1n8b9R8XSBV-IqkxDRZhsWFW6sdvtbVi3o,6879
17
- sqlsaber/cli/threads.py,sha256=XUnLcCUe2wa_85IKdKmryqfiHTQu_IylET2Qo8oy1nk,11324
16
+ sqlsaber/cli/streaming.py,sha256=Eo5CNUgDGY1WYP90jwDA2aY7RefN-TfcStA6NyjUQTY,7076
17
+ sqlsaber/cli/threads.py,sha256=HJ6v9wEv1as21B7IJglYs3q6LH7Plv2oheLbM5YEQQA,11549
18
18
  sqlsaber/config/__init__.py,sha256=olwC45k8Nc61yK0WmPUk7XHdbsZH9HuUAbwnmKe3IgA,100
19
19
  sqlsaber/config/api_keys.py,sha256=RqWQCko1tY7sES7YOlexgBH5Hd5ne_kGXHdBDNqcV2U,3649
20
20
  sqlsaber/config/auth.py,sha256=b5qB2h1doXyO9Bn8z0CcL8LAR2jF431gGXBGKLgTmtQ,2756
@@ -40,8 +40,8 @@ sqlsaber/tools/enums.py,sha256=CH32mL-0k9ZA18911xLpNtsgpV6tB85TktMj6uqGz54,411
40
40
  sqlsaber/tools/instructions.py,sha256=X-x8maVkkyi16b6Tl0hcAFgjiYceZaSwyWTfmrvx8U8,9024
41
41
  sqlsaber/tools/registry.py,sha256=HWOQMsNIdL4XZS6TeNUyrL-5KoSDH6PHsWd3X66o-18,3211
42
42
  sqlsaber/tools/sql_tools.py,sha256=hM6tKqW5MDhFUt6MesoqhTUqIpq_5baIIDoN1MjDCXY,9647
43
- sqlsaber-0.22.0.dist-info/METADATA,sha256=T9TBoCGfPVrZKM-RnUVROqOKaBaU1KJdYKqh3a8Arr8,6178
44
- sqlsaber-0.22.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
45
- sqlsaber-0.22.0.dist-info/entry_points.txt,sha256=qEbOB7OffXPFgyJc7qEIJlMEX5RN9xdzLmWZa91zCQQ,162
46
- sqlsaber-0.22.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
- sqlsaber-0.22.0.dist-info/RECORD,,
43
+ sqlsaber-0.23.0.dist-info/METADATA,sha256=olVI7W6UB-F6oZUqOjTWhJAvYtDbXXO0xoeOVYYmpfM,6178
44
+ sqlsaber-0.23.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
45
+ sqlsaber-0.23.0.dist-info/entry_points.txt,sha256=qEbOB7OffXPFgyJc7qEIJlMEX5RN9xdzLmWZa91zCQQ,162
46
+ sqlsaber-0.23.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
+ sqlsaber-0.23.0.dist-info/RECORD,,