Select Method
Overview
The Select method in QueryDeck allows you to retrieve data from your database using RESTful API endpoints. This method is essential for fetching specific records from a table. You can apply advanced filtering, sorting, and pagination techniques to customize your queries and get the precise data you need.
With QueryDeck’s Select method, you can:
Retrieve specific columns to optimize data transfer.
Apply conditions to filter records.
Use sorting for ordered results.
Implement pagination using
limit
andoffset
.
It is a versatile method designed to enhance data access efficiency while ensuring that you only fetch the required information.
Using the Select Method
Once you are logged in, follow these steps to create and test your first Select
query:
1. Access the App
Click on the Demo App button located at the bottom-right corner of the screen.
This opens QueryDeck's demo environment where you can test API features.
It doesn't have to be the demo app, you may choose any app of your choice.
2. Select a Base Table
In the app window, choose a base table to query. For this example, we'll use the
customers
table.Select the desired table from the dropdown menu.
3. Choose the Query Method and Route Name
Set the following options in the left pane:
Method: Select
Select
as the query method.Route Name: By default, this will be the table name (e.g.,
customers
), but you can customize it if needed.
4. Add Query Parameters (Optional)
You can define filters, joins, and additional query parameters as needed.
For this example, we will proceed without extra query parameters.
5. Save the API Endpoint
Once configured, click on the Save button.
Your API endpoint is now created successfully!
Testing
Open the Endpoint:
In the left side pane, click on the API endpoint you just created.
Copy the Endpoint URL:
Click on Request at the top-right corner to copy the endpoint URL to your clipboard.
Test the Endpoint in Postman:
Open Postman (or any API testing tool).
Paste the copied URL into the input field next to the request method.
Ensure the request method is set to
GET
(default for aSelect
query).Click on the Send button.
View the API response in the Postman interface.
You have now successfully tested your first Select
query!
Last updated