New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node revamp: Using PostgreSQL lesson #27879
Node revamp: Using PostgreSQL lesson #27879
Conversation
a5507c0
to
e396a86
Compare
@thatblindgeye I remember you saying something before about how the current way of doing dropdowns isn't fully accessible, and there may be a way to make them so and resolve heading duplication without needing to disable the rules. Is this something that could be actioned on with relative ease in the respective repos? Or is this something more involved that we should disable the rules for now still? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fcasibu 🔥 🔥 great stuff, can't wait to see Postgres stuff out
I have thoughts on how to best teach the lesson content. I presumed that the lesson overview I wrote on the issue would suffice, but after reading the lesson, it needs more "hand-holdiness" i.e. more detailed code-along instructions.
Here's what I propose:
We'll be creating a simple "add user to db" application. Have learners set up a simple express app with the following routes:
- GET
/
to display list of all users - GET '/new-user` to display form with one "user name" input. this forms sends a request to
- POST
/new-user
Now, we'll instruct to install pg
.
Now, we have to create a database, we'll instruct learners to do that in the psql
shell:
- run
psql
in the cli - run
create database top_users;
in the shell - then
\l top_users
then\c top_users
- then
create table top_users ( ... )
in the shell - then the insert query
The shell experience will be invaluable to leaners.
Then set up following files and also provide code. Ask learners to log the functions to see if they get expected data:
db/pool.js
exports thepool
objectdb/queries.js
exports two functionsgetAllUsers
andcreateUser
Finally, ask learners to use these functions in their controllers.
Once their app is functioning, now we can introduce a "populatedb" script. We'll ask them to delete the database and use this script to setup the db instead of shell.
closed in favor of #27960 |
Because
To add a new lesson about Using PostgreSQL for the node revamp.
This PR
nodeJS/express/using_psql.md
Installing PostgreSQL
in the RoR section and intro from our mongodb lesson with just a slight adjustmentIssue
Closes #27643
Additional Information
Pull Request Requirements
location of change: brief description of change
format, e.g.Intro to HTML and CSS lesson: Fix link text
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section