User Guide: Managing Queries with Kotlin
Welcome to the Onyx Cloud Database User Guide for managing queries using Kotlin. This guide will walk you through creating, executing, viewing results, sharing, applying query categories, and updating your queries effectively.
Creating a Query
Creating a new query allows you to interact with your database using Kotlin scripts. Follow these steps to create a new query.
Navigate to the Queries Page
From your dashboard, select the Queries Page to manage your database queries.
Click on 'Create New Query'
On the Queries Page, click the Create New Query button to open the query creation modal.
Fill in Query Details
Provide the necessary details for your query:
- Query Name: Assign a meaningful name to your query.
- Category: Select or create a category to organize your query.
- Public: Toggle this option if you want to share the query with your team.
Write Your Kotlin Query
In the query editor, write your Kotlin script to interact with the database. Utilize the Query Scripting Tutorial for detailed instructions.
Save Your Query
After writing your query, click the Save button to store it in your queries list.
Executing a Query
Running your Kotlin query allows you to fetch and manipulate data within your database. Follow these steps to execute your query.
Select Your Query
From the Queries Page, select the query you wish to execute by clicking on its name.
Click on 'Execute Query'
With your query selected, click the Execute Query button located in the top menu to run the script.
Monitor Execution Status
A spinner will appear indicating that your query is being processed. You can cancel the execution at any time by clicking the Cancel button.
Viewing Results
After executing a query, you can view the results in various formats. This section explains how to navigate through the different result panels.
Access the Results Panel
Once the query execution is complete, the results panel will appear at the bottom of the screen.
Switch Between Result Panels
The results can be viewed in three different panels:
- Grid Results: Displays data in a tabular format.
- Tree Results: Shows data in a hierarchical tree structure.
- Console: Displays logs and compile errors.
Click on the respective tabs to switch between these panels.
Interacting with Grid Results
The Grid Results panel provides a spreadsheet-like view of your data. You can sort, filter, and paginate through the records.
Exploring Tree Results
The Tree Results panel presents your data in a nested tree structure, allowing for easy navigation through hierarchical relationships.
Reviewing Console Logs
The Console panel displays logs, compile errors, and other diagnostic information. This is useful for debugging and monitoring query execution.
Applying Query Categories
Organizing your queries into categories helps maintain structure and improves accessibility. Here's how to apply categories to your queries.
Access the Query Creation Modal
From the Queries Page, click on Create New Query to open the query creation modal.
Select or Create a Category
In the Category field, select an existing category from the dropdown or type a new category name to create one on the fly.
Assign the Category to Your Query
After selecting or creating a category, assign it to your query by ensuring the category name is correctly filled in the Category field.
Updating a Query
Keeping your queries up-to-date ensures they remain effective and relevant. Follow these steps to update an existing query.
Select the Query to Update
Navigate to the Queries Page and click on the query you wish to update.
Open the Query Editor
Click on the Edit button to open the query editor.
Modify the Kotlin Script
Make the necessary changes to your Kotlin script in the editor. Ensure that your modifications adhere to Kotlin syntax and the database schema.
Save the Updated Query
After making your changes, the query will automatically be saved.
Execute the Updated Query
With the query updated, click the Execute Query button to run the revised script and view the new results.
Next Steps
Need Help?
If you have any questions or need assistance:
- Email:[email protected]
- Documentation: Visit ourHelp Centerfor tutorials and FAQs.