Connecting PostgreSQL Server to VScode

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's good yo it's a boy Chris here and in tonight's quick video we're just gonna go over how to connect your uh postgres right your postcard sequel database to the vs code divisional Studio code uh platform so what we're going to do here is what we got open right now is the um the PG admin program it's free you can download it from postgres website however let's say you want to use the code you want to do queries everything on vs code instead so how to do that what you want to do you want to make sure that your database is up and running on your Local Host machine so you want to go ahead and open vs code wait for this to open up and then you want to go to your extensions this is where you can download all of your extensions if you don't see this icon here you can scroll down to the Cog wheel go to extensions and it'll bring you through the same spot so in order to get this um get postgres running here what you want to do is you want to type post get a SQL right now there are three tools that I recommend downloading just just to be on the safe side the first one is going to be the postgres SQL language server then you have the postgres SQL where it says by Microsoft and then you have this postgres management tool so I'm going to download this one then I'm going to download the postcard sequel by Microsoft and then I will download postgres SQL language server wait for all of these to finish downloading and uh yeah so we'll just wait and wait uh we have the language server uh being installed so now that we have everything installed we're going to exit out of the program right I like to exit out the program just to give a safe side make sure everything is downloaded and it's installed correctly we're going to reopen the vs code okay and then you're gonna get the elephant um the postgres icon with the uh with the SQL database in the background this is the postgres SQL Explorer you want to click that and then at the top you want to hit the plus button and then you go ahead and you type the host name of your database since we're running it on the local machine instead of typing it's localhost I actually like to type the IP address of localhost machine all right now we have the polks SQL user to authenticate what is the user that you're using you got to make sure you know that whether it's root minus is pulse Grist and then the password make sure you get to your password the port that is running on mine says 54.32 standard connection and then now it's going to show you know it's going to give you the list of databases I'll just say show all databases right and then the name at the end you're going to get your IP back you could have a name so I'm going to say postgres deliver instead of postgres SQL Server boom now you're going to see your postgres SQL server at the corner here with your databases uh I am using the DVD rental so let's go ahead and let's uh let's just do a query just to make sure things are working correctly so if we right click on the database that we have click new query we can go ahead and say Signet oh um customer we have a customer table here right click and run query boom so it runs your query right to the side you can position it if you wanted to so you can go at the bottom just a cleaner look you have your table right so yeah this is pretty much it um you can also if you want to have a uh if you have a query that is that already exists sorry about that let's go here boom uh we can say let's open a query that we have here let's go to open file and then let's go to documents I have a few documents here we're gonna go to SQL queries open it so here's a simple SQL query uh what not simple but uh a query that I've added here isn't doing some installation down here at the bottom you have to worry about that uh but you can just right click and then um one SQL query then you're going to do something to say like no debate no database selected uh something of that matter right so just make sure that um the DVD rental is selected here and then run the nosql all of that run the uh run the query so instead of saying run my SQL just hit just highlight everything they didn't run query uh you may see run MySQL Query this is not a my sequel um database that we're using this is a postgres so I'm going to highlight everything hit run query and stay it this is uh this is it so we have this up and running and it is good to go if we delete the here we can get the table everything everything here so this is how you uh this is how you run everything on vs code you know it's very simple uh just follow the steps I've shown you here and you will be good to go all right you all have a good one and see you later
Info
Channel: Data Bunny
Views: 1,124
Rating: undefined out of 5
Keywords: sql, SQL, postgres, postresql, vscode, connecting, database, data engineer, data science, connecting to database, coding, database administrator, IT, tech jobs, tech industry, how to connect database
Id: GKSZ5K_8j4w
Channel Id: undefined
Length: 6min 8sec (368 seconds)
Published: Wed Apr 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.