awesome-repositories.com
Blog
awesome-repositories.com

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
fastapi avatar

fastapi/sqlmodel

0
View on GitHub↗
18,137 stars·871 forks·Python·MIT·7 vuessqlmodel.tiangolo.com↗

Sqlmodel

SQLModel is a type-safe object-relational mapping library for Python that integrates database schema definitions with data validation logic. By combining these two roles into a single class, it allows developers to manage relational data structures and enforce data integrity for web APIs simultaneously. The framework is built to support asynchronous database operations, enabling high-performance applications to execute queries and transactions without blocking the main execution thread.

The library distinguishes itself by leveraging Python type hints to provide IDE autocompletion and compile-time safety for database operations, effectively eliminating the need for raw SQL. It simplifies complex relational tasks by allowing developers to navigate and manage related records through object attributes, while automatically handling session lifecycles and transaction commits. Furthermore, it includes built-in support for circular dependency resolution and forward-reference type definitions, which helps maintain clean code organization in large-scale projects.

Beyond its core mapping capabilities, the project provides a comprehensive suite of tools for data lifecycle management, including automated schema initialization, migration tracking, and granular control over cascade operations. It also features robust testing utilities, such as dependency overrides and support for in-memory database execution, to facilitate isolated and efficient test environments. Security is addressed through automatic query sanitization, which protects database interactions from malicious input.

Features

  • Data Schema Definitions - Defines data structures that serve as both database schemas and validation models for application logic.
  • Database ORMs - Interacts with relational databases using typed objects and class-based models to eliminate raw SQL.
  • Object-Relational Mapping - Links database entities through object attributes to allow automatic fetching and traversal of related records without manual joins.
  • Data Validation - Enforces schema constraints and type requirements on incoming data payloads to ensure integrity.
  • Data Persistence - Saves instances of data models to a connected database by managing sessions and committing changes to the underlying storage.
  • Database Query Interfaces - Constructs and executes database queries using class models to retrieve typed objects without raw SQL.
  • CRUD Interfaces - Executes standard create, read, update, and delete actions on database records using object-oriented methods and session management.
  • Data Validation Libraries - Combines Python type hints with database schema definitions for unified data validation and object-relational mapping.
  • Asynchronous Database Drivers - Executes database queries and transactions using asynchronous syntax to prevent blocking the main thread.
  • Database Schema Migrations - Tracks and applies incremental changes to database structures to maintain synchronization with data models.
  • Database Connections - Automates the opening and closing of database connections for each request handler to ensure efficient resource management.
  • Database Object Synchronizations - SQLModel updates local object attributes with the latest data from the database, ensuring fields like auto-generated IDs are available after a commit.
  • ORM Relationship Querying - Retrieves records from multiple tables by filtering or joining based on defined foreign key relationships.
  • Database Relationship Mappings - Defines relational associations between data models using foreign keys and relationship attributes.
  • Type-Safe Query Builders - Uses static type analysis and class attributes to build database queries that provide IDE autocompletion and compile-time safety.
  • Data Schema Definitions - Combines data validation logic and database schema definitions into a single class to ensure consistency across application layers.
  • Unified Data Modeling - Provides unified data structures that serve simultaneously as database schemas and validation models.
  • Data Serializers - Validates incoming and outgoing web request data while automatically converting between objects and formats.
  • Database Clients - SQL databases designed for simplicity and compatibility.
  • Database ORMs - Listed in the “Database ORMs” section of the Awesome Python awesome list.
  • Object Relational Mappers - ORM based on type annotations and Pydantic.
  • Asynchronous Database Command Execution - Executes database transactions and queries asynchronously to prevent blocking the main execution thread.
  • Database Schema Managers - Automatically generates database tables from defined models during application startup.
  • Many-to-Many Associations - Links two database entities through intermediate tables to represent many-to-many associations.
  • Association Models - SQLModel connects two entities through an intermediate model that stores additional metadata alongside the foreign keys representing the relationship.
  • Object Relational Mappings - Automatically updates linked object attributes in memory to maintain consistency before database commits.
  • Record Updating - Updates existing object attributes and persists changes to the database via session commits.
  • Schema Mapping Utilities - Maps application classes directly to database tables and columns to enable object-oriented interaction with relational storage.
  • Single Record Retrievers - Fetches specific database entries by primary key with built-in error handling for missing records.
  • Session Persistence Management - Handles database connections and transaction lifecycles automatically within the context of individual request handlers.
  • Data Pagination Utilities - Restricts record counts and skips initial rows to enable efficient chunked data retrieval.
  • In-Memory Databases - Runs ephemeral database instances in memory to facilitate isolated and efficient test environments.
  • Local State Stores - Ensures application instances reflect the current state of stored records by fetching latest data.
  • Many-to-Many Relationship Managers - Manages many-to-many associations by automatically synchronizing changes across related models.
  • Record Deletion - Deletes a specific object from the database session to permanently remove the corresponding record from the underlying storage.
  • Nested Serialization - Embeds nested information from associated database records into API responses automatically to reduce the number of separate requests.
  • Related Attribute Resolvers - Automatically fetches and resolves associated database records when accessing relationship attributes.
  • Relationship Management - Links database entities through foreign keys to enable automatic navigation and persistence of connected records.
  • Circular Dependency Resolutions - SQLModel uses string-based type annotations to reference classes that are not yet defined in the current scope, allowing for circular dependencies and cleaner code organization.
  • Database Indexing - Configures model fields to be indexed in the database to optimize query performance.
  • Database Record Management - Applies conditional logic to select statements to retrieve records matching specific criteria.
  • Inheritance Mappings - Shares common fields across multiple data models using class inheritance to reduce code duplication.
  • Cascading Deletion Hooks - Configures automatic deletion or modification of child records when a parent record is removed.
  • Database Injection Prevention - Provides automated query sanitization and parameterization to protect database interactions from injection attacks.
  • Circular Dependency Resolution - Uses string-based annotations to resolve circular dependencies between data models during schema initialization.
  • Test Fixture Management - Automates the setup and teardown of database engines and sessions to provide isolated environments for individual test functions.
  • Response Validation - Validates and formats data returned by API endpoints using predefined models to ensure consistent response structures.

