Thread: HTTP API experimental implementation

HTTP API experimental implementation

From
Björn Harrtell
Date:
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hey
all,</span><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br
/></div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I'vebegun an
implementationof the proposed HTTP API [1] (with some changes) using node.js</div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br
/></div><divstyle="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Theproject lives at <a href="https://github.com/bjornharrtell/postgresql-http-server" style="color:rgb(17,85,204)"
target="_blank">https://github.com/bjornharrtell/postgresql-http-server</a> andbasic functionality is in
place.</div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br
/></div><divstyle="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Feedbackappriciated!</div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br
/></div><divstyle="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
[1] <ahref="http://wiki.postgresql.org/wiki/HTTP_API" style="color:rgb(17,85,204)"
target="_blank">http://wiki.postgresql.org/wiki/HTTP_API</a></div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br
/></div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Regards</div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br
/></div><div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">/Björn
Harrtell</div>

Re: HTTP API experimental implementation

From
Peter Eisentraut
Date:
On tis, 2012-07-10 at 08:59 +0200, Björn Harrtell wrote:
> Hey all,
> 
> I've begun an implementation of the proposed HTTP API [1] (with some
> changes) using node.js
> 
> The project lives at
> https://github.com/bjornharrtell/postgresql-http-server and
> basic functionality is in place.
> 
> Feedback appriciated!
> 
> [1] http://wiki.postgresql.org/wiki/HTTP_API

The problem I see with this is that if someone else were to take this
wiki page and the email thread that preceded it, and tried to implement
it, it would look similar but completely different in detail to yours.
If there isn't anything like a standard for this out there, it's just
going to be another proprietary API/protocol, except that it is
transported over HTTP.

I'm also not sure about mangling together some of the proposed use
cases.  I can see the value in exposing the database structures over
HTTP for browsing and exploration.  But is JSON the right format for
this?  If you used, for example, XML with some stylesheets, you could
easily produce lists and tables in a browser, which would serve this
much better.

On the other hand, I can see the value of this for embedded or mobile
applications.  But then you don't need the whole database metadata
stuff.  A simple and efficient query pass-through would be enough and
easier to design.