RedBeret / python-p3-conclusion-to-object-relational-mapping

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conclusion to Object-Relational Mapping

Learning Goals

  • Create Python objects using SQL database records.
  • Create SQL database records using Python objects.

Key Vocab

  • Object-Relational Mapping (ORM): a technique used to convert database records into objects in an object-oriented language.

Conclusion

Now that we've discussed Object-Relational Mapping in depth, it should feel a little less intimidating. We've established that they can make it easier to write code, without using the SQL that you've already learned and practiced several times. With Object-Relational Mapping, we are able to write those and more complicated SQL queries we're familiar with, with less code using Python.

We've learned the many benefits of ORMs such as how to:

  • Create tables in a corresponding Python class
  • Insert data into the database from a Python method
  • Find and update existing database records when changes are made to their related Python objects
  • We can map a database table to a Python object as well as make Python objects from database rows. With our ORM in place, other developers can leverage the power of SQL in our Python class without needing to write it themselves (or be fluent in it)! Being able to leverage this functionality is awesome!

Resources

About

License:Other