Will postgreSQL support API support?
I want to know if PostgreSQL has rest support or is there any other way to achieve it?
Postgres does not support the REST interface out of the box. But there is an early project to add one: Postgres Wiki . Postgres may add it in a future version. There are some "experiments" for Github: link
There are now two viable solutions:
-
Use a third party tool providing rest api for postgres. restsql is an example.
-
Implement your own Webservice layer.
It depends on your requirements:
(2) offers you the most control. You can design the api however you need. Modern Java platforms (JPA, JAX-RS, Jackson, etc.) Allow easy and efficient creation of a lightweight API layer.
(1) would be viable if you only want a basic way to access the DB via REST.
Another project that tries to solve this is PostgREST . It is written in Haskell, not Java, but you can use it from Java using normal HTTP requests.
PostgREST serves a fully RESTful API from any existing PostgreSQL database. It provides a cleaner, more standardized, faster API than you are likely to write from scratch.