Skip to content

Beam-Studio/FluentData

Repository files navigation

MIT license Swift 5.9 supported Swift Package Manager compatible

Supports iOS 14+ Supports macOS 12+ Supports watchOS 7+ Supports tvOS 14+

FluentData

an alternative to SwiftData, built with Fluent

Features

  • Multiple storage options:
    • Memory: database starts fresh everytime, no data persist across app launches
    • File: database is stored locally on device
    • iCloud: database is synced via the iCloud settings of the device (works only on iOS and macOS)
    • Bundle: database is loaded from a file in the bundle, it will be loaded in read-only mode
  • Migrations: so your data model can painlessly evolve with your application
  • Query result updates with Combine: update your views automatically when database gets updated
  • Middlewares: execute code when data is inserted, updated and/or deleted
  • Compatible with Alexey Naumov's vision of Clean Architecture for SwiftUI.

Installation

To install FluentData you can follow the tutorial published by Apple using the URL for the FluentData repo with the current version:

  1. In Xcode, select “File” → “Add Packages...”
  2. Enter https://github.com/Beam-Studio/FluentData.git

or you can add the following dependency to your Package.swift:

.package(url: "https://github.com/Beam-Studio/FluentData.git", from: "main")

Usage

To learn how to use FluentData, you can have a look at the documentation of FluentData here.

There also is an example project to demonstrate how to use FluentData following the Clean architecture as described by Alexey Naumov.

License

This project is released under the MIT license.