Skip to content

Quick Start

Shashank Patil edited this page Jul 26, 2026 · 1 revision

Quick Start

This guide demonstrates how to create and execute your first SQL API using the Generic SQL API Framework.


Step 1: Create a SQL Query

Create a new SQL file inside the queries directory.

Example:

queries/customers.sql
SELECT
    CustomerID,
    CustomerName,
    City,
    MobileNumber
FROM CustomerTable;

Step 2: Create a JSON Request

Create a JSON request that references the SQL file.

{
    "query": "customers"
}

The framework automatically locates and executes:

queries/customers.sql

Step 3: Send the Request

Example HTTP request:

POST /api/query

Content-Type: application/json

Request Body:

{
    "query": "customers"
}

Step 4: Receive the Response

{
    "success": true,
    "rows": [
        {
            "CustomerID": 1,
            "CustomerName": "John",
            "City": "Bangalore",
            "MobileNumber": "9876543210"
        }
    ]
}

Using Parameters

The framework also supports parameterized queries.

SQL:

SELECT *
FROM CustomerTable
WHERE CustomerID = :CustomerID;

JSON Request:

{
    "query": "customer_by_id",
    "parameters": {
        "CustomerID": 101
    }
}

What's Next?

Now that you've executed your first query, continue with:

  • Database Configuration
  • JSON Request Format
  • SQL Query Files
  • Validation Engine
  • Advanced Query Examples

Clone this wiki locally