Re: Benchmark of using JSON to transport query results in node.js

From: Michel Pelletier <pelletier(dot)michel(at)gmail(dot)com>
To: Mitar <mmitar(at)gmail(dot)com>
Cc: Tony Shelver <tshelver(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Benchmark of using JSON to transport query results in node.js
Date: 2019-01-11 18:56:06
Message-ID: CACxu=v+aFvitWyHPeP-0AFjZS=9Qzo5fahNC_T=2LF8StwZvEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 11, 2019 at 10:31 AM Mitar <mmitar(at)gmail(dot)com> wrote:

> Hi!
>
> > Another option is to query directly from node.js and get JSON or native
> query from the database (extensive use of functions / stored procedures).
>
> For web applications, I was even thinking about this crazy approach:
> get PostgreSQL to encode all results in JSON, and then in node.js do
> not parse JSON, but send it as string directly to the browser.

Not crazy at all, that's basically how PostgREST works:

http://postgrest.org/en/v5.2/

-Michel

>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-01-11 22:56:23 insert into: NULL in date column
Previous Message Mitar 2019-01-11 18:30:45 Re: Benchmark of using JSON to transport query results in node.js