Create an SQL Report API in 5 minutes

Can you create an SQL Report API endpoint in 5 minutes? Let's try. We'vegot Hyperlambda, so it should be easy, right?

Create an SQL Report API in 5 minutes

In addition to generating CRUD APIs, Aista Magic Cloud also allows you to generate API endpoints using nothing but SQL. The generator will take care of stuff such as authorisation, logging, generating the boiler plate code, etc. All you need to worry about is your SQL.

SQL endpoint generator

The whole point about Hyperlambda is that it's a declarative programming language. When you have a declarative programming language, the computer can automatically generate a large portion of your code, through a process that's similar to how you do it as you copy and paste code from StackOverflow. This implies that even though you can't code in anything but SQL, you can still create Web API endpoints - Because Magic does everything for you, as long as you provide some SQL to it.

In the video below I am demonstrating the whole process. If you want to reproduce what I'm doing, signup at Hub and create your own cloudlet.

The code that Magic produces can be found below.

 * Template for custom SQL HTTP request.
 * This file was automatically generated using Magic's CRUDifier.

// Opening up a database connection

   // Parametrizing [].

   // Evaluating [] slot."\n/*\n * Script to aggregate records for each artist in chinook database.\n * Make sure you select the chinook database before execxuting the script.\n */\nselect ar.Name, count(*) as count\n  from Album al, Artist ar where al.ArtistId = ar.ArtistId and ar.Name like @filter\n  group by al.ArtistId\n  order by count desc\n  limit 25\n"

    * Checking if we should return a list of items, or only a
    * single item.

         // Returning a list of items to caller.*

   // Returning a single result to caller.*/*

Thank you for reading :)

Free Trial

Want to try before you buy?

Try for Free for 7 days

No Payment Method Required

Need help? 🤝

Need help with setup?

Drop us a message and let's get started! 💬