[erlang-questions] sqlapi: library to connect to your erlang server via SQL

Edmond Begumisa ebegumisa@REDACTED
Tue Mar 20 12:30:48 CET 2018


Wow. EXCELLENT WORK!!

This is an *AWESOME* extremely useful idea. And your timing couldn't have  
been more perfect for me.

I work on a team where there are a number of non-Erlang programmers.  
Frequently, I encounter two time-consuming tasks that this could solve:

1. Expose an API to an OTP app for non-Erlangers on the team to access.
2. Expose a CLI for operators and other programmers.

I frequently go through the pain of writing yet another HTTP API to deal  
with 1). Your tool can make it easy in many instances to whip up a  
prototype API accessed over SQL for python, js and other developers to  
use. Everyone on my team who doesn't speak Erlang speaks fluent SQL.  
Moreover SQL would make an API very flexible.

I usually deal with 2) by adding custom REPL to the Erlang SSH app. This  
also involves some tedium because for the CLI to be useful, it has to be  
flexible which means you have to envisage all kinds of scenarios that  
operators will want to deal with. A WMI-like SQL CLI would make this much  
much easier since where we deploy, operators also tend to speak SQL.

And this week, I just started working on a dreaded HTTP API for a new OTP  
app. I can abandon that code now!

Thanks a lot for this. I think this is going to have a profound impact on  
my projects.

- Edmond -


On Tue, 13 Mar 2018 01:34:53 +1100, Max Lapshin <max.lapshin@REDACTED>  
wrote:

> Hi.
>
>
> We have released our sqlapi library:  https://github.com/flussonic/sqlapi
>
> This library can help you to make an SQL server from your existing  
> server.
>
> For example you have a server and let it be ejabberd. You want to give a  
> list of connected users.
> Of course you will start from making HTTP endpoint that will reply with  
> JSON with list of users.
>
> Then you will add some sort, filter, paging as query params and then  
> will write library that allows >to make all this params and send them.
>
> Another option is to put our sqlapi library, connect it to storage of  
> connected users and then >connect to server as if it is a SQL server.
>
>
> Here another real example:  https://flussonic.com/doc/api/sql-cluster    
> User can connect to our >flussonic server and access whole cluster by  
> sending commands like INSERT, UPDATE, DELETE or READ.
>
>
> This approach may be convenient if you have table data and mainly CRUD  
> operations.
>
>
> Similar approach is used in Sphinx search engine:   
> http://sphinxsearch.com/docs/latest/sphinxql.html
>
> We have created all this to connect from python sqlalchemy and Ruby on  
> Rails to Flussonic.
> If you want the same, this library may help.
>
>
> the only dependency is ranch and it is optional, not required for tests.
> Some code is derived from https://github.com/altenwald/myproto but we  
> had to remove neotoma sql >parser, because we need speed!  Thanks for  
> https://github.com/master/mongosql/blob/master/src/>sql92_parser.yrl
>
>
>
>



-- 
Using Opera's mail client: http://www.opera.com/mail/



More information about the erlang-questions mailing list