SQLAlchemy Layer - ORM 说明

请添加图片描述

SQLAlchemy ORM

  • Lets you compose SQL expressions by mapping python classes of objects to tables in the database
  • Is the highest layer of abstraction in SQLAlchemy
  • Wraps the SQL Expressions and Engine to work together to interact with the database
  • Split into two libraries:
    • SQLAlchemy Core
    • SQLAlchemy ORM. SQLAlchemy ORM is offered as an optional library, so you don’t have to use the ORM in order to use the rest of SQLAlchemy.
      • The ORM uses the Core library inside
      • The ORM lets you map from the database schema to the application’s Python objects.
      • The ORM persists objects into corresponding database tables

ORM layer: Highest level of abstraction; maps classes to tables.
SQL Expression: Lets you compose SQL statements by building Python objects.
Engine: Makes it possible to interact with any database management system, regardless of the SQL flavor used.
Connection pool: Avoids opening and closing connections for every data change.
Dialect: Makes it possible to interact with any database management system, regardless of the SQL flavor used.

Guess you like

Origin blog.csdn.net/BSCHN123/article/details/121220185
Recommended