
Show HN: GraphQL for Postgres - solidsnack9000
https://github.com/solidsnack/GraphpostgresQL
======
adriancooney
That graphql.sql file is pretty amazing and is a great example of the power
and flexibility of Postgres. It seems to dynamically generate the graph
"database" \-- a concept I would have recoiled in fear at the thought of
implementing in SQL (well, Postgres SQL and it's niceties). Great work.

------
gingerlime
This looks great, and I love the idea of GraphQL and declaratively defining
the data you need.

I understand this is alpha / proof-of-concept, and this is in no way meant as
criticism, also not specific to this implementation, but just trying to figure
out something:

What's the security model for GraphQL (at least as intended for javascript
clients speaking to a backend)? Can we just pass the GraphQL from the client
to the server and execute it? (In this case, directly on the PG database).
What kind of security can be built around this?

~~~
chrisfarms
I've been playing with getting a Postgres/GraphQL system working recently too.
I decided that the definitions of the "edges" in the schema itself should
declare what the user/viewer is capable of fetching via the GraphQL.

I started a very naive implementation of A-Relay-Like-Architecture (Arla) and
built todomvc with it[1].... schema.js[2] declares the schema/nodes as well as
the 'calls/edges' available for each node, which allows you to limit the
visible rows/columns based on the $viewer id.

It's all a bit of an experiment... but I'm liking the GraphQL pattern so far.

[1] [https://github.com/kiloe/arla-todomvc](https://github.com/kiloe/arla-
todomvc) [2] [https://github.com/kiloe/arla-
todomvc/blob/master/schema.js](https://github.com/kiloe/arla-
todomvc/blob/master/schema.js)

~~~
solidsnack9000
I wonder if one could use a shape-like spec to describe permissions for a
user, similar to GraphQL itself?

------
hkmurakami
> _GraphpostgresQL is alpha quality and has undergone neither extensive
> optimization nor comprehensive testing. To use it for production workloads
> would needlessly tempt fate._

Ah yes, definitely the Jason I know. ;)

Great work!

------
nl
Hm. This looks nice especially now TitanDB is abandoned.

But the lack of updates for json/jsonb data remains a problem. It's really the
only significant problem left for using Postgres for almost-everything, but
it's a real issue.

~~~
sidi
Wow, didn't know TitanDB was abandoned. Last I read, datastax was working on a
commercial offering of TitanDB.

~~~
nl
They're building a new database, "based on the lessons learnt from TitanDB"

------
jjangsangy
This just made my day. If I ever meet you I will buy you a beer!

Unless you are underage, in which case that's too bad

~~~
hkmurakami
[https://github.com/solidsnack](https://github.com/solidsnack) A guy with such
an epic Unix beard probably isn't underage. ;)

Though iirc Jason doesn't drink. You might need to buy him coffee instead!

~~~
jjangsangy
Coffee it is!

------
btgeekboy
You should consider adding a LICENSE to your repo.

~~~
solidsnack9000
Done.
[https://github.com/solidsnack/GraphpostgresQL/commit/5f228f3...](https://github.com/solidsnack/GraphpostgresQL/commit/5f228f3d04892fbf77f895ae1f5768053dfd6a3e)

~~~
solidsnack9000
The license has been changed to distribute GraphpostgresQL under the same
terms as Postgres itself:
[https://github.com/solidsnack/GraphpostgresQL/commit/bec43e3...](https://github.com/solidsnack/GraphpostgresQL/commit/bec43e3b7b3351edd2da79d261caedf7b2449eb6)

------
iLoch
This is great. After seeing this in use at React.js Conf I was wondering who
would step forward to take this on.

------
rapind
Thanks, and looking forward to seeing where this goes! It's a solid fit for
some recent use cases I've run into.

~~~
solidsnack9000
If you could let me know what use cases you have in mind, it would help me to
prioritize features and think about what to optimize.

~~~
rapind
Aside from general usefulness, I'm very interested in "Relay".

[https://facebook.github.io/react/blog/2015/02/20/introducing...](https://facebook.github.io/react/blog/2015/02/20/introducing-
relay-and-graphql.html)

------
anth1y
This is awesome nicely done man!

------
technologia
This is pretty cool, nice job!

