Don’t worry, we are here to help you with:
Remember, there’s no such thing as a silly question, so don’t hesitate to reach out, we love hearing from you!
How do we make sure our AWS credentials are accurate and functional?
Ultimately, we need to use them in our application to connect to our database. But firstly we should figure out if they work, right? Just in case we're having any connection issues down the line.
To do that, we’ll use another database viewer.
These are kind of divisive tools - a lot of people don't like interacting with a database visually and they can be very slow if you have a very large database.
However, as a way of quickly visualizing whether the connection works and like what my data looks like I don’t think they can be beaten.
To do this, and given that we’re interacting with a MySQL database, I use a MySQL shell in my VSCode as an extension.
Other than the fact that it's made by Oracle and has good reviews, it's pretty much at random.I'm sure a lot of these different shell VS Code extensions will do the trick as well.
Once installed you’ll end up with a tab on your lefthand side that looks like a dolphin which, when clicked on, will take you to a screen where you can initialise a new database connection.
In order to create a connection with our AWS database we need to provide it a few things.
We need to provide it:
a host
a protocol
a port
a caption (defined by you)
a name (defined by you)
We need to select whether you're using SQL or SQLite (SQLite is, as the name suggests, a very lightweight version of SQL - it can be useful for prototyping but I never really use it).
a username
and a password.
All those details are in the notes above.
And we will authenticate into our database. If the credentials work, you should end up here. You will be presented with a SQL shell.
We can see a table view of our databases on the left.
You will see multiple different databases going on.
We want to access the careful
database, which has a few tables:
care recipients
caregivers
and events.
You can access the columns for each database, if you wish, just to get an understanding of what the data looks like, what it contains and what you can expect when pulling from it.
In the main VSCode panel we have a SQL command prompt.
Here we can run some simple commands in order to interrogate our data directly:
SHOW DATABASES
← allows us to show a list of all our databases
USE careful
← allows us to focus on the careful database
SELECT * FROM events
← is the syntax for selecting something from a given table. We can substitute out the events table for any other. *
is a wildcard which allows us to access all the information.
To execute commands use CMD + enter
on Macs and CTRL + enter
on Microsoft PCs.
We won’t go too deeply into SQL here but much more on commands to use and get familiar with can be found here.
A place for you to post notes about anything on this page. Only you can view your notes.