![]() Let dbPool = try DatabasePool( path: "/path/to/database.sqlite ") Import GRDB // Pick one: let dbQueue = try DatabaseQueue( path: "/path/to/database.sqlite ") GRDB provides two classes for accessing SQLite databases: DatabaseQueue and DatabasePool: □ Tip: see the Demo Applications for examples of such integration. Manuallyĭownload a copy of GRDB, or clone its repository and make sure you checkout the latest tagged version.Įmbed the GRDB.xcodeproj project in your own project.Īdd the GRDB target in the Target Dependencies section of the Build Phases tab of your application target (extension target for WatchOS).Īdd the amework to the Embedded Binaries section of the General tab of your application target (extension target for WatchOS). For some context about this decision, see #433. UI and Unit testing targets are OK, though. Warning: Due to an Xcode bug, you will get "No such module 'CSQLite'" errors when you want to embed the GRDB package in other targets than the main application (watch extensions, for example). See How to link a Swift Package as dynamic for more information. The GRDB-dynamic library can reveal useful if you are going to link it with multiple targets within your app and only wish to link to a shared, dynamic framework once. ![]() GRDB offers two libraries, GRDB and GRDB-dynamic. To use GRDB with SPM, add a dependency to The Swift Package Manager automates the distribution of Swift code. GRDB can be installed as a framework, or a static library. To use GRDB with CocoaPods (version 1.2 or higher), specify in your Podfile: CocoaPodsĬocoaPods is a dependency manager for Xcode projects. ![]() See Custom SQLite builds for the installation procedure of GRDB with a customized build of SQLite. See Encryption for the installation procedure of GRDB with SQLCipher. The installation procedures below have GRDB use the version of SQLite that ships with the target operating system. □ Recommended Practices for Designing Record Types.Combine: Access and observe the database with Combine publishers.SwiftUI: Access and observe the database from your SwiftUI views.Concurrency: How to access databases in a multi-threaded application.Sharing a Database: How to share an SQLite database between multiple processes - recommendations for App Group containers, App Extensions, App Sandbox, and file coordination.Interrupt a Database: Abort any pending database operation.Backup: Dump the content of a database to another.Encryption: Encrypt your database with SQLCipher.Database Observation: Observe database changes and transactions. ![]() Full-Text Search: Perform efficient and customizable full-text searches.Migrations: Transform your database as your application evolves.Query Interface: A swift way to generate SQL.Records: Fetching and persistence methods for your custom structs and class hierarchies.Database Connections: Connect to SQLite databases.Demo Applications: Three flavors: vanilla UIKit, Combine + SwiftUI, and Async/Await + SwiftUI.Demo Applications & Frequently Asked Questions For general and detailed information, jump to the SQLite Documentation. GRDB runs on top of SQLite: you should get familiar with the SQLite FAQ. See Database Observation, Combine Support, RxGRDB. Combine let cancellable = observation. Usage Start using the database in four steps Come with your SQL and SQLite skills, or learn new ones as you go! But when you do, GRDB is as sharp as you want it to be. Not all developers need advanced SQLite features. Multi-threaded applications can efficiently use their databases, including WAL databases that support concurrent reads and writes.Įvolve the schema of your database as you ship new versions of your application. Get notifications when database values are modified. It comes with built-in tools that address common needs:Įnhance your application models with persistence and fetching methods, so that you don't have to deal with SQL and raw database rows when you don't want to. Use this library to save your application’s permanent data into SQLite databases. A question? Looking for advice? Do you wonder how to contribute? Fancy a chat? Go to the GitHub discussions, or the GRDB forums.Make sure you check the existing issues first. Release announcements and usage tips: follow on Twitter, on Mastodon.A toolkit for SQLite databases, with a focus on application development
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |