Configure Tables and Columns
After loading the database schema, you select which tables and columns the agent is allowed to query. The plugin only generates SQL against the tables and columns you include here — everything else is invisible to the AI.
Navigate to Actions → Plugins → SQL Database Reader → Schema in the agent sidebar.
Selecting Tables
The panel shows all tables discovered from the database connection. Check each table you want to include in the agent's query scope.
For each selected table, add a description — a short note explaining what business data the table contains. This description is fed directly into the AI prompt and affects query quality. Without it, the AI relies only on table and column names to infer purpose.
Example table description:
Stores the master list of customers including their contact information, account status, and assigned sales region.
Selecting Columns
For each selected table, expand it to see its columns. Each column can be individually included or excluded.
Columns you exclude will not appear in generated queries. Use this to:
- Hide sensitive fields such as passwords, internal codes, or PII.
- Reduce irrelevant context that may confuse SQL generation.
- Narrow the AI's attention to the most useful data.
Column properties
| Property | Description |
|---|---|
| Column Name | The name of the column in the database. |
| Type | The data type, e.g. varchar, int, datetime. |
| Nullable | Whether the column accepts null values. |
| Primary Key | Whether the column is the table's primary key. |
| Description | A short note explaining what this column stores. Improves query accuracy. |
Writing good column descriptions
Column descriptions are included in the AI's schema context. The more precise your descriptions, the more accurate the generated SQL will be.
| Column name | Poor description | Good description |
|---|---|---|
status | Status | Order status: pending, confirmed, shipped, cancelled |
amt | Amount | Total invoice amount in USD before tax |
cust_id | Customer ID | Foreign key referencing customers.id |
region | Region | Sales region code assigned to the customer's account |
Data Dictionary
When you save the schema configuration, the plugin generates a data dictionary from your table selections and descriptions. This dictionary is used as context in every query generation prompt.
If you add new tables, change column selections, or update descriptions, save again to regenerate the data dictionary.
Next Steps
- Set up virtual foreign keys to define relationships the database does not enforce natively.
- Configure the function tool to name the plugin and define its behavior for the AI.