# seaql/sea-orm

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/seaql-sea-orm).**

9,410 stars · 668 forks · Rust · apache-2.0

## Links

- GitHub: https://github.com/SeaQL/sea-orm
- Homepage: https://www.sea-ql.org/SeaORM/
- awesome-repositories: https://awesome-repositories.com/repository/seaql-sea-orm.md

## Topics

`database` `hacktoberfest` `loco` `mariadb` `mysql` `orm` `postgres` `rust` `sql` `sqlite` `sqlx` `tokio`

## Description

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 changes.

The toolkit covers broad capability areas including relational data modeling and schema management, where it supports the automatic generation of entities from existing database schemas. It further provides advanced query building features such as aggregate value computation, partial model projection, and linked entity fetching, all executed within non-blocking asynchronous runtimes.

The project includes a command-line interface for database entity generation and GraphQL server bootstrapping.

## Tags

### Data & Databases

- [Database ORMs](https://awesome-repositories.com/f/data-databases/database-orms.md) — Maps relational database records to strongly typed application objects within an asynchronous runtime.
- [Object-Relational Mappers](https://awesome-repositories.com/f/data-databases/object-relational-mappers.md) — Provides a full object-relational mapper for bridging relational database tables with strongly typed objects.
- [Asynchronous Database Command Execution](https://awesome-repositories.com/f/data-databases/asynchronous-database-command-execution.md) — Performs relational database operations using non-blocking asynchronous I/O to prevent thread exhaustion. ([source](https://www.sea-ql.org/SeaORM/docs/0.10.x/internal-design/diesel/))
- [Cross-Engine Database Compatibility](https://awesome-repositories.com/f/data-databases/cross-engine-database-compatibility.md) — Enables application logic to run across PostgreSQL, MySQL, and SQLite without changing code.
- [Database Driver Abstractions](https://awesome-repositories.com/f/data-databases/database-driver-abstractions.md) — Decouples business logic from specific database engines by deferring syntax and driver resolution to runtime configuration.
- [Database Engine Abstractions](https://awesome-repositories.com/f/data-databases/database-engine-abstractions.md) — Decouples business logic from specific database engines to run the same code across different backends. ([source](https://www.sea-ql.org/SeaORM/docs/0.11.x/internal-design/architecture/))
- [Atomic Transactions](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/connection-transaction-management/atomic-transactions.md) — Groups multiple database operations into single atomic units to ensure data consistency and integrity. ([source](https://www.sea-ql.org/SeaORM/docs/0.12.x/index/))
- [Database Schema Migrations](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-management/database-schema-migrations.md) — Provides tools for defining and applying versioned schema updates to maintain structural compatibility.
- [Database Connections](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-systems/database-connections.md) — Manages the lifecycle of opening, initializing, and session-handling for relational database connections. ([source](https://www.sea-ql.org/sea-orm-tutorial/ch02-02-connect-to-database))
- [Database Migrations](https://awesome-repositories.com/f/data-databases/database-migrations.md) — Ships a dedicated utility for versioning and applying incremental schema changes to databases.
- [Database Query Joins](https://awesome-repositories.com/f/data-databases/database-query-joins.md) — Supports specifying non-standard criteria and custom expressions for joining relational tables. ([source](https://www.sea-ql.org/SeaORM/docs/0.10.x/relation/custom-join-condition/))
- [Eager Loading](https://awesome-repositories.com/f/data-databases/database-query-joins/eager-loading.md) — Retrieves related data across complex join paths in a single query to avoid multiple round-trips. ([source](https://www.sea-ql.org/SeaORM/docs/0.4.x/relation/chained-relations/))
- [CRUD Interfaces](https://awesome-repositories.com/f/data-databases/database-record-management/crud-interfaces.md) — Provides a configurable dynamic API for executing create, read, update, and delete actions on records. ([source](https://www.sea-ql.org/sea-orm-pro/docs/index/))
- [Database Table Generation](https://awesome-repositories.com/f/data-databases/database-table-generation.md) — Programmatically generates SQL statements to create database tables and foreign key constraints from entity models. ([source](https://www.sea-ql.org/SeaORM/docs/1.0.x/schema-statement/create-table/))
- [Dynamic SQL Generators](https://awesome-repositories.com/f/data-databases/dynamic-sql-generators.md) — Constructs SQL queries programmatically at runtime using a fluent API instead of static raw strings. ([source](https://www.sea-ql.org/SeaORM/docs/internal-design/architecture/))
- [SQL Syntax Tree Construction](https://awesome-repositories.com/f/data-databases/expression-based-data-querying/fluent-query-apis/sql-syntax-tree-construction.md) — Builds complex database statements by programmatically manipulating a SQL syntax tree through a tiered fluent API.
- [Fluent Query Builders](https://awesome-repositories.com/f/data-databases/fluent-query-builders.md) — Offers a fluent, chainable API for constructing complex SQL statements at runtime.
- [Many-to-Many Associations](https://awesome-repositories.com/f/data-databases/many-to-many-associations.md) — Implements complex entity relationships including one-to-one, one-to-many, and many-to-many associations. ([source](https://www.sea-ql.org/SeaORM/docs/0.6.x/index/))
- [Active-Record ORMs](https://awesome-repositories.com/f/data-databases/object-relational-mappers/active-record-orms.md) — Implements the Active Record pattern to track model changes and map them back to database records.
- [Relational Association Mapping](https://awesome-repositories.com/f/data-databases/object-relational-mappings/code-to-relational-mappings/relational-association-mapping.md) — Defines relational associations by linking child tables to parent entities using specific relation names. ([source](https://www.sea-ql.org/sea-orm-pro/docs/composite-table-config/child-table/))
- [Query Aggregates](https://awesome-repositories.com/f/data-databases/query-aggregates.md) — Calculates summary statistics such as sums, averages, and counts across database records. ([source](https://www.sea-ql.org/SeaORM/docs/advanced-query/aggregate-function/))
- [Pagination](https://awesome-repositories.com/f/data-databases/query-result-fetching/pagination.md) — Implements both offset-based and cursor-based pagination to retrieve large datasets in manageable chunks. ([source](https://www.sea-ql.org/SeaORM/docs/internal-design/diesel/))
- [Query Filters](https://awesome-repositories.com/f/data-databases/query-sorting/query-filters.md) — Applies logical AND, OR, and nested conditional expressions to refine records returned from the database. ([source](https://www.sea-ql.org/SeaORM/docs/advanced-query/conditional-expression/))
- [Advanced SQL Construct Execution](https://awesome-repositories.com/f/data-databases/raw-sql-execution/advanced-sql-construct-execution.md) — Supports execution of complex SQL features including subqueries, aggregate functions, and custom SQL constructs. ([source](https://www.sea-ql.org/SeaORM/docs/0.11.x/index/))
- [AST-Based Query Construction](https://awesome-repositories.com/f/data-databases/raw-sql-execution/advanced-sql-construct-execution/ast-based-query-construction.md) — Constructs advanced database statements programmatically by manipulating a SQL syntax tree through a tiered API. ([source](https://www.sea-ql.org/SeaORM/docs/0.11.x/internal-design/architecture/))
- [Record Insertion](https://awesome-repositories.com/f/data-databases/record-insertion.md) — Creates new entries or modifies existing rows in a table using active models to track changes. ([source](https://www.sea-ql.org/sea-orm-tutorial/ch01-05-basic-crud-operations))
- [Relational Data Modeling](https://awesome-repositories.com/f/data-databases/relational-data-modeling.md) — Defines complex data associations including one-to-many and many-to-many relationships between entities.
- [Schema Definitions](https://awesome-repositories.com/f/data-databases/schema-definitions.md) — Provides a unified toolset for the declarative definition and management of relational database schemas. ([source](https://www.sea-ql.org/SeaORM/docs/0.10.x/internal-design/diesel/))
- [Asynchronous SQL Toolkits](https://awesome-repositories.com/f/data-databases/sql-database-connectors/asynchronous-sql-toolkits.md) — Provides a comprehensive asynchronous SQL toolkit for type-safe mapping and query execution.
- [Type-Safe](https://awesome-repositories.com/f/data-databases/sql-generators/type-safe.md) — Uses traits to define data structures and relationships, ensuring type-safe mapping between tables and columns. ([source](https://cdn.jsdelivr.net/gh/seaql/sea-orm@master/README.md))
- [SQL Query Builders](https://awesome-repositories.com/f/data-databases/sql-query-builders.md) — Provides a programmatic interface for constructing structured SQL operations with filters and joins.
- [Entity Mappings](https://awesome-repositories.com/f/data-databases/type-mapping-frameworks/script-to-native-type-mappings/entity-mappings.md) — Maps relational database tables to strongly typed structures using shared interfaces to ensure type safety.
- [Type Mapping Converters](https://awesome-repositories.com/f/data-databases/type-mapping-utilities/type-mapping-converters.md) — Converts raw query outputs into structured language types and assembles related entities. ([source](https://www.sea-ql.org/SeaORM/docs/0.12.x/internal-design/architecture/))
- [Unified Database Interfaces](https://awesome-repositories.com/f/data-databases/unified-database-interfaces.md) — Communicates with MySQL, PostgreSQL, and SQLite using a single, unified asynchronous interface. ([source](https://www.sea-ql.org/sea-orm-tutorial/ch01-00-build-backend-getting-started))
- [Connection Pooling](https://awesome-repositories.com/f/data-databases/connection-pooling.md) — Maintains a cache of open asynchronous database connections to reduce session overhead and improve performance. ([source](https://www.sea-ql.org/SeaORM/docs/0.12.x/index/))
- [Connection Pools](https://awesome-repositories.com/f/data-databases/connection-pools.md) — Maintains a cache of open asynchronous connections to reduce the overhead of establishing new sessions.
- [GraphQL API Generators](https://awesome-repositories.com/f/data-databases/data-access-querying/database-apis/graphql-api-generators.md) — Transforms database entities into typed GraphQL schemas with built-in support for pagination and filters. ([source](https://www.sea-ql.org/SeaORM/docs/graph-ql/seaography-intro/))
- [Data-to-Model Mappers](https://awesome-repositories.com/f/data-databases/data-models/data-to-model-mappers.md) — Converts partial data structures into database-ready models to facilitate selective field updates and API submissions. ([source](https://www.sea-ql.org/SeaORM/docs/0.9.x/advanced-query/custom-active-model/))
- [Database Indexing](https://awesome-repositories.com/f/data-databases/database-indexing.md) — Generates and executes SQL commands to create database indices based on entity definitions. ([source](https://www.sea-ql.org/SeaORM/docs/0.10.x/generate-sea-query-statement/create-index/))
- [Eager Loading](https://awesome-repositories.com/f/data-databases/eager-loading.md) — Retrieves related data through predefined associations using either separate queries or single joined operations.
- [Relational Entity Filtering](https://awesome-repositories.com/f/data-databases/entity-relationships/relational-entity-filtering.md) — Restricts results to entities that meet specific relationship conditions using EXISTS subqueries. ([source](https://www.sea-ql.org/SeaORM/docs/advanced-query/conditional-expression/))
- [Enum Definitions](https://awesome-repositories.com/f/data-databases/enum-definitions.md) — Generates database-specific enum type definitions across multiple supported relational backends. ([source](https://www.sea-ql.org/SeaORM/docs/1.0.x/schema-statement/create-enum/))
- [Application-to-Database Enum Mapping](https://awesome-repositories.com/f/data-databases/enum-definitions/application-to-database-enum-mapping.md) — Connects database-level enumeration types to application-level enums using native types or standard columns. ([source](https://www.sea-ql.org/SeaORM/docs/0.10.x/generate-sea-query-statement/create-enum/))
- [Partial Model Projections](https://awesome-repositories.com/f/data-databases/partial-model-projections.md) — Selects a specific subset of columns from a table and maps them into a projection struct. ([source](https://www.sea-ql.org/SeaORM/docs/internal-design/diesel/))
- [Result Streaming](https://awesome-repositories.com/f/data-databases/query-result-fetching/result-streaming.md) — Fetches large datasets incrementally via cursors to prevent memory exhaustion during processing. ([source](https://www.sea-ql.org/SeaORM/docs/index/))
- [Raw SQL Execution](https://awesome-repositories.com/f/data-databases/raw-sql-execution.md) — Executes complex queries using raw SQL strings with parameter expansion for specialized scenarios. ([source](https://www.sea-ql.org/SeaORM/docs/internal-design/diesel/))
- [Record Deletion](https://awesome-repositories.com/f/data-databases/record-deletion.md) — Removes specific records or groups of records from a table based on filters or model instances. ([source](https://cdn.jsdelivr.net/gh/seaql/sea-orm@master/README.md))
- [Result Grouping](https://awesome-repositories.com/f/data-databases/result-grouping.md) — Organizes database records into sets based on shared values and applies conditional filters to those groups. ([source](https://www.sea-ql.org/SeaORM/docs/advanced-query/aggregate-function/))

### Development Tools & Productivity

- [Database Schema Scaffolding](https://awesome-repositories.com/f/development-tools-productivity/code-generators/boilerplate-generators/database-schema-scaffolding.md) — Automatically generates strongly typed data models and boilerplate entities from existing database schemas. ([source](https://www.sea-ql.org/SeaORM-X/docs/index/))
- [Schema-Driven Code Generators](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/code-generation/schema-driven-code-generators.md) — Automatically creates strongly typed data models and entities from an existing database schema using a CLI tool.

### Programming Languages & Runtimes

- [Asynchronous Runtime Compatibility](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/deployment-specific-runtimes/backend-runtimes/asynchronous-runtime-compatibility.md) — Executes database operations using non-blocking I/O to maintain compatibility across various asynchronous execution environments.

### Software Engineering & Architecture

- [Concurrent Query Handlers](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-query-handlers.md) — Executes multiple database operations in parallel using asynchronous primitives to increase application throughput. ([source](https://www.sea-ql.org/SeaORM/docs/0.10.x/introduction/async/))

### Testing & Quality Assurance

- [Database Interaction Mocking](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-data-management/test-mock-management-tools/database-interaction-mocking.md) — Simulates database behavior in controlled environments to test application logic without live connections. ([source](https://www.sea-ql.org/SeaORM/docs/0.11.x/index/))

### Web Development

- [Server Implementations](https://awesome-repositories.com/f/web-development/graphql-apis/server-implementations.md) — Provides a CLI to bootstrap ready-to-run GraphQL server implementations across multiple web frameworks. ([source](https://www.sea-ql.org/SeaORM/docs/graph-ql/seaography-intro/))
- [GraphQL Schema Generation](https://awesome-repositories.com/f/web-development/graphql-schema-generation.md) — Transforms database entities into typed GraphQL schemas with built-in support for pagination and filters.
