vmanot/SwiftDB
vmanot/SwiftDB has 338 GitHub stars and 8 forks. Star changes are not measured yet. Last checked 2026-11-14 02:10 UTC. Last push 2025-08-06.
측정된 스타 증가
- in 24h
- 기록 수집 중
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
A modern database abstraction layer + runtime, batteries included [WIP].
데이터README.md
OriginalSwiftDB [WIP]
[!IMPORTANT] This package is under development and is being currently rewritten to fully leverage Swift 5.9.
A modern, type-safe database abstraction layer. SwiftDB aims to be an opinionated DBAL for relational and document-oriented databases.
Get Started
Define an Entity:
struct Foo: Entity, Identifiable {
@Attribute var bar: String = "Untitled"
var id: some Hashable {
bar
}
}
Define a Schema:
struct MySchema: Schema {
var entities: Entities {
Foo.self
}
}
Create a ContentView for your application:
struct ContentView: View {
@StateObject var container = PersistentContainer(MySchema())
var body: some View {
Text("Hello World")
}
}
Create a list view:
struct ListView: View {
@EnvironmentObject var container: PersistentContainer
@QueryModels<Foo>() var models
var body: some View {
NavigationView {
List(models) { foo in
NavigationLink(destination: EditView(foo: foo)) {
Text(foo.bar)
}
.contextMenu {
Button {
container.delete(foo)
} label: {
Text("Delete")
}
}
}
.navigationBarItems(
trailing: Button {
container.create(Foo.self)
} label: {
Image(systemName: .plusCircleFill)
.imageScale(.large)
}
)
.navigationBarTitle("A List of Foo")
}
}
struct EditView: View {
@EnvironmentObject var container: PersistentContainer
let foo: Foo
var body: some View {
VStack {
Form {
TextField("Enter a value", text: foo.$bar) {
container.save()
}
}
}
.navigationBarTitle("Edit Foo")
}
}
}
Add it to our ContentView:
struct ContentView: View {
@StateObject var container = PersistentContainer(MySchema())
var body: some View {
ListView()
.databaseContainer(container)
}
}
That's it.
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,710 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,892 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,490 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,521 스타