Step by Step Javascript and Postgres Tutorial using node-postgres

preview_player
Показать описание

In this video, we will learn how to connect to a Postgres database from Javascript. We will learn how to perform queries on a table. We will go through an Insert example and learn how to do transactions. You can through jump codes table of content to jump to areas of the code of interest to you.

Requirements

Reference Videos
Atomic Transactions

Jump Codes Table of Content
0:00 Intro
02:50 Creating new NodeJS Project
06:40 The node-postgres npm library
10:40 Connecting to the postgres database (promises)
13:30 Executing queries (promises)
18:10 Executing queries with parameters (promises)
22:00 Executing Insert statement (DML) (Promises)
26:22 Connecting to postgres (Async/await)
37:00 The Results object of the query
39:40 Executing Transactions in Javascript (Begin, Commit/Rollback)

Source Code

Enjoy 😉

Stay Awesome!
Hussein
Рекомендации по теме
Комментарии
Автор

What I learned in this video (a few years ago at this point) really helped me progress past the more basic javascript I was writing before.

I can't thank you enough for this and all of your other videos!

SANTINIIO
Автор

I know it wasn't the main focus of the video, but I have to commend your explanation and side by side comparison of using the promise .then approach vs the async await approach and for taking the time to explain how to handle errors with each. I find that asynchronous JavaScript can be a bit of a confusing thing for newer JavaScript developers, but you laid it all out very well!

eben
Автор

Finally a nice tutorial mentioning error handling and not skipping it for the sake of time, well done

GreenMarkoulis
Автор

Guys thank you so much for the LOVE glad you enjoy the content. For your convenience Jump Codes Table of Content
02:50 Creating new NodeJS Project 06:40 The node-postgres npm library 10:40 Connecting to the postgres database (promises) 13:30 Executing queries (promises) 18:10 Executing queries with parameters (promises) 22:00 Executing Insert statement (DML) (Promises) 26:22 Connecting to postgres (Async/await) 37:00 The Results object of the query 39:40 Executing Transactions in Javascript (Begin, Commit/Rollback)

hnasr
Автор

I smiled when I saw "enjoy" after the looking at the source code link above it. Thanks for the video.

siddharthmagadum
Автор

this tutorial is absolutely insane. spent whole days looking for something like this and finnaly fount you and you explained it so well!

antoninstrelba
Автор

Hey man, just wanted to thank you for your video! It was super helpful to a new guy like myself. I'm looking forward to viewing more of your tutorials!

dallaslovell
Автор

i dont even primarily do javascript this was just for a school project but the way you explained this made me subscribe tysm

devastatingrpg
Автор

i watched more than 50 tutorials about connecting postgres database and followed a use of a lot of packages, and always i'm sticking with errors that i'm not able to fix, with this tutorial everything worked with no problems and now i'm able to continue making a small app thank you very much for the efforts

Salehammar
Автор

Greetings from Indonesia! I gotta say this video helps me understand this postgre and node.js things which I found pretty confusing... Thanks Hussein!

erlanggakencana
Автор

great tutorial man. I liked it how you said Ali is here Salam Ullah Alaih. Just heart warming

wajahat
Автор

As a master student I really appreciate the tutorial and the way you explain it. It will be very helpful for my context-aware-system exam! Thank you!

NenaDarkPrincess
Автор

Great video, explains the fundamentals without feeling like a death by powerpoint! Appreciate the effort you put into the video and personality. Subbed

fraserjeffrey
Автор

dude... this is literally the best tutorial i've ever seen

Shadowserpant
Автор

I have this project I am working on and this is my first time working with Apis and database, I was literally frustrated for days trying to get my hands around it all and I keep getting errors the more I try to follow up most tutorials, finally I am able to do this! Thanks to you!

chiomaonyekpere
Автор

Man, you are so much fun to watch! Love the way you speak! keep it up! Love the tutorial!

welashubby
Автор

Came for the explanation about transactions. It would be nice to have a tutorial about pooling (if it's not done yet). Subbed.

fabrizziogz
Автор

That is an insane course for NodeJS!!!

yuan-yichang
Автор

very informative tutorial. I just started a new job and i need to learn JS and Postgres using postgres... this helped me to understand the relation between them. I hope you will go more in depth in this specific topic in the future. The video was a little bit blurry so sometimes i had issues to follow the code, i hope you can work on that too. Thanks again and keep up the good work

achraf
Автор

Your video really clarified me some ideas! Thx Hussein!

nicolaslupo