DEV Community

Cover image for SQL queries through REST available now!
Nicolas Penot for Siodb

Posted on

SQL queries through REST available now!

curl -X POST \
-d '[
      {
         "EMAIL" : "dwain.jonhson@gmail.com",
         "FIRST_NAME" : "Dwain",
         "LAST_NAME" : "Jonhson",
         "USERNAME" : "dwainjonhson"
      }
]' \
https://${USER}:${TOKEN}@localhost:50443/database/my_app/tables/users/rows
Enter fullscreen mode Exit fullscreen mode
curl https://${USER}:${TOKEN}@localhost:50443/query?q='select * from my_app.users;'
Enter fullscreen mode Exit fullscreen mode
{
   "status" : 200,
   "rows" : [
      {
         "TRID" : 1,
         "EMAIL" : "jason.statham@gmail.com",
         "FIRST_NAME" : "Jason",
         "LAST_NAME" : "Statham",
         "USERNAME" : "jasonstatham"
      },
      {
         "TRID" : 2,
         "EMAIL" : "dwain.jonhson@gmail.com",
         "FIRST_NAME" : "Dwain",
         "LAST_NAME" : "Jonhson",
         "USERNAME" : "dwainjonhson"
      }
   ]
}
Enter fullscreen mode Exit fullscreen mode
siocli> select * from my_app.users;

TRID   EMAIL                       FIRST_NAME     LAST_NAME     USERNAME
------ --------------------------- -------------- ------------- --------------
     1 jason.statham@gmail.com     Jason          Statham       jasonstatham
     2 dwain.jonhson@gmail.com     Dwain          Jonhson       dwainjonhson

Row(s): 2

Elapsed time: 15 ms.
Enter fullscreen mode Exit fullscreen mode

Available in the cloud => https://datahub.siodb.io

Start your next app with Siodb, 100% encrypted, 100% automated.
Implemented in few minutes through REST API.

P.S. Let me know your feedback :)

Top comments (0)