Summary

This chapter has shown a way to write pure SQL without having to deal with the low level cursor and connection management. This removes a lot of boiler plate and error handling that is perfect for a framework to handle.

We have also explored how DatabaseTemplate and ORMs can work together to make persistence management easier for developers.

We took a look at mocking, and how we were able to get inside the querying process to verify that the right method calls were being made. Then we stepped back and considered how much testing is enough.

In this chapter we learned:

  • The classic SQL query issue that affects APIs in many modern programming languages extends into Python as well
  • Using Spring Python's DatabaseTemplate let's us get rid of query boiler plate code that gets in the way of solving use cases
  • DatabaseTemplate is useful for writing SQL code without dealing with cursor management
  • DatabaseTemplate combined with an ORM can help us build robust applications
  • Mocking is a valuable tool in automated testing, but we must choose the right tool for the right situation

In the next chapter, we will look at augmenting our data access layer with non-invasive transactions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.123.106