Query Basics

A query is a structured request that allows you to retrieve specific data from a database by defining conditions, inputs, and output options. In this platform, a query is similar to SQL's "SELECT" statement. Once created, the query is automatically translated into API endpoints that can be used to access data in real time. These API endpoints can be integrated into applications or other systems to retrieve data based on the query's configuration.

Key Components of a Query

  1. Main Entity

    • The Main Entity is the primary entity from which the query begins. It forms the foundation for the data retrieval process, determining the focus of the query. It is similar to the table selected in the SQL "FROM" clause.

    • Example: The "Employee" entity would be the Main Entity when retrieving employee details. All conditions and outputs will relate to this entity.

  2. Inputs

    • Inputs are parameters that can be set dynamically at runtime, allowing the query to adapt to different conditions, similar to SQL parameters.

    • Example: To filter employees by department:

      • DepartmentName: The end user would specify the Department, such as "Finance" or "Marketing."

  3. Authorization Policies

    • Authorization policies define who can execute the query, ensuring that only authorized users can call the API and retrieve the data, similar to SQL permissions.

    • Example: If the query retrieves sensitive data like employee salaries, you can restrict execution to HR managers.

  4. Query Conditions:

    • Query conditions define the criteria data must meet to be included in the results, similar to the "WHERE" clause in SQL. Conditions can be applied to properties of the Main Entity or related entities through joins.

    • Example: To retrieve only active employees, you can set a condition like Status = "Active" and join the "Department" entity to filter by location with Department.Location = "New York".

  5. Query Outputs:

    • Query outputs define which properties from the Main Entity and related entities are included in the results, like the columns in an SQL "SELECT" statement.

    • Example: In an employee query, you might choose to return the following properties:

      • EmployeeName

      • DepartmentName

      • HireDate

      • Status

  6. Output Options:

    • Output options provide control over the format and behavior of the query results, similar to SQL clauses and modifiers. These include:

      • Is Distinct: Ensures that the query returns unique records, removing duplicates.

      • No Lock: Allows data retrieval without locking database records during execution, improving performance in read-heavy environments.

      • Is Paginated: Enables pagination, returning data in chunks, which is useful for managing large datasets.

      • Sort By: Defines the sorting order of results based on specific properties.

    • Example: You might set the query to return distinct results, sorted by DepartmentName and HireDate, and enable pagination to manage large datasets. The "No Lock" option can be used to improve performance.


Queries in this platform function similarly to SQL SELECT statements, allowing you to retrieve and filter data based on specific criteria. Each query is translated into an API, which can be securely accessed and customized with dynamic inputs, conditions, and output options to meet specific data needs.

Last updated