In this chapter, you learned how to connect to a database (MySQL) with the necessary parameters and use the
mysql gem with
sequel. You also learned how to open and use the interactive console (irb) with Sinatra and Sequel. We covered the details of Sequel models with various useful class-level and instance-level methods. Next, we covered the available hooks and callbacks. Finally, we discussed associations with eager loading and joins in order to scale and optimize the application.
In the next chapter, you will learn how session works and implement authentication and authorization.