Essential SQLAlchemy. 2nd Edition - Helion

ISBN: 978-14-919-1655-1
stron: 208, Format: ebook
Data wydania: 2015-11-27
Księgarnia: Helion
Cena książki: 118,15 zł (poprzednio: 137,38 zł)
Oszczędzasz: 14% (-19,23 zł)
Dive into SQLAlchemy, the popular, open-source code library that helps Python programmers work with relational databases such as Oracle, MySQL, PostgresSQL, and SQLite. Using real-world examples, this practical guide shows you how to build a simple database application with SQLAlchemy, and how to connect to multiple databases simultaneously with the same metadata.
SQL is a powerful language for querying and manipulating data, but it’s tough to integrate it with your application. SQLAlchemy helps you map Python objects to database tables without substantially changing your existing Python code. If you’re an intermediate Python developer with knowledge of basic SQL syntax and relational theory, this book serves as both a learning tool and a handy reference.
Essential SQLAlchemy includes several sections:
- SQLAlchemy Core: Provide database services to your applications in a Pythonic way with the SQL Expression Language
- SQLAlchemy ORM: Use the object relational mapper to bind database schema and operations to data objects in your application
- Alembic: Use this lightweight database migration tool to handle changes to the database as your application evolves
- Cookbook: Learn how to use SQLAlchemy with web frameworks like Flask and libraries like SQLAcodegen
Osoby które kupowały "Essential SQLAlchemy. 2nd Edition", wybierały także:
- PL/SQL. Kurs video. Od podstaw do zagadnień zaawansowanych. Programowanie baz danych 79,00 zł, (31,60 zł -60%)
- Java na serwerze - kurs przetrwania. Obóz drugi. Od serwletów do Spring Boota 99,00 zł, (44,55 zł -55%)
- T-SQL. Kurs video. Wykorzystanie baz danych przy użyciu niekonwencjonalnych rozwiązań. Sztuczki i gotowe rozwiązania 39,89 zł, (17,95 zł -55%)
- T-SQL. Kurs video. Programowanie baz danych w SQL Server 79,00 zł, (35,55 zł -55%)
- Podstawy programowania. Kurs video. Bazy danych 59,00 zł, (26,55 zł -55%)
Spis treści
Essential SQLAlchemy. 2nd Edition eBook -- spis treści
- Preface
- Who This Book Is For
- How to Use the Examples
- Assumptions This Book Makes
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgments
- Introduction to SQLAlchemy
- Why Use SQLAlchemy?
- SQLAlchemy Core and the SQL Expression Language
- ORM
- Choosing Between SQLAlchemy Core and ORM
- Installing SQLAlchemy and Connecting to a Database
- Installing Database Drivers
- Connecting to a Database
- Why Use SQLAlchemy?
- I. SQLAlchemy Core
- 1. Schema and Types
- Types
- Metadata
- Tables
- Columns
- Keys and Constraints
- Indexes
- Relationships and ForeignKeyConstraints
- Persisting the Tables
- 2. Working with Data via SQLAlchemy Core
- Inserting Data
- Querying Data
- ResultProxy
- Controlling the Columns in the Query
- Ordering
- Limiting
- Built-In SQL Functions and Labels
- Filtering
- ClauseElements
- Operators
- Boolean Operators
- Conjunctions
- Updating Data
- Deleting Data
- Joins
- Aliases
- Grouping
- Chaining
- Raw Queries
- 3. Exceptions and Transactions
- Exceptions
- AttributeError
- IntegrityError
- Handling Errors
- Transactions
- Exceptions
- 4. Testing
- Testing with a Test Database
- Using Mocks
- 5. Reflection
- Reflecting Individual Tables
- Reflecting a Whole Database
- Query Building with Reflected Objects
- II. SQLAlchemy ORM
- 6. Defining Schema with SQLAlchemy ORM
- Defining Tables via ORM Classes
- Keys, Constraints, and Indexes
- Relationships
- Persisting the Schema
- Defining Tables via ORM Classes
- 7. Working with Data via SQLAlchemy ORM
- The Session
- Inserting Data
- Querying Data
- Controlling the Columns in the Query
- Ordering
- Limiting
- Built-In SQL Functions and Labels
- Filtering
- Operators
- Boolean Operators
- Conjunctions
- Updating Data
- Deleting Data
- Joins
- Grouping
- Chaining
- Raw Queries
- 8. Understanding the Session and Exceptions
- The SQLAlchemy Session
- Session States
- Exceptions
- MultipleResultsFound Exception
- DetachedInstanceError
- Transactions
- The SQLAlchemy Session
- 9. Testing with SQLAlchemy ORM
- Testing with a Test Database
- Using Mocks
- 10. Reflection with SQLAlchemy ORM and Automap
- Reflecting a Database with Automap
- Reflected Relationships
- III. Alembic
- 11. Getting Started with Alembic
- Creating the Migration Environment
- Configuring the Migration Environment
- 12. Building Migrations
- Generating a Base Empty Migration
- Autogenerating a Migration
- Building a Migration Manually
- 13. Controlling Alembic
- Determining a Databases Migration Level
- Downgrading Migrations
- Marking the Database Migration Level
- Generating SQL
- 14. Cookbook
- Hybrid Attributes
- Association Proxy
- Integrating SQLAlchemy with Flask
- SQLAcodegen
- 15. Where to Go from Here
- Index





