just by watching your this video I have learnt a lot....thanks a lot....!!!!! please make some videos on react login/signup pages and fecting the data from db
This is my first day working on node and postgres , my team lead gave me task crud operation with image uploadable frontend using reactjs, it's too though!! Thanks bro💫💫💫
I have been looking for a REST API, SQL, Node JS tutorial on Mac. Your tutorial saved me some time and trouble. Thanks Kindson Could u do some more SQL, Node js, Rest API tutorials for different scenarios like E-commerce websites?
shouldn't we be using `SELECT * FROM users WHERE id=?` instead of putting the request values straight into the sql? or does that not work the same in postgres?
Actually SQL-level PREPARE in PostgreSQL does not support the ? placeholder, it uses the $1 ... $n style which is also a better option that having the parameter values in the query
note: make sure you set the body format in json and not text so it can read the data you input, else it will either give you an error or input it as the default value
@@franciscafernandezaburto4704 did you figured it out? mine was the [] that i copied together......... also makes sure that the json and url /users/ with the / in the end
Thank you for your tutorial, I got a problem when I try to run app.get() function. it runs "client.end();" before "client.query" which leads the termination of database connection before I get the data rows. I guess the reason is because it is a async function and there is a mitigation on "client.query()". I just delete "client.end();" and it successfully runs. But the database will remain connected. Do we need end() it for each functions here? It looks stupid that users connect/disconnect database for each operation.
I also had trouble with this, and double-checked. What he actually writes is client.end, like a variable, not client.end() as I instinctively wrote. Once I changed that it worked. I don't know why it's set up like that. Maybe it's a getter function for some reason?
How do I host a PostgreSQL database and deploy Node.js+express+sequelize server for free ? I've been tired using aws ec2+supabase that only free for a week, render no longer free, railway no longer free, and heroku also no longer free. Please make the tutorial bro, especially with vercel(for db hosting and server deployment), much apprreciated Thankss.
I have this warning: (node:29416) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().
Which operation gives this error? There may be a typo in your code. Check your code against the code in the step by step here www.kindsonthegenius.com/build-a-rest-api-with-node-js-and-postgresql-get-post-putdelete-step-by-step/ Let me know if you succceed to fix it.
app.get('/users/:id', (req, res)=>{ client.query(`Select * from users where id=${req.params.id}`, (err, result)=>{ if(!err){ res.send(result.rows); } }); client.end; }) How can we check if user is not exit.then how to show message not exit through Json. Please help me this question
kindson - thanks so much for making these videos. I am just learning postgres and have a node script that tries to emulate the one you had in the video prior to this one. When I run the script - it looks like it cant find the table that I have described in your prior video. Here is my code: const {Client} = require('pg'); const client = new Client({ host: "localhost", user: "postgres", port: 5432, password: "***********", database: "glennis" }); client.connect(); console.log('Connected'); client.query(`Select * from Case`,(err,res)=>{ if(!err){ console.log(res.rows[1]); } else{ console.log('This is an error ==> ' + err.message); } client.end; }) the script is able to connect to the db but fails on the query. The 'case' table is in the db - I can see it from TablesPlus. Any tips? And many thanks for any help.
The best programmer that I've watched at UA-cam. Greeting from Colombia Sr! and Thanks for this video!!
You're very welcome!😊
Kindson, you are my most favorite instructor. You make me love spring boot. Want more Spring boot videos.
Thanks a lot for this motivation!
I'm just starting to see, but this is what I've been looking for very much. Thank you kindson
You're very welcome!
just by watching your this video I have learnt a lot....thanks a lot....!!!!!
please make some videos on react login/signup pages and fecting the data from db
This tutorial is super useful, best one I've found on the postgres package. Thanks for making it!
Glad it was helpful!
Absolutely clutch loved the video my guy!!!!!
Appreciate it!!
This video is the real deal. Thank you.
Detailed explanation... wonderful thankyou....
Glad it was helpful!
This is my first day working on node and postgres , my team lead gave me task crud operation with image uploadable frontend using reactjs, it's too though!!
Thanks bro💫💫💫
Thank you sir...Your teaching expression is superb sir
Thank you for this wonderful tutorial, I was struggling to make an api for my app for university here.
You're very welcome!😊
This makes perfect sense. Thanks for clearing up my doubts
Thank you teacher.
You are welcome
very good tutorial for me as a beginner. Thanks
pro for a reason 🔥🔥🔥🔥🔥🔥
So glad 😊
thankyou very much sir😍😍
You are welcome😊😊
I have been looking for a REST API, SQL, Node JS tutorial on Mac. Your tutorial saved me some time and trouble. Thanks Kindson
Could u do some more SQL, Node js, Rest API tutorials for different scenarios like E-commerce websites?
Thank you! Very helpful :)
You're welcome!
Thank you for this tutorial, it really helped me.
Glad to hear that!
Great tutorial!
Thank you so so much!
Thanks for your valuable work.
did you make a video with calling this api on an angular app?
Thank you
Thanks bro... it was v.helpful
shouldn't we be using `SELECT * FROM users WHERE id=?` instead of putting the request values straight into the sql? or does that not work the same in postgres?
Actually SQL-level PREPARE in PostgreSQL does not support the ? placeholder, it uses the $1 ... $n style which is also a better option that having the parameter values in the query
@@KindsonTheTechPro ah thanks for the insight
@@KindsonTheTechPro glad I asked as I would have encountered that issue with the system I’m making 😂
Thank you man💚
You're welcome 😊
note: make sure you set the body format in json and not text so it can read the data you input, else it will either give you an error or input it as the default value
Hi! I'm having this error and I don't know how to fix it, I did evrything just like in this video, have an idea on what could be wrong?
@@franciscafernandezaburto4704 did you figured it out? mine was the [] that i copied together......... also makes sure that the json and url /users/ with the / in the end
He is talking about body format in postman, you will see text in top-down menu change it to JSON
Thank you
😊
Hi sir can you please explain how to read Excel data and compare that data with postgre SQL database data by using node js
I love you bro, thanks a lot :)
simply awesome
Great job! But in your video you mentioned some errors and that you would update/change them, but when i go to your website its still not updated.
As said u r great❤️
Thank you for your tutorial, I got a problem when I try to run app.get() function. it runs "client.end();" before "client.query" which leads the termination of database connection before I get the data rows. I guess the reason is because it is a async function and there is a mitigation on "client.query()". I just delete "client.end();" and it successfully runs. But the database will remain connected. Do we need end() it for each functions here? It looks stupid that users connect/disconnect database for each operation.
I also had trouble with this, and double-checked. What he actually writes is client.end, like a variable, not client.end() as I instinctively wrote. Once I changed that it worked.
I don't know why it's set up like that. Maybe it's a getter function for some reason?
How to create api for sql server stored procedure using nodejs.. Could please help me
how can we show 2 or more database tables in a single API? Can you please suggest me any references?
Populating Drop Down menus from POSTGRESQL Database and nodejs
Hi kindson, im having some issues with my post? it is saying Cannot read property 'query' of undefined. Any help?
Can you makes tutorial on how to insert image in postgresql and creat api get request please
Bro please create a video CRUD app using react node express and postgre
Hello sir,
im sending request in postman and i get inn vs code that relation users doesnt exist. help
Hi, I am getting cannot GET /. May i know how to go about resolving it?
did you find solution ?
thank u
How do you check user already exit or not. By return through Json
Why i cant connect to local host, it says module not found
hey how could i get a value by name?
This question will be covered in this series ua-cam.com/video/65Yw53NDGio/v-deo.html
I am using app.post and I get the following: TypeError: Cannot read property 'id' of undefined ???!!
I have the same error. Could you solve that?
I had the same problem. Your data must be written in JSON format in the "pre-request script" section of postman.
I have the same problem did any one get the solution
@@marcoviallefont1046 could you please solve my problem
How do I host a PostgreSQL database and deploy Node.js+express+sequelize server for free ? I've been tired using aws ec2+supabase that only free for a week, render no longer free, railway no longer free, and heroku also no longer free. Please make the tutorial bro, especially with vercel(for db hosting and server deployment), much apprreciated Thankss.
im stuck on an infinite load what can i do to solve that
when i type node api.js, i get a TypeError: client.connect is not a function
Hello, did you ever figure this out? I got the same error message.
I am getting this error - UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432
I have this warning: (node:29416) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with
.catch().
Which operation gives this error? There may be a typo in your code. Check your code against the code in the step by step here www.kindsonthegenius.com/build-a-rest-api-with-node-js-and-postgresql-get-post-putdelete-step-by-step/
Let me know if you succceed to fix it.
Thank you Kingson, I had a double connection with another code
app.get('/users/:id', (req, res)=>{ client.query(`Select * from users where id=${req.params.id}`, (err, result)=>{ if(!err){ res.send(result.rows); } }); client.end; })
How can we check if user is not exit.then how to show message not exit through Json. Please help me this question
Pls, I cant post and put data.
Error
Cannot PUT /users/
body-parser depracated .json
be regular
No 😂not angular... React or Next thank you....❤
dislike button
Y?
kindson - thanks so much for making these videos.
I am just learning postgres and have a node script that tries to emulate the one you had in the video prior to this one. When I run the script - it looks like it cant find the table that I have described in your prior video. Here is my code:
const {Client} = require('pg');
const client = new Client({
host: "localhost",
user: "postgres",
port: 5432,
password: "***********",
database: "glennis"
});
client.connect();
console.log('Connected');
client.query(`Select * from Case`,(err,res)=>{
if(!err){
console.log(res.rows[1]);
} else{
console.log('This is an error ==> ' + err.message);
}
client.end;
})
the script is able to connect to the db but fails on the query. The 'case' table is in the db - I can see it from TablesPlus.
Any tips? And many thanks for any help.