Skip to content

Commit c4cca5a

Browse files
committed
Add demo GIFs and fix query execution
- Add Enter binding to execute queries in normal mode - Change default auth to SQL Server Authentication - Add demo GIFs showing connection and query workflow - Update README with demo GIF
1 parent 8182109 commit c4cca5a

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ venv/
2121

2222
# OS
2323
.DS_Store
24+
25+
# Demo files
26+
docker-compose.yml
27+
init.sql
28+
*.tape

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A simple terminal UI for SQL Server, for those who just want to run some queries
55
![Python](https://img.shields.io/badge/python-3.10+-blue.svg)
66
![License](https://img.shields.io/badge/license-MIT-green.svg)
77

8-
<!-- ![Demo](demo.gif) -->
8+
![Demo](demo-query.gif)
99

1010
You know that mass of software that is SSMS? You open it up and wait... and wait... just to run a simple SELECT query. Meanwhile it's eating up your RAM like there's no tomorrow.
1111

demo-connect.gif

225 KB
Loading

demo-query.gif

692 KB
Loading

sqlit/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class SSMSTUI(App):
123123
Binding("r", "focus_results", "Results", show=False),
124124
Binding("i", "enter_insert_mode", "Insert", show=False),
125125
Binding("escape", "exit_insert_mode", "Normal", show=False),
126+
Binding("enter", "execute_query", "Execute", show=False),
126127
]
127128

128129
def __init__(self):
@@ -229,7 +230,7 @@ def compose(self) -> ComposeResult:
229230
r"\[Q] Query", classes="section-label", id="label-query"
230231
)
231232
yield TextArea(
232-
"SELECT @@VERSION",
233+
"",
233234
language="sql",
234235
id="query-input",
235236
read_only=True,

sqlit/screens.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def _get_initial_auth_type(self) -> AuthType:
208208
"""Get the initial auth type from config."""
209209
if self.config:
210210
return self.config.get_auth_type()
211-
return AuthType.WINDOWS
211+
return AuthType.SQL_SERVER
212212

213213
def compose(self) -> ComposeResult:
214214
title = "Edit Connection" if self.editing else "New Connection"
@@ -265,8 +265,8 @@ def compose(self) -> ComposeResult:
265265

266266
yield Static("Authentication", classes="field-label")
267267
auth_list = OptionList(
268-
Option(AUTH_TYPE_LABELS[AuthType.WINDOWS], id=AuthType.WINDOWS.value),
269268
Option(AUTH_TYPE_LABELS[AuthType.SQL_SERVER], id=AuthType.SQL_SERVER.value),
269+
Option(AUTH_TYPE_LABELS[AuthType.WINDOWS], id=AuthType.WINDOWS.value),
270270
Option(AUTH_TYPE_LABELS[AuthType.AD_PASSWORD], id=AuthType.AD_PASSWORD.value),
271271
Option(
272272
AUTH_TYPE_LABELS[AuthType.AD_INTERACTIVE], id=AuthType.AD_INTERACTIVE.value
@@ -313,8 +313,8 @@ def on_mount(self) -> None:
313313
auth_list = self.query_one("#auth-list", OptionList)
314314
auth_type = self._get_initial_auth_type()
315315
auth_options = [
316-
AuthType.WINDOWS,
317316
AuthType.SQL_SERVER,
317+
AuthType.WINDOWS,
318318
AuthType.AD_PASSWORD,
319319
AuthType.AD_INTERACTIVE,
320320
AuthType.AD_INTEGRATED,
@@ -394,14 +394,14 @@ def _get_selected_auth_type(self) -> AuthType:
394394
"""Get the currently selected auth type."""
395395
auth_list = self.query_one("#auth-list", OptionList)
396396
auth_options = [
397-
AuthType.WINDOWS,
398397
AuthType.SQL_SERVER,
398+
AuthType.WINDOWS,
399399
AuthType.AD_PASSWORD,
400400
AuthType.AD_INTERACTIVE,
401401
AuthType.AD_INTEGRATED,
402402
]
403403
idx = auth_list.highlighted or 0
404-
return auth_options[idx] if idx < len(auth_options) else AuthType.WINDOWS
404+
return auth_options[idx] if idx < len(auth_options) else AuthType.SQL_SERVER
405405

406406
def _get_config(self) -> ConnectionConfig | None:
407407
name = self.query_one("#conn-name", Input).value

0 commit comments

Comments
 (0)