Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Next Steps1:53 with Andrew Chalkley
In this video we'll take a look at the Querying API for Sequelize and I'll give you some ideas to expand the project.
We've only scratched the surface of SQLite, but
you should be in a good place to start using it in your projects.
Before I sign off, let me show you the querying API in the documentation.
The findAll method and the findById model methods can take in options.
Remember, like the findAll method where we ordered by the createdAt column.
If you go to the querying page, there's lots of examples of Sequelize code and
the SQL code it generates.
Here is a where clause that looks for
author IDs that equal 2.
Further down here, there's combinations of conditions using the or
operator and operators other than the equality operator.
You can also offset and limit,
as shown in these examples here.
And that's all we have time for.
Remember, you're not required to memorize every ORM or library or framework.
The documentation is there to help you, so use it.
If you want to extend this project, why not add comments and authentication?
You don't want any old user coming to your site and causing havoc.
Take care. And I'll see you soon.
You need to sign up for Treehouse in order to download course files.Sign up