sqlsaber 0.15.0__tar.gz → 0.16.1__tar.gz
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-0.16.1/.github/workflows/deploy-docs.yml +34 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/AGENT.md +2 -2
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/CHANGELOG.md +32 -1
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/CLAUDE.md +2 -2
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/PKG-INFO +20 -39
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/README.md +17 -36
- sqlsaber-0.16.1/docs/.gitignore +24 -0
- sqlsaber-0.16.1/docs/.vscode/extensions.json +4 -0
- sqlsaber-0.16.1/docs/.vscode/launch.json +11 -0
- sqlsaber-0.16.1/docs/CLAUDE.md +40 -0
- sqlsaber-0.16.1/docs/astro.config.mjs +17 -0
- sqlsaber-0.16.1/docs/components.json +16 -0
- sqlsaber-0.16.1/docs/package-lock.json +5792 -0
- sqlsaber-0.16.1/docs/package.json +26 -0
- sqlsaber-0.16.1/docs/public/CNAME +1 -0
- sqlsaber-0.16.1/docs/public/favicon.svg +5 -0
- sqlsaber-0.16.1/docs/src/components/FeatureSection.svelte +80 -0
- sqlsaber-0.16.1/docs/src/components/Footer.svelte +74 -0
- sqlsaber-0.16.1/docs/src/components/Hero.svelte +52 -0
- sqlsaber-0.16.1/docs/src/components/Layout.astro +43 -0
- sqlsaber-0.16.1/docs/src/components/Navigation.svelte +112 -0
- sqlsaber-0.16.1/docs/src/lib/components/ui/button/button.svelte +80 -0
- sqlsaber-0.16.1/docs/src/lib/components/ui/button/index.ts +17 -0
- sqlsaber-0.16.1/docs/src/lib/styles/app.css +164 -0
- sqlsaber-0.16.1/docs/src/lib/utils.ts +13 -0
- sqlsaber-0.16.1/docs/src/pages/index.astro +95 -0
- sqlsaber-0.16.1/docs/svelte.config.js +5 -0
- sqlsaber-0.16.1/docs/tsconfig.json +14 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/pyproject.toml +4 -3
- sqlsaber-0.16.1/sqlsaber.gif +0 -0
- sqlsaber-0.16.1/src/sqlsaber/agents/__init__.py +7 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/agents/base.py +1 -2
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/agents/mcp.py +2 -2
- sqlsaber-0.16.1/src/sqlsaber/agents/pydantic_ai_agent.py +170 -0
- sqlsaber-0.16.1/src/sqlsaber/cli/auth.py +208 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/commands.py +23 -8
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/interactive.py +65 -30
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/models.py +58 -29
- sqlsaber-0.16.1/src/sqlsaber/cli/streaming.py +137 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/config/api_keys.py +9 -11
- sqlsaber-0.16.1/src/sqlsaber/config/providers.py +116 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/config/settings.py +50 -30
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/database/connection.py +3 -3
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/models/__init__.py +0 -3
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/tools/base.py +7 -5
- sqlsaber-0.16.1/tests/test_cli/test_auth_reset.py +97 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_cli/test_commands.py +1 -1
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_config/test_oauth.py +0 -25
- sqlsaber-0.16.1/tests/test_config/test_providers.py +40 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_tools/test_base.py +0 -2
- sqlsaber-0.16.1/uv.lock +2273 -0
- sqlsaber-0.15.0/src/sqlsaber/agents/__init__.py +0 -9
- sqlsaber-0.15.0/src/sqlsaber/agents/anthropic.py +0 -491
- sqlsaber-0.15.0/src/sqlsaber/agents/streaming.py +0 -16
- sqlsaber-0.15.0/src/sqlsaber/cli/auth.py +0 -141
- sqlsaber-0.15.0/src/sqlsaber/cli/streaming.py +0 -100
- sqlsaber-0.15.0/src/sqlsaber/clients/__init__.py +0 -6
- sqlsaber-0.15.0/src/sqlsaber/clients/anthropic.py +0 -285
- sqlsaber-0.15.0/src/sqlsaber/clients/base.py +0 -31
- sqlsaber-0.15.0/src/sqlsaber/clients/exceptions.py +0 -117
- sqlsaber-0.15.0/src/sqlsaber/clients/models.py +0 -282
- sqlsaber-0.15.0/src/sqlsaber/clients/streaming.py +0 -257
- sqlsaber-0.15.0/src/sqlsaber/models/events.py +0 -28
- sqlsaber-0.15.0/tests/test_agents/test_anthropic_oauth.py +0 -78
- sqlsaber-0.15.0/tests/test_clients/test_anthropic_client.py +0 -91
- sqlsaber-0.15.0/tests/test_clients/test_streaming.py +0 -282
- sqlsaber-0.15.0/uv.lock +0 -1073
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/.github/workflows/claude-code-review.yml +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/.github/workflows/claude.yml +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/.github/workflows/publish.yml +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/.github/workflows/test.yml +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/.gitignore +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/.python-version +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/LICENSE +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/pytest.ini +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/sqlsaber.svg +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/__main__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/completers.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/database.py +1 -1
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/display.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/cli/memory.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/config/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/config/auth.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/config/database.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/config/oauth_flow.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/config/oauth_tokens.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/conversation/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/conversation/manager.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/conversation/models.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/conversation/storage.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/database/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/database/resolver.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/database/schema.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/mcp/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/mcp/mcp.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/memory/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/memory/manager.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/memory/storage.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/models/types.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/tools/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/tools/enums.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/tools/instructions.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/tools/registry.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/tools/sql_tools.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/src/sqlsaber/tools/visualization_tools.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/conftest.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_cli/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_config/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_config/test_database.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_config/test_settings.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_conversation_storage.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_database/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_database/test_connection.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_database_resolver.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_tools/__init__.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_tools/test_instructions.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_tools/test_registry.py +0 -0
- {sqlsaber-0.15.0 → sqlsaber-0.16.1}/tests/test_tools/test_sql_tools.py +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Deploy docs to GitHub Pages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
# Allow this job to clone the repo and create a page deployment
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout your repository using git
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
- name: Install, build, and upload your site
|
|
21
|
+
uses: withastro/action@v3
|
|
22
|
+
with:
|
|
23
|
+
path: docs/
|
|
24
|
+
|
|
25
|
+
deploy:
|
|
26
|
+
needs: build
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
environment:
|
|
29
|
+
name: github-pages
|
|
30
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
31
|
+
steps:
|
|
32
|
+
- name: Deploy to GitHub Pages
|
|
33
|
+
id: deployment
|
|
34
|
+
uses: actions/deploy-pages@v4
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
## Architecture
|
|
12
12
|
|
|
13
13
|
- **CLI App**: Agentic SQL assistant for natural language to SQL
|
|
14
|
-
- **Core modules**: `agents/` (AI logic), `cli/` (commands), `
|
|
14
|
+
- **Core modules**: `agents/` (AI logic), `cli/` (commands), `database/` (connections), `mcp/` (Model Context Protocol server)
|
|
15
15
|
- **Database support**: PostgreSQL, SQLite, MySQL via asyncpg/aiosqlite/aiomysql
|
|
16
16
|
- **MCP integration**: Exposes tools via `sqlsaber-mcp` for Claude Code and other MCP clients
|
|
17
17
|
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
- **Imports**: stdlib → 3rd party → local, use relative imports within modules
|
|
21
21
|
- **Naming**: snake_case functions/vars, PascalCase classes, UPPER_SNAKE constants, `_private` methods
|
|
22
22
|
- **Types**: Always use modern type hints (3.12+), async functions for I/O
|
|
23
|
-
- **Errors**:
|
|
23
|
+
- **Errors**: Use try/finally for cleanup
|
|
24
24
|
- **Docstrings**: Triple-quoted with Args/Returns sections
|
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to
|
|
3
|
+
All notable changes to SQLsaber will be documented in this file.
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.16.1] - 2025-09-04
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Compile python byte code during installation
|
|
12
|
+
- Updated CLI help string
|
|
13
|
+
|
|
14
|
+
## [0.16.0] - 2025-09-04
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Migrated to Pydantic-AI agent runtime with model-agnostic interfaces
|
|
19
|
+
- Added multi-provider model support: Anthropic, OpenAI, Google, Groq, Mistral, Cohere, Hugging Face
|
|
20
|
+
- Provider registry tests to ensure invariants and alias normalization
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Reworked agents to use new pydantic-ai-based agent implementation
|
|
25
|
+
- Updated CLI modules and settings to integrate provider selection and authentication
|
|
26
|
+
- `saber auth reset` now mirrors setup by prompting for a provider, then selectively removing stored credentials for that provider
|
|
27
|
+
- Removes API keys from OS credential store for the selected provider
|
|
28
|
+
- For Anthropic, also detects and removes OAuth tokens
|
|
29
|
+
- Offers optional prompt to unset global auth method when Anthropic OAuth is removed
|
|
30
|
+
- Centralized provider definitions in `sqlsaber.config.providers` and refactored CLI, config, and agent code to use the registry (single source of truth)
|
|
31
|
+
- Normalized provider aliases (e.g., `google-gla` → `google`) for consistent behavior across modules
|
|
32
|
+
|
|
33
|
+
### Removed
|
|
34
|
+
|
|
35
|
+
- Deprecated custom `clients` module and Anthropic-specific client code
|
|
36
|
+
- Removed legacy streaming and events modules and related tests
|
|
37
|
+
|
|
7
38
|
## [0.15.0] - 2025-08-18
|
|
8
39
|
|
|
9
40
|
### Added
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
## Architecture
|
|
10
10
|
|
|
11
11
|
- **CLI App**: Agentic SQL assistant for natural language to SQL
|
|
12
|
-
- **Core modules**: `agents/` (AI logic), `cli/` (commands), `
|
|
12
|
+
- **Core modules**: `agents/` (AI logic), `cli/` (commands), `database/` (connections), `mcp/` (Model Context Protocol server)
|
|
13
13
|
- **Database support**: PostgreSQL, SQLite, MySQL via asyncpg/aiosqlite/aiomysql
|
|
14
14
|
- **MCP integration**: Exposes tools via `sqlsaber-mcp` for Claude Code and other MCP clients
|
|
15
15
|
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
- **Imports**: stdlib → 3rd party → local, use relative imports within modules
|
|
19
19
|
- **Naming**: snake_case functions/vars, PascalCase classes, UPPER_SNAKE constants, `_private` methods
|
|
20
20
|
- **Types**: Always use modern type hints (3.12+), async functions for I/O
|
|
21
|
-
- **Errors**:
|
|
21
|
+
- **Errors**: Use try/finally for cleanup
|
|
22
22
|
- **Docstrings**: Triple-quoted with Args/Returns sections
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlsaber
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.16.1
|
|
4
|
+
Summary: SQLsaber - Open-source agentic SQL assistant
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Requires-Python: >=3.12
|
|
7
7
|
Requires-Dist: aiomysql>=0.2.0
|
|
8
8
|
Requires-Dist: aiosqlite>=0.21.0
|
|
9
|
-
Requires-Dist: anthropic>=0.54.0
|
|
10
9
|
Requires-Dist: asyncpg>=0.30.0
|
|
11
10
|
Requires-Dist: cyclopts>=3.22.1
|
|
12
11
|
Requires-Dist: fastmcp>=2.9.0
|
|
@@ -14,27 +13,21 @@ Requires-Dist: httpx>=0.28.1
|
|
|
14
13
|
Requires-Dist: keyring>=25.6.0
|
|
15
14
|
Requires-Dist: pandas>=2.0.0
|
|
16
15
|
Requires-Dist: platformdirs>=4.0.0
|
|
16
|
+
Requires-Dist: pydantic-ai
|
|
17
17
|
Requires-Dist: questionary>=2.1.0
|
|
18
18
|
Requires-Dist: rich>=13.7.0
|
|
19
19
|
Requires-Dist: uniplot>=0.21.2
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# SQLsaber
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
███████ ██████ ██ ███████ █████ ██████ ███████ ██████
|
|
26
|
-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
27
|
-
███████ ██ ██ ██ ███████ ███████ ██████ █████ ██████
|
|
28
|
-
██ ██ ▄▄ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
29
|
-
███████ ██████ ███████ ███████ ██ ██ ██████ ███████ ██ ██
|
|
30
|
-
▀▀
|
|
31
|
-
```
|
|
24
|
+
> SQLsaber is an open-source agentic SQL assistant. Think Claude Code but for SQL.
|
|
32
25
|
|
|
33
|
-
|
|
26
|
+

|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
Stop fighting your database.
|
|
36
29
|
|
|
37
|
-
Ask your questions in natural language and
|
|
30
|
+
Ask your questions in natural language and `sqlsaber` will gather the right context automatically and answer your query by writing SQL and analyzing the results.
|
|
38
31
|
|
|
39
32
|
## Table of Contents
|
|
40
33
|
|
|
@@ -59,14 +52,13 @@ Ask your questions in natural language and it will gather the right context auto
|
|
|
59
52
|
|
|
60
53
|
## Features
|
|
61
54
|
|
|
62
|
-
- Natural language to SQL conversion
|
|
63
55
|
- 🔍 Automatic database schema introspection
|
|
64
56
|
- 🛡️ Safe query execution (read-only by default)
|
|
65
57
|
- 🧠 Memory management
|
|
66
58
|
- 💬 Interactive REPL mode
|
|
67
|
-
- 🎨 Beautiful formatted output with syntax highlighting
|
|
68
59
|
- 🗄️ Support for PostgreSQL, SQLite, and MySQL
|
|
69
60
|
- 🔌 MCP (Model Context Protocol) server support
|
|
61
|
+
- 🎨 Beautiful formatted output
|
|
70
62
|
|
|
71
63
|
## Installation
|
|
72
64
|
|
|
@@ -165,34 +157,21 @@ saber -d mydb
|
|
|
165
157
|
|
|
166
158
|
# Single query with specific database
|
|
167
159
|
saber -d mydb "count all orders"
|
|
160
|
+
|
|
161
|
+
# You can also pass a connection string
|
|
162
|
+
saber -d "postgresql://user:password@localhost:5432/mydb" "count all orders"
|
|
168
163
|
```
|
|
169
164
|
|
|
170
165
|
## Examples
|
|
171
166
|
|
|
172
167
|
```bash
|
|
173
|
-
#
|
|
174
|
-
saber
|
|
175
|
-
|
|
176
|
-
# Count records
|
|
177
|
-
saber "how many active users do we have?"
|
|
168
|
+
# Start interactive mode
|
|
169
|
+
saber
|
|
178
170
|
|
|
179
|
-
#
|
|
171
|
+
# Non-interactive mode
|
|
180
172
|
saber "show me orders with customer details for this week"
|
|
181
173
|
|
|
182
|
-
# Aggregations
|
|
183
|
-
saber "what's the total revenue by product category?"
|
|
184
|
-
|
|
185
|
-
# Date filtering
|
|
186
|
-
saber "list users who haven't logged in for 30 days"
|
|
187
|
-
|
|
188
|
-
# Data exploration
|
|
189
|
-
saber "show me the distribution of customer ages"
|
|
190
|
-
|
|
191
|
-
# Business analytics
|
|
192
174
|
saber "which products had the highest sales growth last quarter?"
|
|
193
|
-
|
|
194
|
-
# Start interactive mode
|
|
195
|
-
saber
|
|
196
175
|
```
|
|
197
176
|
|
|
198
177
|
## MCP Server Integration
|
|
@@ -214,7 +193,7 @@ uvx --from sqlsaber saber-mcp
|
|
|
214
193
|
Add SQLSaber as an MCP server in Claude Code:
|
|
215
194
|
|
|
216
195
|
```bash
|
|
217
|
-
claude mcp add -- uvx --from sqlsaber saber-mcp
|
|
196
|
+
claude mcp add sqlsaber -- uvx --from sqlsaber saber-mcp
|
|
218
197
|
```
|
|
219
198
|
|
|
220
199
|
#### Other MCP Clients
|
|
@@ -234,7 +213,7 @@ The MCP server uses your existing SQLSaber database configurations, so make sure
|
|
|
234
213
|
|
|
235
214
|
## How It Works
|
|
236
215
|
|
|
237
|
-
|
|
216
|
+
SQLsaber uses a multi-step agentic process to gather the right context and execute SQL queries to answer your questions:
|
|
238
217
|
|
|
239
218
|

