Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a possibility of connecting postgreSQL directly to Javascript?

without having to use php, python or odbc?

like image 369
Benz639 Avatar asked Feb 17 '11 13:02

Benz639


People also ask

Does Postgres support JavaScript?

Postgres and the database world are no different, now with JavaScript and JSON support. This powerful functionality is now available on all Heroku Postgres production tier databases – run CREATE EXTENSION plv8; on your database to get started today.


2 Answers

I have used Postgrest (postgrest.com).

"PostgREST is a standalone web server that turns your PostgreSQL database directly into a RESTful API."

Then you can make a query with a url which returns data in json format.

like image 186
mapsa Avatar answered Oct 13 '22 00:10

mapsa


You can get a JS driver for Postgres from https://github.com/creationix/postgres-js

This one is designed for use with node.js. Don't expect to be able to find something you can run client side in a web browser.

like image 34
Quentin Avatar answered Oct 12 '22 22:10

Quentin