Skip to content
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

feat: prisma lesson #28230

Merged
merged 16 commits into from
Jul 10, 2024
Merged

feat: prisma lesson #28230

merged 16 commits into from
Jul 10, 2024

Conversation

01zulfi
Copy link
Member

@01zulfi 01zulfi commented Jun 16, 2024

Because

#27925

This PR

#27925

Issue

Closes #27925

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@01zulfi 01zulfi added the Project Node Revamp Issues/PRs related to the Node Revamp project label Jun 16, 2024
@github-actions github-actions bot added the Content: NodeJS Involves the NodeJS course label Jun 16, 2024
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
Co-authored-by: Asartea <76259120+Asartea@users.noreply.github.com>
@01zulfi 01zulfi requested a review from Asartea June 17, 2024 02:13
Copy link
Contributor

@Asartea Asartea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@cmedina-dev cmedina-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some suggestions, but overall looks good!

nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved

There's a bunch of new stuff up here. Prisma schema files are written in Prisma Schema Language. You can see how not only there are column definitions for the table, but also a relation to another table defined within the `Message` model. You'll learn more about this in the assignment readings.

This schema file lives in your codebase and is tracked by version control. You can guess by now how useful this is.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be good to mention what the schema file is (that it has a specific naming convention) and that there can be multiple schema files in Prisma. e.g. from the docs:

It is typically a single file called schema.prisma (or multiple files with .prisma file extension) that is stored in a defined but customizable location.

https://www.prisma.io/docs/orm/prisma-schema/overview

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I purposefully kept out this information, since learners will only ever need one schema file for the projects they tackle in the curriculum. They do learn about the naming convention and the multiple files stuff in the linked documentation in the assignment section.

01zulfi and others added 4 commits June 18, 2024 11:36
Co-authored-by: Christian Medina <117231596+cmedina-dev@users.noreply.github.com>
Co-authored-by: Christian Medina <117231596+cmedina-dev@users.noreply.github.com>
@01zulfi 01zulfi requested a review from cmedina-dev June 18, 2024 06:47
Copy link
Contributor

@cmedina-dev cmedina-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Great job!

@MaoShizhong MaoShizhong self-requested a review June 30, 2024 15:41
Copy link
Contributor

@MaoShizhong MaoShizhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this 🔥 Not much else to say regarding the lesson content itself, more just some format/nits etc.

nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
01zulfi and others added 3 commits July 8, 2024 19:35
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
@01zulfi 01zulfi requested a review from MaoShizhong July 8, 2024 14:40
01zulfi and others added 2 commits July 8, 2024 20:02
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Copy link
Contributor

@MaoShizhong MaoShizhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more little bits but otherwise I think I'm happy with the lesson contents 🚀

nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
Co-authored-by: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
@01zulfi 01zulfi requested a review from MaoShizhong July 9, 2024 06:06
Copy link
Contributor

@MaoShizhong MaoShizhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this.
🚀


#### So much more code

You need a `SELECT` statement? Cool, write a query. Need a `SELECT` statement for a different table? Write another query. Or if your programmer senses are tingling, you could create a utility function for `SELECT`. But now you need a `SELECT` statement for specific columns? You'll have to modify the utility function. What about filters and sorting? You get the point.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: sorry I missed this one earlier

Suggested change
You need a `SELECT` statement? Cool, write a query. Need a `SELECT` statement for a different table? Write another query. Or if your programmer senses are tingling, you could create a utility function for `SELECT`. But now you need a `SELECT` statement for specific columns? You'll have to modify the utility function. What about filters and sorting? You get the point.
Do you need a `SELECT` statement? Cool, write a query. Need a `SELECT` statement for a different table? Write another query. Or if your programmer senses are tingling, you could create a utility function for `SELECT`. But now you need a `SELECT` statement for specific columns? You'll have to modify the utility function. What about filters and sorting? You get the point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel "You need a SELECT statement?" reads better than creating a question-ish tone. I'll reserve this change unless we get anyone else's objection.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are fine. The first has a more casual tone but is otherwise still fine

nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
nodeJS/orms/prisma_orm.md Outdated Show resolved Hide resolved
Co-authored-by: Asartea <76259120+Asartea@users.noreply.github.com>
@01zulfi 01zulfi requested a review from Asartea July 10, 2024 14:34
Copy link
Contributor

@Asartea Asartea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@01zulfi 01zulfi merged commit 7f73f0b into main Jul 10, 2024
1 of 3 checks passed
@01zulfi 01zulfi deleted the node-revamp/prisma branch July 31, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: NodeJS Involves the NodeJS course Project Node Revamp Issues/PRs related to the Node Revamp project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Lesson: Prisma ORM
4 participants