Historique des stars

Graphique de l'historique des stars pour fastapi/sqlmodelGraphique de l'historique des stars pour fastapi/sqlmodel

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Questions fréquentes

Que fait fastapi/sqlmodel ?

SQLModel is a type-safe object-relational mapping library for Python that integrates database schema definitions with data validation logic. By combining these two roles into a single class, it allows developers to manage relational data structures and enforce data integrity for web APIs simultaneously. The framework is built to support asynchronous database operations, enabling high-performance applications to execute queries and transactions without blocking the main…

Quelles sont les fonctionnalités principales de fastapi/sqlmodel ?

Les fonctionnalités principales de fastapi/sqlmodel sont : Data Schema Definitions, Database ORMs, Object-Relational Mapping, Data Validation, Data Persistence, Database Query Interfaces, CRUD Interfaces, Data Validation Libraries.

Quelles sont les alternatives open-source à fastapi/sqlmodel ?

Les alternatives open-source à fastapi/sqlmodel incluent : seaql/sea-orm — Sea-ORM is an asynchronous SQL object-relational mapper and database toolkit for mapping relational tables to strongly… coleifer/peewee — Peewee is a SQL object-relational mapper and query builder that provides an object-oriented interface for mapping… dotnet/efcore — Entity Framework Core is an object-relational mapper that enables developers to interact with database systems using… dapperlib/dapper — Dapper is a lightweight object-relational mapper for .NET that functions as a high-performance data access library. It… sqlalchemy/sqlalchemy — SQLAlchemy is a comprehensive Python SQL toolkit and object-relational mapper that provides a full suite of tools for… diesel-rs/diesel — This project is a type-safe database toolkit and object-relational mapper designed to enforce structural consistency…

Alternatives open source à Sqlmodel

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Sqlmodel.
  • seaql/sea-ormAvatar de SeaQL

    SeaQL/sea-orm

    9,410Voir sur GitHub↗

    Sea-ORM is an asynchronous SQL object-relational mapper and database toolkit for mapping relational tables to strongly typed objects. It provides a relational database mapper for performing CRUD operations across MySQL, PostgreSQL, and SQLite, and includes a programmatic dynamic query builder for constructing complex SQL statements. The project distinguishes itself by providing a GraphQL schema generator that transforms database entities into typed schemas with built-in pagination and filters. It also features a dedicated database migration tool for defining and applying versioned schema chan

    Rustdatabasehacktoberfestloco
    Voir sur GitHub↗9,410
  • coleifer/peeweeAvatar de coleifer

    coleifer/peewee

    11,971Voir sur GitHub↗

    Peewee is a SQL object-relational mapper and query builder that provides an object-oriented interface for mapping application classes to relational database tables. It functions as a relational database toolkit for managing schemas, executing migrations, and handling complex table relationships. The project distinguishes itself by providing an asyncio database driver for non-blocking database operations, ensuring event loop responsiveness. It also supports semi-structured data storage, allowing the storage and querying of flexible JSON documents within traditional relational database systems.

    Pythonasynciodankfastapi
    Voir sur GitHub↗11,971
  • dotnet/efcoreAvatar de dotnet

    dotnet/efcore

    14,587Voir sur GitHub↗

    Entity Framework Core is an object-relational mapper that enables developers to interact with database systems using strongly-typed code. It serves as a comprehensive data access framework, providing a unified interface for mapping application objects to relational and non-relational database schemas while managing the lifecycle of data operations through a central context. The project distinguishes itself through a provider-based architecture that decouples core data access logic from specific database engines, allowing for consistent interaction across diverse storage systems. It features a

    C#aspnet-productc-sharpdatabase
    Voir sur GitHub↗14,587
  • dapperlib/dapperAvatar de DapperLib

    DapperLib/Dapper

    18,331Voir sur GitHub↗

    Dapper is a lightweight object-relational mapper for .NET that functions as a high-performance data access library. It operates by extending standard database connection interfaces, allowing developers to execute raw SQL queries while automating the mapping of database results to strongly-typed objects. The library distinguishes itself through its use of runtime code generation, which creates high-performance instructions to map database rows to object properties with minimal overhead. It provides flexible data retrieval options, supporting both memory-buffered loading for speed and row-by-ro

    C#ado-netdappersql
    Voir sur GitHub↗18,331
Voir les 30 alternatives à Sqlmodel→