Neurelo Build Docs
Neurelo Build Docs
  • Introduction
    • Core Concepts
    • Key Features
  • Getting Started
    • Sign-in/Sign-up
    • Dashboard
      • Collapsible Sidebar
      • Light/Dark Mode
      • Account Settings
      • Audit Events
      • User Management
        • Permissions (Member v/s Admin)
      • Org Settings
    • Starting your Neurelo Project
      • Quick Start Guide
      • Step 1 - Add a Data Source
      • Step 2 - Build Definitions
      • Step 3 - Create an Environment
      • Step 4 - Create an API Key
      • Step 5 - Start Runners
      • Try your Neurelo APIs
  • "How to" Videos
    • Product Overview
    • Neurelo APIs & SDKs
    • Project Setup
    • Definitions
    • Environments
    • Data Sources
    • Organization Management
    • Creating and Using Custom Queries
    • Using the Schema Builder to build Relationships
    • Mock Data Generation
  • Definitions
    • Neurelo Schema Editor
      • Schema Builder
      • JSON/YAML Editor
      • Schema Visualization: Entity-Relationship Diagram (ERD)
    • Custom APIs for Complex Queries
      • Write and Commit Custom Queries
      • AI-Assisted Query Generation
      • Deploying Custom API Endpoints
      • Using Variables in your Custom Query
    • Branches and Commits
    • API Docs
  • Environments
    • Creating a new Environment
    • API Playground
    • Observability
    • Migrations
    • API Keys
  • Data Sources
    • PostgreSQL
    • MySQL
    • MongoDB
  • Guides
    • Provisioning Cloud Databases for using with Neurelo
      • PostgreSQL
        • AWS RDS (PostgreSQL)
      • MySQL
        • AWS RDS (MySQL)
      • MongoDB Atlas
    • Mock Data Generation
    • Wipe Data Source
    • Remote Git Repository for Definitions
      • Connecting a Remote Git Repo
      • Creating Commits from Neurelo
      • Syncing Branches
    • Data Viewer
    • Environment/Data Source Tags
    • How to work with Embedded documents and References in MongoDB
    • How to download and use the Postman Collection for your Project
    • Building Python applications with Postgres and FastAPI
    • CI Integration using Neurelo CLI
    • Schema Migrations
    • Schema AI Assist
    • Auto-Introspection
    • Access Policies
    • User Auth
      • Google
      • GitHub
      • GitLab
    • MongoDB Atlas - Migrate GraphQL to Neurelo
    • MongoDB Atlas - Migrate REST Data APIs to Neurelo
  • MongoDB Atlas - Migrate REST Data APIs to Neurelo
  • MongoDB Atlas - Migrate GraphQL APIs to Neurelo
  • Neurelo Schema Language (NSL)
    • Example 1 - DVD Rentals
    • Example 2 - Simple "Posts" App
    • Example 3 - Bookstore
  • Neurelo API Reference (REST)
    • Examples of Neurelo Auto-Generated REST API endpoints
      • Example 1 - Simple “Posts” application
      • Example 2 - "DVD Rentals" application
      • Example 3 - "Bookstore” application
      • cURL API Examples
  • Neurelo API Reference (GraphQL)
  • SDKs
    • TypeScript / JavaScript SDK
    • Go SDK
    • Python SDK
      • Python SDK Tutorial -- News Application
        • News Application using Neurelo’s Python SDKs
  • CLI (Preview Version)
  • Self-Hosted Neurelo Gateways
  • Tutorials
    • Building a Real Time Chat Application with Neurelo and MongoDB using Python
    • Building A Financial Terminal with Neurelo and MongoDB in Rust
    • Building a Restaurant Management System with Neurelo and MongoDB using GraphQL in just a few minutes
    • Bringing Neurelo’s Data APIs to Life Instantly with MySQL
  • Project Examples
  • References
    • Supported Databases
    • Supported OS and Browsers
  • Support
Powered by GitBook
On this page
  • Overview
  • Navigating and Utilizing the Custom Queries Section in Neurelo
  1. Definitions

Custom APIs for Complex Queries

Overview

You can create Custom REST or GraphQL API endpoints for your user-defined complex queries for specific read/write operations on the database.

Neurelo auto-generates a rich set of APIs from your schema for the project. However, there are times when you need to extend this capability for complex operations you may want to run from your application. A complex query normally involves more intricate and sophisticated operations than can be supported using Neurelo's Auto-Generated APIs.

  • Custom APIs for Complex Queries is a powerful feature that allows users to leverage native query code (SQL or MQL), save them as API endpoints, and run operations in the database using these endpoints from your application.

  • Custom APIs can be created for MySQL, PostgreSQL, or MongoDB databases, and can be integrated into a wide range of applications and websites.

  • Custom APIs are supported both as REST endpoints or GraphQL endpoints

Complex queries usually involve multiple criteria, conditions, or operations to extract specific and nuanced information from the database.

For example in relational databases, complex queries often include features such as:

  1. Multiple Tables: Involving complex joins across multiple database tables to retrieve data from related sources.

  2. Aggregation: Using aggregate functions (like sum, avg, count) to perform calculations on groups of data.

  3. Subqueries: Nesting one query inside another to retrieve data in a step-by-step manner.

  4. Conditional Logic: Applying complex conditions using logical operators (AND, OR) for filtering data based on specific criteria.

While many of these complex queries can be performed using Neurelo's Auto-Generated API endpoints, sometimes users need to extend the capability to beyond what can be done with the auto-generated APIs.

Neurelo offers users the ability to write and test custom queries against their data sources in a project and to create API endpoints from these custom queries. This capability allows users to extend Neurelo's APIs and to have complete flexibility to query and update the data from their data sources.

Navigating and Utilizing the Custom Queries Section in Neurelo

Here’s how to access and use this section:

  1. Accessing Custom Queries:

    • Navigate to the "Definitions" section on your Neurelo Dashboard inside a project. Within Definitions, you will fine the tabs "Schema," "Custom Queries," and "Docs."

    • Click on the "Custom Queries" tab to enter this section.

  2. Capabilities in Custom Queries Section:

    • Write Custom Queries: Utilize the query editor to write and refine custom database queries.

    • Search Feature: Browse through all your available custom queries using the search functionality.

    • Create API Endpoints: Generate API endpoints with methods like "GET" "POST", "PATCH", and "DELETE" for REST and turning your queries into accessible endpoints for developers. You can also build Custom APIs for GraphQL for Queries or Mutations.

    • Custom API Endpoint Naming: Assign names to your Custom Query API endpoints. Once deployed, you can call these endpoints using the assigned name at

      • /custom/<endpointName> for REST using the configured HTTP method

      • custom_endpointName for GraphQL as the field name in a Query or Mutation

    • AI-Assisted Query Generation: Leverage AI assistance to generate custom queries using conversational text, simplifying the query creation process.

    • Test Queries: Test your queries written in the editor to ensure accuracy and expected outcomes.

    • Set Execution Timeouts: Define upper limits on the execution time for your queries, ranging from 0 to 60,000 milliseconds, to have predictable performance. If the query runs longer for the configured execution time, it will be terminated.

    • Commit on Branches: Commit your queries into your working branch.

The Custom Queries workspace in Neurelo is a powerful capability, empowering you to manage extend Neurelo capabilities for your application by utilizing AI for enhanced query code generation, all contributing to a more efficient and powerful application development process.

PreviousSchema Visualization: Entity-Relationship Diagram (ERD)NextWrite and Commit Custom Queries

Last updated 1 year ago