Functions for Data Access
Explore how to build data access functions for Scala HTTP APIs using Slick. Understand saving and updating data transactionally, composing queries, and managing ordering with Cats to prevent runtime errors.
We'll cover the following...
We'll cover the following...
Slick repository functions
Now, our repository needs some functions for more convenient access to the data.
The saveTranslations and saveTranslation functions are helpers that enable us to create and load queries that we can compose. They are used in the saveProduct and updateProduct functions to create a list of queries that are executed as bulk, while the call to transactionally in line ...