Deliver Your News to the World

Essential SQLAlchemy--New from O’Reilly: Mapping Python to Databases


Sebastopol, CA—SQLAlchemy is far more than just another ORM. True, it’s a powerful and flexible Python library that bridges the gap between relational databases and traditional object-oriented programming—which sounds pretty much like your average object-relational mapper—but most new users only see a fraction of what’s available in this excellent library. When fully understood, SQLAlchemy can make a Python programmer’s life much easier. In his new book, Essential SQLAlchemy (O’Reilly US $34.99), author Rick Copeland shows readers how to master SQLAlchemy’s hidden power.

The SQLAlchemy library was created by Mike Bayer to provide a high-level, Pythonic (idiomatically Python) interface to relational databases such as Oracle, DB2, MySQL, PostgreSQL, and SQLLite. “SQLAlchemy attempts to be unobtrusive to your Python code, allowing you to map plain old Python objects (POPOs) to database tables without substantially changing your existing Python code,” says Copeland. “It includes a database server-independent SQL expression language and an object-relational mapper that lets you use SQL to persist your application objects automatically.”

According to Copeland, more and more Python programmers are getting into database programming, particularly in the context of web development. “SQLAlchemy is arguably the best library for using relational databases from Python,” Copeland says. "In comparison with SQLAlchemy, one popular competing object-relational mapper was described by Jonathan Ellis at PyCon 2007 as ’feeble.’

“It’s already the default database layer in both the Pylons and TubrboGears web frameworks,” Copeland adds. “Understanding the library better—which this book will help with—will make people more productive and help them write more maintainable code.”

Essential SQLAlchemy demonstrates how to use the library to create a simple database application, walks you through simple queries, and explains how to use SQLAlchemy to connect to multiple databases simultaneously with the same Metadata. You also learn how to:

Create custom types to be used in your schema, and when it’s useful to use custom rather than built-in types
Run queries, updates, and deletes with SQLAlchemy’s SQL expression language
Build an object mapper with SQLAlchemy, and understand the differences between this and active record patterns used in other ORMs
Create objects, save them to a session, and flush them to the database
Use SQLAlchemy to model object oriented inheritance
Provide a declarative, active record pattern for use with SQLAlchemy using the Elixir extension
Use the SQLSoup extension to provide an automatic metadata and object model based on database reflection

In addition, you’ll learn how and when to use other extensions to SQLAlchemy, including AssociationProxy, OrderingList, and more.

“’Essential SQLAlchemy gives you both a good path to learning SQLAlchemy for the first tiem as well as providing a valuable reference for even veteran SQLAlchemy programmers,” says Copeland.

Essential SQLAlchemy is the much-needed guide for every Python developer using this code library. Instead of a feature-by-feature documentation, the book takes an “essentials” approach that gives you exactly what you need to become productive with SQLAlchemy right away.


This news content was configured by WebWire editorial staff. Linking is permitted.

News Release Distribution and Press Release Distribution Services Provided by WebWire.