简体   繁体   中英

How to connect React Native and PostgreSQL?

Hey guys I have a question regarding React Native and PostgreSQL.

I've build a rn App where you can save data like hours, project and a comment and another screen where you can load it. It is a project for my workplace where we have an intern timemanagement system. Our database is a PostgreSQL database.

My question is how do I connect to our database ? - I have a test DB running locally on my pc, I would like to connect to it first.

I did some research and found that I need to use fetch request. Then I found out that there are two approaches (kinda):

1.node-postgres npm package (my Q: Do I need to know how to write in NodeJS?)

2.postgraphile GraphQL (my Q: Is it easier to do it with GraphQL? Do I need to be a GraphQL expert?)

I really appreciate any response or tipps you can give me. Sincerly Faded.

最好的方法是使用API​​公开数据,例如,使用nodejs和node-postgres。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM