Using the AI Query Assistant

The AI Query Assistant is a powerful tool within the Onyx Cloud Database that helps you create and modify queries effortlessly. This guide will walk you through accessing the AI Assistant, leveraging its features to enhance your database interactions, and best practices for optimal use.

Introduction

The AI Query Assistant leverages artificial intelligence to help you write, modify, and optimize your database queries. Whether you're a seasoned developer or new to querying databases, the AI Assistant simplifies the process, saving you time and reducing errors.

Accessing the AI Assistant

To start using the AI Query Assistant, follow these steps:

1

Navigate to the Queries Page

From your dashboard, click on the Queries section in the sidebar to access the Queries Page.

2

Open the AI Assistant Panel

On the Queries Page, locate the AI Assistant button located at the top-right corner and click to open the AI Assistant panel.

AI Assistant Button
3

Authorize AI Assistant Access

If prompted, grant the necessary permissions to allow the AI Assistant to access your database schema and queries.

Modifying a Query with AI Assistant

The AI Assistant can help you refine and optimize existing queries. Here's how:

1

Select the Query to Modify

In the Queries Page, click on the query you wish to modify from the list of existing queries.

2

Open the AI Assistant Panel

With the query selected, click on the AI Assistant button to open the AI Assistant panel.

3

Provide Modification Instructions

In the AI Assistant panel, enter the changes or optimizations you want to apply to your query. For example:

  • Improve query performance by adding appropriate indexes.
  • Modify the query to include additional filters.
  • Convert the query to use a different join type.
4

Review and Apply Changes

After submitting your instructions, the AI Assistant will generate the modified query. Review the suggested changes and apply them by clicking Update Query.

AI Modified Query

Creating a New Query with AI Assistant

The AI Assistant can assist in crafting new queries based on your requirements. Follow these steps:

1

Open the AI Assistant Panel

On the Queries Page, click the AI Assistant button to open the AI Assistant panel.

2

Enter Your Query Requirements

In the AI Assistant panel, describe the data you want to retrieve or manipulate. For example:

  • Retrieve all users who signed up in the last month.
  • List products with a price greater than $100.
  • Join the orders and customers tables to display order details.
3

Generate the Query

Click Generate Query to let the AI Assistant create the query based on your instructions.

4

Review and Save the Query

The AI Assistant will display the generated query. Review it for accuracy and click Save Query to add it to your queries list.

Understanding AI Responses

The AI Assistant provides responses based on your input and the database schema. Here's how to interpret its responses:

  • Generated Query: The SQL or NoSQL statement tailored to your request.
  • Suggestions: Recommendations to optimize or enhance your query.
  • Warnings: Alerts about potential issues or inefficiencies in your query.

Tips for Effective Use

To maximize the benefits of the AI Query Assistant, consider the following tips:

  • Be Clear and Specific: Clearly define what you want the query to achieve.
  • Provide Context: Include relevant details about the tables and relationships involved.
  • Review Suggestions: Always review AI-generated queries for accuracy and performance.
  • Iterate as Needed: Use the AI Assistant iteratively to refine and optimize your queries.

Next Steps

Need Help?

If you have any questions or need assistance: