For an object relational mapping library for Swift, the strongest matches are groue/grdb.swift (GRDB), tencent/wcdb (WCDB is a robust object-relational mapping framework for SQLite) and stephencelis/sqlite.swift (This library provides a type-safe wrapper and ORM layer). vapor/fluent and prismagraphql/prisma round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
We curate open-source GitHub repositories matching “best swift orm libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
GRDB.swift is a comprehensive SQLite toolkit and object-relational mapper for Swift. It provides a database wrapper that handles local data persistence, connection management, and encrypted file storage for Apple platforms. The library features a dedicated observation framework that tracks database changes to automatically synchronize the application state and user interface in real time. It distinguishes itself with a type-safe query builder and a protocol-based mapping system that converts database rows into structured Swift objects. The toolkit covers a broad range of administrative and o
GRDB.swift is a comprehensive SQLite toolkit and ORM for Swift that provides a type-safe query builder, robust model mapping, migration management, and full support for modern Swift concurrency.
WCDB is a cross-platform storage layer and embedded database engine that serves as a framework for SQLite. It functions as an object relational mapper, linking application classes to database tables to enable data operations via objects rather than raw queries. The project is distinguished by an integrated encryption layer for securing data at rest and a full-text search engine that uses language-specific tokenizers for text lookups. It also features transparent field compression to reduce storage footprints and a connection-pooling model to coordinate simultaneous read and write operations a
WCDB is a robust object-relational mapping framework for SQLite that provides type-safe query building, model mapping, and migration management, making it a direct fit for your Swift database needs.
SQLite.swift is a type-safe Swift wrapper and object-relational mapping layer that provides a bridge for interacting with SQLite databases. It functions as a database driver that allows for embedded database management and local data persistence within Swift applications. The project distinguishes itself through a type-safe expression builder that verifies SQL statement syntax and intent at compile time. It includes specialized support for high-performance text matching via full-text search integration and provides mechanisms for securing sensitive data through database encryption. The libra
This library provides a type-safe wrapper and ORM layer for SQLite in Swift, offering robust model mapping, schema migration support, and a compile-time verified query builder.
Vapor ORM (queries, models, and relations) for NoSQL and SQL databases
Fluent is the primary ORM for the Swift ecosystem, providing a type-safe query builder, robust model mapping, migration management, and native support for SQLite with full async/await integration.
Prisma is a type-safe database object-relational mapper that uses a declarative schema to map data models to relational and document databases. It provides a unified toolkit for data access, combining a database driver with tools for schema management and record manipulation. The project features a multi-database driver that standardizes interactions across PostgreSQL, MySQL, and MongoDB. It includes a system for tracking and applying structural schema migrations across different environments and a graphical user interface for browsing and editing database records. The system ensures data in
Prisma is a database toolkit and ORM, but it is designed for TypeScript, JavaScript, and other languages via a query engine, not as a native Swift library for Swift-based database interactions.
EdgeDB is a graph-relational database that combines a PostgreSQL backend with a graph-based schema and query language. It functions as an object-relational mapper and graph query engine, allowing data to be modeled as objects and links to align storage with modern programming language structures. The system features a composable query language designed to retrieve deeply nested or interconnected data without the use of manual SQL joins. It includes an integrated AI-driven data retrieval solution with built-in support for vector embeddings. The platform provides a schema migration tool for tr
This is a standalone graph-relational database engine rather than a Swift-specific ORM library designed to be embedded within a Swift application for database interaction.
Gel is an object-relational database system that models data as a graph of interconnected objects. By utilizing a strongly typed schema, it enables complex relational queries and polymorphic data structures without the need for traditional join tables. The system integrates native vector storage and similarity search operators, allowing it to function as both a relational and a vector database for semantic data retrieval. The platform distinguishes itself through a comprehensive suite of developer-centric automation tools. It features a declarative migration system that tracks and versions sc
Gel is a standalone graph-relational database system rather than a Swift-native ORM library, meaning it requires a client driver to interact with your application code instead of providing the requested Swift-based model mapping and query building.
Pglite is a client-side relational database engine that runs a full-featured PostgreSQL instance directly within browser and Node.js environments. By leveraging WebAssembly, it provides a persistent SQL storage solution that enables complex data management and querying without requiring an external database server. The project distinguishes itself through a reactive SQL data layer that automatically synchronizes user interface components with live query results. It manages database operations using worker threads to prevent main-thread blocking and coordinates access across multiple browser t
This is a client-side PostgreSQL engine for TypeScript environments rather than an object-relational mapping library for the Swift programming language.
This is a mobile object database and NoSQL local data store that replaces relational tables with a schema-based model. It functions as a reactive data store, using live object observations and change notifications to trigger automatic user interface refreshes. The system provides built-in mobile cloud data synchronization to keep local datasets consistent with a remote server across multiple devices. It also includes security features for encrypted local storage, protecting sensitive on-disk data using at-rest encryption keys and fine-grained access control. Broad capabilities include object
This is a specialized NoSQL mobile object database rather than a traditional relational ORM, meaning it replaces SQL-based interactions with its own proprietary object-store architecture.
Drift is a type-safe SQL persistence library and relational mapper that provides a structured way to map database tables to classes and execute SQL queries with build-time validation. It functions as a type-safe query builder and a wrapper for SQLite and PostgreSQL, eliminating manual result set parsing by binding query outputs to native objects. The project distinguishes itself through a build-time code generation system that produces type-safe APIs and validates raw SQL statements against database versions before execution. It features reactive query streaming, which transforms SQL queries
This library provides type-safe SQL persistence and relational mapping, but it is built for the Dart and Flutter ecosystem rather than the Swift programming language requested.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| groue/grdb.swift | 8.2K | Swift | mit | |
| tencent/wcdb | 11.5K | C | NOASSERTION | |
| stephencelis/sqlite.swift | 10.2K | Swift | MIT | |
| vapor/fluent | 1.4K | Swift | MIT | |
| prismagraphql/prisma | 16.4K | Scala | Apache-2.0 | |
| edgedb/edgedb | 14.1K | Python | Apache-2.0 | |
| geldata/gel | 14.1K | Python | apache-2.0 | |
| electric-sql/pglite | 14.7K | TypeScript | apache-2.0 | |
| realm/realm-swift | 16.6K | Objective-C | Apache-2.0 | |
| simolus3/drift | 3.2K | Dart | MIT |