https://github.com/catverse/balam
Swift NoSQL functional database
https://github.com/catverse/balam
codable combine database functional ios macos nosql spm swift swift-package swift-package-manager watchos
Last synced: 4 months ago
JSON representation
Swift NoSQL functional database
- Host: GitHub
- URL: https://github.com/catverse/balam
- Owner: catverse
- License: mit
- Created: 2020-02-16T14:14:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-08T12:21:20.000Z (over 5 years ago)
- Last Synced: 2026-02-18T13:35:10.038Z (4 months ago)
- Topics: codable, combine, database, functional, ios, macos, nosql, spm, swift, swift-package, swift-package-manager, watchos
- Language: Swift
- Homepage:
- Size: 94.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Balam 
Native database written in Swift for iOS, macOS and watchOS.
## Features
- NoSQL
- Minimum maintenance
- Frictionless migration
- Bullet proof
- Codable
- Combine
- Functional queries
- Swift Package Manager
## Requirements
- iOS 13+
- macOS 10.15+
- watchOS 6+
## Get Started
### Install
Point Swift Package Manager to this repository
### Import
```swift
import Balam
```
### Usage
Load or create a new database
```swift
let balam = Balam("MyDb")
```
Add a Codable Struct to the database
```swift
let myStruct = MyStruct()
balam.add(myStruct)
```
Get all items of a type
```swift
var subscription: AnyCancellable?
func getItems() {
subscription = balam.get(MyStruct.self).sink { items in
/***
items is an array with all items of type MyStruct.
Balam guaranties to send this array once, if no item was
found the array will be empty.
From here you can apply any transformation or function
to items: map, filter, sort, ...
**/
}
}
```