1

Im trying to develop a web app using angularjs, restangular and postgresql, im using ubuntu and xampp for development. I found ArrestDB, a restful api for postgresql. In its documentation,

# Get all rows from the "customers" table where the "country" field matches "Australia" (LIKE) GET http://api.example.com/customers/country/Australia/

https://github.com/alixaxel/ArrestDB

While in restangular documentation,

// Just ONE GET to /accounts/123/buildings/456
Restangular.one('accounts', 123).one('buildings', 456).get()

https://github.com/mgonto/restangular

Do you guys know a free RESTful api for postgresql that works well with restangular?

ArrestDB interprets api/{Table}/{Field}/{....} while Restangular interprets api/{table}/{id}/{relations table}. I also tried api/{table}/{id}/{relations table} in ArrestDB but I get error 404.

I also found Postgrest in github but its in haskel, and i'm not familiar with haskel.

Thanks...

3
  • Wouldn't it be dangerous to expose the DB like that? Commented Feb 3, 2015 at 13:18
  • I think with a proper authorization it will help to secure the db. Commented Feb 3, 2015 at 13:26
  • I think you can implement your own solution using CodeIgniter and github.com/philsturgeon/codeigniter-restclient. It's friendly for postgresql (and others too) Commented Sep 13, 2016 at 12:19

3 Answers 3

3

Postgrest seems to be a very viable choice. There is no knowledge of Haskell required to interact with it.

Sign up to request clarification or add additional context in comments.

Comments

2

I have used PostgREST and recommend it. It is written in Haskell but requires no knowledge of Haskell (in the same way that pg is written in C, but no knowledge of C is required to use it). The documentation at postgrest.com is quite helpful and I've been able to get up to speed with it quickly. Best practices are to run pgREST through a reverse proxy (Apache, Nginx, etc.) to control web authentication and authorization. PostgreSQL will enforce permissions GRANTed to the configured pgREST user (INSERT, UPDATE, DELETE, etc.) on the DB served up by pgREST. There are a number of access control options listed in the pgREST documentation for switching user roles as requests come in, so the access control is pretty flexible in accommodating different usage scenarios.

1 Comment

Also try graphile.org to expose a PostgreSQL DB as a GraphQL schema. Code is written in NodeJS, but as a non-javascript person I was still able to get up and running within a few minutes.
0

You can use Express.js and Node.js to create RESTful API for example. It works with PostgreSQL well. I am using it now for my application, so I have a PostgreSQL DB, back-end in Express.js with pg-promise and Node.js and front-end in AngularJS with Restangular.

You can try this tutorial, this guy has a quite good blog about building API and other useful things.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.