I need to access my data from postgreSQL database, but I don't know how to connect to it with JS. I don't want to use API for Web SQL database or similar.
Asked
Active
Viewed 1,302 times
0
-
After I googled "javascript postgres cordova" I got [this result](http://stackoverflow.com/questions/9934563/connecting-to-postgres-database-from-a-phonegap-app). Have you, by any chance, tried doing similar? – Mjh Nov 10 '15 at 16:31
1 Answers
0
The answer you linked is essentially correct. In order to access your data on a server you need to provide an API to the DB via REST controllers or some other mechanism.
To summarise you would need to implement this chain:
Cordova App <---> Web Server <---> DB on Web Server
However, if you are just looking for a lightweight DB to use with your cordova application then you could try using this plugin.

Filipe Teixeira
- 3,565
- 1
- 25
- 45