Re: RPC via WebSockets.

From: Dmitry Igrishin <dmitigr(at)gmail(dot)com>
To: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: RPC via WebSockets.
Date: 2020-01-18 05:36:34
Message-ID: CAAfz9KNzQx1BqqKnV9h+6w3dFdQvR5PYj75YW4AEeJwFG1Fi5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 18 Jan 2020, 05:54 Nikolay Samokhvalov, <samokhvalov(at)gmail(dot)com>
wrote:

> This is a very common task, definitely.
>
> As for WebSockets, there is an addition to PostgREST, postgrest-websockets
> https://github.com/diogob/postgres-websockets#readme
>
Yep, but as it's addition, it's not first class citizen and requires extra
steps to install it. While this is possible it's not user friendly. I would
like to fix this :-)

> PostgREST is not only for "give me contents", you can write functions (in
> any PL) and call them using POST /rpc/functionname.
>
This is what I want to emphasize on at first: calling functions, written in
any PL via JSON-RPC. There's also plans to execute any named queries
conveniently stored in text files, for example, foo.sql might contains:

-- @id my-query1
select :name::text

-- @id my-query2
select :age::integer

And then the caller can call these queries by ID, providing the parameter
values as simple as regular RPC call.

> There is also an attempt to build similar tool in Go (although I'm not
> sure how popular and powerful it is): pREST https://github.com/prest/prest
>
> Finally, there is a whole line of trendy and quite popular tools for
> having GraphQL on top of Postgres, including but not limited to:
> - PostGraphile https://github.com/graphile/postgraphile
> - Hasura https://github.com/hasura/graphql-engine
> - Prisma https://github.com/prisma/prisma
>
Thanks for the links!

> On Fri, Jan 17, 2020 at 13:18 Dmitry Igrishin <dmitigr(at)gmail(dot)com> wrote:
>
>> Hello!
>>
>> Who needs to talk to Postgres right from a WEB-browser via WebSockets?
>> For example, conveniently call storable functions/procedures?
>>
>> Yes, i know about PostgREST. But I want to focus on RPC via WebSockets
>> without all these REST or "give me contents of that table by this URL"
>> stuff...
>>
>> I'm thinking about writing an application which is simple to
>> install/deploy, simple to configure, with a connection pool built-in.
>> Ideally, one binary and one config in JSON format.
>>
>> I need some feedback before start. So please don't hesitate to share any
>> of your thoughts/ideas/comments/scepticism here :-)
>>
>> Thanks.
>>
>>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message stan 2020-01-18 16:53:25 A question about rules
Previous Message Nikolay Samokhvalov 2020-01-18 02:54:06 Re: RPC via WebSockets.