dbagent-cli 0.8.7__tar.gz → 0.8.8__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.
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/PKG-INFO +1 -1
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/__init__.py +1 -1
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/generator.py +8 -20
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent_cli.egg-info/PKG-INFO +1 -1
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/pyproject.toml +1 -1
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/README.md +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/confidence.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/conversation.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/doctor.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/error_classifier.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/pipeline.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/recommender.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/agent/validator.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/cli.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/config.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/connectors/base.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/connectors/factory.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/connectors/mongo.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/connectors/relational.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/execution/__init__.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/execution/cache.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/execution/changeset.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/execution/cost.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/execution/recovery.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/execution/sandbox.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/execution/streaming.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/anthropic_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/auto_setup.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/base.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/deepseek_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/factory.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/gemini_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/groq_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/mistral_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/mock_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/ollama_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/openai_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/llm/openrouter_provider.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/schema/cache.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/schema/formatter.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/schema/graph.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/schema/models.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/schema/retriever.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/schema/selector.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/security/__init__.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/security/audit.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/security/environment.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/security/masking.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/security/modes.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/security/rbac.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/semantic/__init__.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/semantic/dictionary.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/semantic/templates.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/sql/__init__.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/sql/optimizer.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/sql/validator.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/ui/chat_screen.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/ui/console.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/ui/grid_window.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/ui/viewer.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent/ui/visualizer.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent_cli.egg-info/SOURCES.txt +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent_cli.egg-info/dependency_links.txt +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent_cli.egg-info/entry_points.txt +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent_cli.egg-info/requires.txt +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/dbagent_cli.egg-info/top_level.txt +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/setup.cfg +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_cache.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_cli.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_connectors.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_direct_sql.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_doctor_and_viz.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_generator.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_graph.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_providers.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_recovery.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_safety.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_sandbox.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_schema.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_security.py +0 -0
- {dbagent_cli-0.8.7 → dbagent_cli-0.8.8}/tests/test_semantic.py +0 -0
|
@@ -47,17 +47,12 @@ Generate ONLY the raw executable SQL query for the given database. No markdown f
|
|
|
47
47
|
{schema_context}
|
|
48
48
|
|
|
49
49
|
### Rules:
|
|
50
|
-
1. Output ONLY the SQL query — nothing else. No ```sql fences, no explanations.
|
|
50
|
+
1. Output ONLY the executable SQL query — nothing else. No ```sql fences, no explanations.
|
|
51
51
|
2. Use the exact table and column names from the schema above.
|
|
52
52
|
3. Use dialect-specific syntax for `{dialect_name}`.
|
|
53
53
|
4. Write clean, optimized SQL with uppercase keywords.
|
|
54
|
-
5.
|
|
55
|
-
6.
|
|
56
|
-
SELECT tc.table_name, kcu.column_name, ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name
|
|
57
|
-
FROM information_schema.table_constraints tc
|
|
58
|
-
JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name
|
|
59
|
-
JOIN information_schema.constraint_column_usage ccu ON tc.constraint_name = ccu.constraint_name
|
|
60
|
-
WHERE tc.constraint_type = 'FOREIGN KEY';
|
|
54
|
+
5. Always query the user's actual database tables and junction/mapping tables from the schema context, using foreign key relationships for JOINs.
|
|
55
|
+
6. If the user asks for recent/time-based data, use native datetime functions (e.g. for PostgreSQL: `NOW() - INTERVAL '1 hour'`, for SQLite: `datetime('now', '-1 hour')`, for MySQL: `NOW() - INTERVAL 1 HOUR`).
|
|
61
56
|
7. Always include appropriate WHERE clauses, JOINs, and ORDER BY as needed.
|
|
62
57
|
8. Default to LIMIT 50 unless the user specifies a count.
|
|
63
58
|
9. For status, active, or flag columns (e.g. `active`, `is_active`, `status`, `enabled`, `deleted`):
|
|
@@ -86,7 +81,7 @@ You are chatting with the user in the interactive database shell.
|
|
|
86
81
|
|
|
87
82
|
# --- Architectural / Linkage analysis prompt ---
|
|
88
83
|
|
|
89
|
-
ARCHITECTURE_SYSTEM_PROMPT = """You are DB-Agent,
|
|
84
|
+
ARCHITECTURE_SYSTEM_PROMPT = """You are DB-Agent, an elite Principal Database Architect, Data Modeler, and Systems Engineer.
|
|
90
85
|
Target Database Context:
|
|
91
86
|
- **Dialect**: {dialect_name}
|
|
92
87
|
- **Database Name**: {database_name}
|
|
@@ -94,23 +89,16 @@ Target Database Context:
|
|
|
94
89
|
### Detailed Schema Sub-Graph Context (Tables, Columns, Primary Keys, Foreign Keys, Sample Data):
|
|
95
90
|
{schema_context}
|
|
96
91
|
|
|
97
|
-
The user is asking
|
|
92
|
+
The user is asking a question regarding database architecture, entity relationships, linkages, mappings, data flows, or structural design.
|
|
98
93
|
|
|
99
|
-
|
|
94
|
+
Analyze the provided schema and the user's question, and produce a clear, authoritative, and comprehensive architectural response structured as follows:
|
|
100
95
|
|
|
101
96
|
### 1. 🗺️ Entity-Relationship & Linkage Architecture Diagram
|
|
102
97
|
Provide a clean, readable ASCII / Unicode box diagram showing the entities, relationship paths, cardinality (1:1, 1:N, N:M junction tables), and the exact connecting foreign keys / join keys.
|
|
103
|
-
Example structure:
|
|
104
|
-
```text
|
|
105
|
-
┌──────────────┐ ┌──────────────────────┐ ┌───────────────┐
|
|
106
|
-
│ ivis_user │ 1 ──── * │ ivis_tenant_user_map │ * ──── 1 │ ivis_tenant │
|
|
107
|
-
└──────────────┘ └──────────────────────┘ └───────────────┘
|
|
108
|
-
(pk_user_id) (fk_user_id) (pk_tenant_id)
|
|
109
|
-
```
|
|
110
98
|
|
|
111
99
|
### 2. 📐 Architectural & Theoretical Breakdown
|
|
112
|
-
- Explain in clear theoretical and domain terms how the entities map to each other.
|
|
113
|
-
- Highlight the mapping
|
|
100
|
+
- Explain in clear theoretical and domain terms how the entities map to each other in this database.
|
|
101
|
+
- Highlight the mapping mechanisms (direct foreign keys, junction/mapping tables, hierarchical ownership).
|
|
114
102
|
- Detail the cardinality, tenant isolation, and user access models represented in the schema.
|
|
115
103
|
|
|
116
104
|
### 3. 🔍 How to Query & Verify Mappings (SQL Examples)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dbagent-cli"
|
|
7
|
-
version = "0.8.
|
|
7
|
+
version = "0.8.8"
|
|
8
8
|
description = "Enterprise AI Database Copilot, Schema Graph Introspector & Autonomous Recovery Agent (CLI)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|