feat: Begins breaking database out into it's own module, using dependencies
This commit is contained in:
27
Sources/DatabaseClientLive/Live.swift
Normal file
27
Sources/DatabaseClientLive/Live.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
import DatabaseClient
|
||||
import FluentKit
|
||||
import SharedModels
|
||||
|
||||
public extension DatabaseClient {
|
||||
|
||||
/// Create the live database client.
|
||||
static func live(database: any Database) -> Self {
|
||||
.init(
|
||||
employees: .live(database: database),
|
||||
migrations: {
|
||||
[
|
||||
Employee.Migrate(),
|
||||
PurchaseOrder.Migrate(),
|
||||
User.Migrate(),
|
||||
User.Token.Migrate(),
|
||||
VendorBranch.Migrate(),
|
||||
Vendor.Migrate()
|
||||
]
|
||||
},
|
||||
purchaseOrders: .live(database: database),
|
||||
users: .live(database: database),
|
||||
vendorBranches: .live(database: database),
|
||||
vendors: .live(database: database)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user