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
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.
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?
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.
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
The best programmer that I've watched at TH-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!
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'm just starting to see, but this is what I've been looking for very much. Thank you kindson
You're very welcome!
thankyou very much sir😍😍
You are welcome😊😊
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 tutorial is super useful, best one I've found on the postgres package. Thanks for making it!
Glad it was helpful!
Detailed explanation... wonderful thankyou....
Glad it was helpful!
Thanks for your valuable work.
did you make a video with calling this api on an angular app?
Thank you
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?
very good tutorial for me as a beginner. Thanks
pro for a reason 🔥🔥🔥🔥🔥🔥
So glad 😊
This video is the real deal. Thank you.
Absolutely clutch loved the video my guy!!!!!
Appreciate it!!
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.
Thank you teacher.
You are welcome
Thanks bro... it was v.helpful
This makes perfect sense. Thanks for clearing up my doubts
Can you makes tutorial on how to insert image in postgresql and creat api get request please
Hi sir can you please explain how to read Excel data and compare that data with postgre SQL database data by using node js
Thank you for this tutorial, it really helped me.
Glad to hear that!
Thank you! Very helpful :)
You're welcome!
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 😂
Great tutorial!
Thank you so so much!
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 man💚
You're welcome 😊
Bro please create a video CRUD app using react node express and postgre
Thank you
😊
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?
I love you bro, thanks a lot :)
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.
As said u r great❤️
thank u
simply awesome
Populating Drop Down menus from POSTGRESQL Database and nodejs
How do you check user already exit or not. By return through Json
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 ?
Why i cant connect to local host, it says module not found
im stuck on an infinite load what can i do to solve that
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?
hey how could i get a value by name?
This question will be covered in this series th-cam.com/video/65Yw53NDGio/w-d-xo.html
Hi kindson, im having some issues with my post? it is saying Cannot read property 'query' of undefined. Any help?
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
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.
Pls, I cant post and put data.
Error
Cannot PUT /users/
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
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
I am getting this error - UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432
be regular
body-parser depracated .json
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.