SQL Database Reader
Open in CMSThe SQL Database Reader plugin connects your agent to a live SQL database, letting users query business data using natural language. Instead of writing SQL, users ask questions in plain language and the agent translates them into queries, executes them, and returns the results.
How It Works
When a user asks a question, the plugin:
- Translates the natural language question into a SQL query using AI.
- Applies any row-level security policies based on the user's permissions.
- Executes the query against the connected database.
- Returns a formatted, readable result.
All query executions are logged automatically, giving you full visibility into what data was accessed and when.
Supported Databases
| Database | Provider key |
|---|---|
| Microsoft SQL Server, including Azure SQL Database, Azure Synapse and Microsoft Fabric SQL endpoints | sqlserver |
| PostgreSQL | postgresql |
| MySQL | mysql |
| Oracle | oracle |
| Parquet files on your own server, queried there by the on-premise gateway β gateway only (details) | parquet |
Key Features
| Feature | Description |
|---|---|
| Natural language to SQL | Users ask questions in plain language; the plugin generates and executes the SQL. |
| Four data sources | A database (connected directly, or through an on-premise gateway so no port is exposed and Qlar never holds your credentials), an uploaded Excel workbook, or Parquet files queried on your own server. |
| Microsoft Entra ID sign-in | Connect SQL Server, Azure SQL, Synapse and Microsoft Fabric with a service principal instead of a SQL login. |
| Schema-aware queries | You control which tables and columns the agent can access. |
| Virtual foreign keys | Define relationships between tables even when no FK constraint exists in the database. |
| Row-Level Security | Restrict query results based on the user's permissions. |
| Query testing | Translate and execute queries in a safe testing panel before going live. |
| Usage logs | Track every query execution with the question, generated SQL, status, and row count. |
Setup Flow
Follow these steps in order to configure the plugin:
- Set up the database connection β choose an access mode, then enter credentials and test connectivity. If a database port cannot be opened to Qlar, use the on-premise gateway instead.
- Configure tables and columns β select what data the agent can see.
- Set up virtual foreign keys β define cross-table relationships if needed.
- Configure the function tool β define how the plugin appears to the AI.
- Test your queries β validate SQL generation before deployment.
- Configure row-level security β restrict data access by user permissions.
- Monitor usage logs β review query history and download logs.
Prerequisites
Before creating a plugin instance:
- A running SQL database β either reachable from Qlar, or reachable from a machine of yours that can run the on-premise gateway.
- A read-only database user with access to the target tables β or, for SQL Server / Azure SQL / Fabric, a Microsoft Entra ID service principal with read access to the data.
- A list of tables and columns the agent is allowed to query.
- A data governance decision on whether row-level security is required.