Querydeck Docs
  • 👋Welcome to Query Deck
  • Getting Started
    • 😃Get Started With QueryDeck
      • Quickstart With QueryDeck
    • How It Works?
  • REST
    • Select Method
      • Joins
      • Sorting
        • Ascending/ Descending ordering
        • Dynamic Sorting
      • Filter
        • Dynamic Filtering
        • Groups
        • Exists clause
      • Pagination
        • Offset
        • Limit
    • Insert/Upsert Method
      • Nested Inserts (Joins)
      • Conflicting Columns
    • Update Method
      • Filters
    • Delete Method
    • Authentication
    • Authorization
    • Select by Id
  • GraphQL
    • Introduction to GraphQL in QueryDeck
    • Enabling GraphQL for Columns in QueryDeck
  • Testing Endpoints
Powered by GitBook
On this page
  • Overview
  • Using the Select Method
  • Testing
  1. REST

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 and offset.

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

  1. Open the Endpoint:

    • In the left side pane, click on the API endpoint you just created.

  2. Copy the Endpoint URL:

    • Click on Request at the top-right corner to copy the endpoint URL to your clipboard.

  3. 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 a Select query).

  • Click on the Send button.

  • View the API response in the Postman interface.

You have now successfully tested your first Select query!

PreviousHow It Works?NextJoins

Last updated 3 months ago