2

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.

1 Answer 1

2

The best way is to expose your data with an API, with nodejs and node-postgres for example.

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

3 Comments

Okay so I need to Fetch the data and I use node-postgres package with it. Would you say I need to start a course or tutorial on NodeJS in generall or could I handle it by just following the docs of node-postgres?
It would be better for you to follow a course on NodeJS (if you don't know it at all) and a Web/API framework (Express for example).
It's so dumb that we need a third program to connect the two.

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.