|
|
240
219
|
|
|
@@ -255,7 +234,9 @@ SQLSaber uses a multi-step process to gather the right context, provide it to th
|
|
|
255
234
|
|
|
256
235
|
## Contributing
|
|
257
236
|
|
|
258
|
-
|
|
237
|
+
If you like the project, starring the repo is a great way to show your support!
|
|
238
|
+
|
|
239
|
+
Other contributions are welcome! Please feel free to open an issue to discuss your ideas or report bugs.
|
|
259
240
|
|
|
260
241
|
## License
|
|
261
242
|
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SQLsaber
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
███████ ██████ ██ ███████ █████ ██████ ███████ ██████
|
|
5
|
-
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
6
|
-
███████ ██ ██ ██ ███████ ███████ ██████ █████ ██████
|
|
7
|
-
██ ██ ▄▄ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
8
|
-
███████ ██████ ███████ ███████ ██ ██ ██████ ███████ ██ ██
|
|
9
|
-
▀▀
|
|
10
|
-
```
|
|
3
|
+
> SQLsaber is an open-source agentic SQL assistant. Think Claude Code but for SQL.
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+

|
|
13
6
|
|
|
14
|
-
|
|
7
|
+
Stop fighting your database.
|
|
15
8
|
|
|
16
|
-
Ask your questions in natural language and
|
|
9
|
+
Ask your questions in natural language and `sqlsaber` will gather the right context automatically and answer your query by writing SQL and analyzing the results.
|
|
17
10
|
|
|
18
11
|
## Table of Contents
|
|
19
12
|
|
|
@@ -38,14 +31,13 @@ Ask your questions in natural language and it will gather the right context auto
|
|
|
38
31
|
|
|
39
32
|
## Features
|
|
40
33
|
|
|
41
|
-
- Natural language to SQL conversion
|
|
42
34
|
- 🔍 Automatic database schema introspection
|
|
43
35
|
- 🛡️ Safe query execution (read-only by default)
|
|
44
36
|
- 🧠 Memory management
|
|
45
37
|
- 💬 Interactive REPL mode
|
|
46
|
-
- 🎨 Beautiful formatted output with syntax highlighting
|
|
47
38
|
- 🗄️ Support for PostgreSQL, SQLite, and MySQL
|
|
48
39
|
- 🔌 MCP (Model Context Protocol) server support
|
|
40
|
+
- 🎨 Beautiful formatted output
|
|
49
41
|
|
|
50
42
|
## Installation
|
|
51
43
|
|
|
@@ -144,34 +136,21 @@ saber -d mydb
|
|
|
144
136
|
|
|
145
137
|
# Single query with specific database
|
|
146
138
|
saber -d mydb "count all orders"
|
|
139
|
+
|
|
140
|
+
# You can also pass a connection string
|
|
141
|
+
saber -d "postgresql://user:password@localhost:5432/mydb" "count all orders"
|
|
147
142
|
```
|
|
148
143
|
|
|
149
144
|
## Examples
|
|
150
145
|
|
|
151
146
|
```bash
|
|
152
|
-
#
|
|
153
|
-
saber
|
|
154
|
-
|
|
155
|
-
# Count records
|
|
156
|
-
saber "how many active users do we have?"
|
|
147
|
+
# Start interactive mode
|
|
148
|
+
saber
|
|
157
149
|
|
|
158
|
-
#
|
|
150
|
+
# Non-interactive mode
|
|
159
151
|
saber "show me orders with customer details for this week"
|
|
160
152
|
|
|
161
|
-
# Aggregations
|
|
162
|
-
saber "what's the total revenue by product category?"
|
|
163
|
-
|
|
164
|
-
# Date filtering
|
|
165
|
-
saber "list users who haven't logged in for 30 days"
|
|
166
|
-
|
|
167
|
-
# Data exploration
|
|
168
|
-
saber "show me the distribution of customer ages"
|
|
169
|
-
|
|
170
|
-
# Business analytics
|
|
171
153
|
saber "which products had the highest sales growth last quarter?"
|
|
172
|
-
|
|
173
|
-
# Start interactive mode
|
|
174
|
-
saber
|
|
175
154
|
```
|
|
176
155
|
|
|
177
156
|
## MCP Server Integration
|
|
@@ -193,7 +172,7 @@ uvx --from sqlsaber saber-mcp
|
|
|
193
172
|
Add SQLSaber as an MCP server in Claude Code:
|
|
194
173
|
|
|
195
174
|
```bash
|
|
196
|
-
claude mcp add -- uvx --from sqlsaber saber-mcp
|
|
175
|
+
claude mcp add sqlsaber -- uvx --from sqlsaber saber-mcp
|
|
197
176
|
```
|
|
198
177
|
|
|
199
178
|
#### Other MCP Clients
|
|
@@ -213,7 +192,7 @@ The MCP server uses your existing SQLSaber database configurations, so make sure
|
|
|
213
192
|
|
|
214
193
|
## How It Works
|
|
215
194
|
|
|
216
|
-
|
|
195
|
+
SQLsaber uses a multi-step agentic process to gather the right context and execute SQL queries to answer your questions:
|
|
217
196
|
|
|
218
197
|

|
|
219
198
|
|
|
@@ -234,7 +213,9 @@ SQLSaber uses a multi-step process to gather the right context, provide it to th
|
|
|
234
213
|
|
|
235
214
|
## Contributing
|
|
236
215
|
|
|
237
|
-
|
|
216
|
+
If you like the project, starring the repo is a great way to show your support!
|
|
217
|
+
|
|
218
|
+
Other contributions are welcome! Please feel free to open an issue to discuss your ideas or report bugs.
|
|
238
219
|
|
|
239
220
|
## License
|
|
240
221
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# build output
|
|
2
|
+
dist/
|
|
3
|
+
# generated types
|
|
4
|
+
.astro/
|
|
5
|
+
|
|
6
|
+
# dependencies
|
|
7
|
+
node_modules/
|
|
8
|
+
|
|
9
|
+
# logs
|
|
10
|
+
npm-debug.log*
|
|
11
|
+
yarn-debug.log*
|
|
12
|
+
yarn-error.log*
|
|
13
|
+
pnpm-debug.log*
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# environment variables
|
|
17
|
+
.env
|
|
18
|
+
.env.production
|
|
19
|
+
|
|
20
|
+
# macOS-specific files
|
|
21
|
+
.DS_Store
|
|
22
|
+
|
|
23
|
+
# jetbrains setting folder
|
|
24
|
+
.idea/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
## Commands
|
|
2
|
+
|
|
3
|
+
- **Start dev server**: `npm run dev`
|
|
4
|
+
- **Build for production**: `npm run build`
|
|
5
|
+
- **Preview production build**: `npm run preview`
|
|
6
|
+
- **Run Astro CLI**: `npm run astro`
|
|
7
|
+
- **Add new shadcn-svelte component**: `npx shadcn-svelte@latest add <ComponentName>`
|
|
8
|
+
|
|
9
|
+
## Architecture
|
|
10
|
+
|
|
11
|
+
This is the documentation website for SQLSaber, built with:
|
|
12
|
+
|
|
13
|
+
- **Astro**: Static site generator with hybrid SSG/SSR capabilities
|
|
14
|
+
- **Svelte**: Component framework for interactive UI elements
|
|
15
|
+
- **shadcn-svelte**: Pre-built component library with Tailwind CSS
|
|
16
|
+
- **TypeScript**: Full type safety across the codebase
|
|
17
|
+
|
|
18
|
+
### Project Structure
|
|
19
|
+
|
|
20
|
+
- `src/pages/`: Astro pages that define routes
|
|
21
|
+
- `src/lib/components/ui/`: shadcn-svelte UI components
|
|
22
|
+
- `src/lib/styles/`: Global CSS and Tailwind configuration
|
|
23
|
+
- `src/lib/utils.ts`: Utility functions for component styling
|
|
24
|
+
- `public/`: Static assets served directly
|
|
25
|
+
|
|
26
|
+
### Key Configuration Files
|
|
27
|
+
|
|
28
|
+
- `astro.config.mjs`: Astro configuration with Svelte integration
|
|
29
|
+
- `components.json`: shadcn-svelte component configuration
|
|
30
|
+
- `tsconfig.json`: TypeScript configuration with path aliases
|
|
31
|
+
- `svelte.config.js`: Svelte preprocessing configuration
|
|
32
|
+
|
|
33
|
+
## Development Guidelines
|
|
34
|
+
|
|
35
|
+
- Use `$lib/*` path aliases for importing from `src/lib/`
|
|
36
|
+
- Follow shadcn-svelte component patterns for UI consistency. If needed, feel free to add new shadcn-svelte components.
|
|
37
|
+
- Astro pages use `.astro` extension, components use `.svelte` unless you create Astro components
|
|
38
|
+
- When using Svelte, exclusively use Svelte 5 syntax only
|
|
39
|
+
- Follow Astro 5 best practices for splitting pages and components wherever appropriate
|
|
40
|
+
- CSS-in-JS via Tailwind classes, global styles in `src/lib/styles/app.css`
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { defineConfig } from 'astro/config';
|
|
3
|
+
|
|
4
|
+
import svelte from '@astrojs/svelte';
|
|
5
|
+
|
|
6
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
7
|
+
|
|
8
|
+
// https://astro.build/config
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
integrations: [svelte()],
|
|
11
|
+
|
|
12
|
+
vite: {
|
|
13
|
+
plugins: [tailwindcss()]
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
site: 'https://sqlsaber.com'
|
|
17
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://shadcn-svelte.com/schema.json",
|
|
3
|
+
"tailwind": {
|
|
4
|
+
"css": "src/styles/app.css",
|
|
5
|
+
"baseColor": "slate"
|
|
6
|
+
},
|
|
7
|
+
"aliases": {
|
|
8
|
+
"components": "$lib/components",
|
|
9
|
+
"utils": "$lib/utils",
|
|
10
|
+
"ui": "$lib/components/ui",
|
|
11
|
+
"hooks": "$lib/hooks",
|
|
12
|
+
"lib": "$lib"
|
|
13
|
+
},
|
|
14
|
+
"typescript": true,
|
|
15
|
+
"registry": "https://shadcn-svelte.com/registry"
|
|
16
|
+
}
|