# Using the Data Agent chat to configure the database

## Viewing the SQL or JavaScript for a Data Agent action

To complete an action to the database, the Data Agent generates either SQL or JavaScript.

In the chat window, the Data Agent uses icons to identify actions that generated SQL or JavaScript.

To view the content of the SQL or JavaScript, click the dropdown icon for the action. To copy the SQL or JavaScript, click the copy icon.

<figure><img src="/files/UjgZDQS442TD5pgJCjqP" alt=""><figcaption><p>Displaying the generated SQL for a step</p></figcaption></figure>

<figure><img src="/files/PU2pB5u8pfPeyN7RHT7i" alt=""><figcaption><p>Displaying the generated JavaScript for a step</p></figcaption></figure>

## Prompting the Data Agent to change the database

After you create the initial version of a database, you use the Data Agent to make adjustments to the database structure and the data values.

For example, the Data Agent might create email addresses that all use a single fake email domain. For more realistic data, you can prompt the Data Agent to change the email addresses to use real personal and commercial email domains.

Or you might ask the Data Agent to add new columns or tables.

## Uploading files to the Data Agent

To provide information for the Data Agent to work from, you can upload files.

A file might, for example, contain the schema to use (`Add a table that uses the attached schema`). Examples of schema files include:

* SQL DDL scripts
* prisma.schema scripts
* Swagger YAML API definitions

Or it might contain a set of example values (`Add a job title column that uses the attached list of values`).

Or it might be a CSV or .xlsx file that contains a list of records (`Use the attached Excel file to create a products table.`)

You can also upload .jpg and .png images. For example, you might upload an image to show the structure of an invoice form that the Data Agent populates from the data.

To upload files to the Data Agent, either:

* Drag and drop the files to the Data Agent.
* Click the attachment icon, then search for and select the files.

<figure><img src="/files/yAHX3QK7D5JZbopouEmS" alt=""><figcaption><p>Data Agent chat prompt with the attachment icon highlighted</p></figcaption></figure>

Note that for a live connection database, you can only import data. You cannot import schema information or other files.

## Copy the text of a Data Agent response

You can copy the content of any Data Agent response. For example, you might want to use the Data Agent summary of its actions in another document.

To copy any response, hover over the response text, then click the copy icon at the bottom right of the response.

<figure><img src="/files/64vXyQJCq97if9bXH7FE" alt=""><figcaption><p>Copy option for a Data Agent response</p></figcaption></figure>

## Reverting a change

If a change produces unexpected results, you can provide another prompt to fix the issue.

You can also revert a change and then try again.

You cannot revert changes to a live connection database.

To revert a change, in the Data Agent chat:

1. Hover over the prompt that initiated the change.

<figure><img src="/files/2L2txypg3boFGaXGrXZC" alt=""><figcaption><p>Revert option for an action to a Data Agent database</p></figcaption></figure>

2. Click the revert icon.
3. Confirm that you want to revert the change.\
   \
   The Data Agent reverts the change. It redisplays the prompt so that you can make adjustments to it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/fabricate/data-agent-chat/data-agent-db-configure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
