Tryb SQL — zapytania do repozytorium EA
SQL nie jest oddzielnym trybem ani ręcznym edytorem zapytań. To narzędzie wywoływane automatycznie przez model w pętli agentowej, gdy potrzebuje danych z repozytorium EA. Wystarczy zadać pytanie w języku naturalnym.
Jak to działa
- Zadajesz pytanie o dane z repozytorium (np. „Pokaż wszystkie ApplicationComponent z flagą TIME=RED")
- Model sam decyduje, że potrzebuje danych i wywołuje narzędzie
ea_sql_query - Wynik wraca do modelu jako tabela tekstowa
- Model formułuje odpowiedź w języku naturalnym
Dostępne tabele EA
| Tabela | Zawartość |
|---|---|
t_object | Elementy (klasy, komponenty, aktorzy itp.) |
t_connector | Relacje między elementami |
t_diagram | Diagramy |
t_package | Pakiety (foldery) |
t_attribute | Atrybuty elementów |
t_objectproperties | Tagged values elementów |
Zabezpieczenia (guardrails)
- Tylko SELECT — zapytania modyfikujące (INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE) są odrzucane. SQL w OneRAI jest zawsze read-only.
- Limit 100 wierszy — wynik przekazywany do modelu jest ograniczony do 100 wierszy.
- Automatyczne poprawki dialektu bazy (SQL Server ↔ inne backendy EA).
Przycisk „SQL" w nagłówku okna Chat
Przycisk SQL w pasku nagłówka nie otwiera edytora zapytań. Jego faktyczna funkcja: eksportuje ostatni wynik narzędzia do okna Output EA (zakładka „OneRAI"). Przycisk staje się aktywny dopiero po wykonaniu przez model przynajmniej jednego narzędzia w bieżącej rozmowie.
Przykłady użycia
- Znajdź wszystkie ApplicationComponent bez opisu
- Sprawdź duplikaty nazw elementów
- Pobierz listę elementów zmodyfikowanych w ostatnim miesiącu
- Zlicz elementy według stereotypu
- Pokaż wszystkie ApplicationComponent z wartością tagu TIME=RED
SQL Mode — Repository Queries
SQL is not a separate mode or a manual query editor. It is a tool invoked automatically by the model in the agentic loop whenever it needs data from the EA repository. Simply ask a question in plain language.
How It Works
- Ask a question about repository data (e.g. "Show all ApplicationComponents with TIME=RED")
- The model decides it needs data and invokes the
ea_sql_querytool - The result returns to the model as a text table
- The model formulates a natural language answer
Available EA Tables
| Table | Contents |
|---|---|
t_object | Elements (classes, components, actors, etc.) |
t_connector | Relations between elements |
t_diagram | Diagrams |
t_package | Packages (folders) |
t_attribute | Element attributes |
t_objectproperties | Element tagged values |
Guardrails
- SELECT only — modifying queries (INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE) are rejected. SQL in OneRAI is always read-only.
- 100-row limit — results passed to the model are capped at 100 rows.
- Automatic dialect corrections (SQL Server ↔ other EA backends).
The "SQL" Button in the Chat Header
The SQL button in the header bar does not open a query editor. Its actual function: exports the last tool result to the EA Output window ("OneRAI" tab). The button becomes active only after the model has executed at least one tool in the current conversation.
Usage Examples
- Find all ApplicationComponents without a description
- Check for duplicate element names
- Get a list of elements modified in the last month
- Count elements by stereotype
- Show all ApplicationComponents with tag value TIME=RED