For a database library for Swift applications, the strongest matches are realm/realm-swift (Realm is a native mobile database that provides object-oriented), groue/grdb.swift (GRDB) and tencent/wcdb (WCDB is a robust, cross-platform ORM built on SQLite). stephencelis/sqlite.swift and cberner/redb 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 database libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
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
Realm is a native mobile database that provides object-oriented persistence, reactive data binding, and encryption, making it a comprehensive solution for local data management in Swift applications.
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, native Swift toolkit that provides robust object-relational mapping, ACID-compliant SQLite persistence, and built-in reactive observation for real-time UI synchronization.
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, cross-platform ORM built on SQLite that provides native Swift interfaces for object-relational mapping, encryption, and performance-focused database management on Apple platforms.
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, native Swift interface for SQLite that handles object-relational mapping, ACID-compliant transactions, and encryption, making it a robust choice for local data persistence in Apple ecosystem applications.
redb is an embedded key-value store and ACID-compliant storage engine. It functions as a persistent storage system for saving and retrieving data as key-value pairs within a tree structure. The engine is built as an MVCC transactional database, utilizing multi-version concurrency control to manage simultaneous reads and writes without blocking. It employs a single-writer multi-reader model to ensure data consistency while allowing multiple threads to access the store. The system provides persistent state management and atomic transaction management to prevent data corruption during crashes.
This is a low-level key-value storage engine written in Rust, which lacks the native Swift API and object-relational mapping features required for an iOS or macOS application database.
Ent is a statically typed entity framework for Go that models database structures as a graph of nodes and edges. It functions as a code generation engine that transforms schema definitions into type-safe database clients, query builders, and migration scripts. By representing data as interconnected entities, the framework enables intuitive traversal of complex relationships and ensures that database interactions remain consistent with the application model at compile time. The framework distinguishes itself through its graph-based approach to data modeling and its reliance on compile-time cod
This is a Go-based entity framework designed for server-side applications, making it incompatible with the native Swift environment required for iOS or macOS development.
TypeDB is a strongly-typed graph database and knowledge graph management system. It serves as a multi-model data store that unifies relational, document, and graph structures into a single environment, functioning as both an ACID compliant database and a declarative query engine. The system distinguishes itself through the use of n-ary hypergraph modeling and polymorphic type hierarchies. It employs a strongly-typed schema to enforce structural rules and validate data integrity, allowing for type-based polymorphic inference and role-based interface polymorphism to resolve complex relationship
TypeDB is a server-side graph database and knowledge management system, which is a different category than the local, embedded Swift ORM libraries used for native iOS or macOS data persistence.
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
This is a Rust-based ORM and database toolkit, which does not provide the native Swift API required for iOS or macOS application development.
MagicalRecord is a data persistence library and wrapper for Core Data that implements the Active Record pattern. It maps database rows directly to object instances, allowing for the creation, update, and retrieval of records without writing manual query logic. The project functions as a mapping layer that synchronizes object properties with a managed object context. It utilizes generic-based type resolution and model-class querying to enable data fetching directly on model classes, which removes the need for a separate external manager and reduces repetitive fetch request boilerplate. The li
This library is an Objective-C wrapper for Core Data that provides an Active Record pattern, but it does not offer a native Swift API or the modern reactive features required for a Swift-first persistence layer.
Prisma is a database toolkit that provides a unified access layer for interacting with relational and document databases. It centers on a declarative schema modeling approach, where developers define their data structures in a human-readable language. This schema serves as the single source of truth, from which the toolkit automatically generates type-safe database clients that provide compile-time validation and editor autocomplete for all data operations. The project distinguishes itself through a high-performance, Rust-based query engine that handles query planning and connection pooling o
This is a server-side database toolkit designed for Node.js and TypeScript environments, rather than a native Swift library for local data persistence within iOS or macOS applications.
FoundationDB is an ACID-compliant distributed transactional key-value store. It functions as a scalable database engine that ensures strict serializability and data consistency across a cluster of servers using a shared-nothing architecture. The system is distinguished by its multi-region replication capabilities, allowing data to be synchronized across different datacenters for high availability and disaster recovery. It utilizes optimistic concurrency control to manage distributed transactions and employs a majority-based coordination system to maintain cluster state. The platform provides
FoundationDB is a distributed, server-side key-value store designed for large-scale clusters, rather than a native Swift library for local object-relational mapping within iOS or macOS applications.
SurrealDB is a multi-model database engine designed to store and query document, graph, relational, and vector data within a single ACID-compliant platform. It functions as an AI-native data store, integrating vector search, graph traversal, and machine learning model execution directly into its query layer. By providing a unified declarative query language, the platform eliminates the need for external middleware to synchronize data across different storage models. The platform distinguishes itself through its ability to manage agent memory and complex workflows natively. It allows developer
SurrealDB is a distributed, multi-model database server rather than a native Swift library or ORM designed for local application-level data persistence.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| realm/realm-swift | 16.6K | Objective-C | Apache-2.0 | |
| groue/grdb.swift | 8.2K | Swift | mit | |
| tencent/wcdb | 11.5K | C | NOASSERTION | |
| stephencelis/sqlite.swift | 10.2K | Swift | MIT | |
| cberner/redb | 4.2K | Rust | apache-2.0 | |
| ent/ent | 17.1K | Go | Apache-2.0 | |
| typedb/typedb | 4.4K | Rust | MPL-2.0 | |
| seaql/sea-orm | 9.4K | Rust | apache-2.0 | |
| magicalpanda/magicalrecord | 10.7K | Objective-C | NOASSERTION | |
| prisma/prisma | 46.4K | TypeScript | Apache-2.0 |