From 6225c320074dc1c987487f9265057995546bf3fe Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Mon, 13 Jan 2025 16:54:28 -0500 Subject: [PATCH] feat: Fixes 'any' not being used in some function calls. --- Package.swift | 5 ++++- Sources/App/Controllers/ApiController.swift | 2 +- Sources/App/Models/Employee.swift | 4 ++-- Sources/App/Models/Vendor.swift | 4 ++-- Sources/App/Models/VendorBranch.swift | 4 ++-- Sources/DatabaseClientLive/Employees.swift | 4 ++-- Sources/DatabaseClientLive/VendorBranches.swift | 4 ++-- Sources/DatabaseClientLive/Vendors.swift | 4 ++-- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Package.swift b/Package.swift index 7f511cb..52fad14 100644 --- a/Package.swift +++ b/Package.swift @@ -87,5 +87,8 @@ let package = Package( var swiftSettings: [SwiftSetting] { [ .enableUpcomingFeature("DisableOutwardActorInference"), - .enableExperimentalFeature("StrictConcurrency") + .enableExperimentalFeature("StrictConcurrency=complete"), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("ConciseMagicFile"), + .enableUpcomingFeature("ForwardTrailinClosures") ] } diff --git a/Sources/App/Controllers/ApiController.swift b/Sources/App/Controllers/ApiController.swift index 81575b2..bd49309 100644 --- a/Sources/App/Controllers/ApiController.swift +++ b/Sources/App/Controllers/ApiController.swift @@ -2,7 +2,7 @@ import Fluent import Vapor struct ApiController: RouteCollection { - func boot(routes: RoutesBuilder) throws { + func boot(routes: any RoutesBuilder) throws { try routes.register(collection: EmployeeApiController()) try routes.register(collection: PurchaseOrderApiController()) try routes.register(collection: UserApiController()) diff --git a/Sources/App/Models/Employee.swift b/Sources/App/Models/Employee.swift index d6348fc..2bce85a 100644 --- a/Sources/App/Models/Employee.swift +++ b/Sources/App/Models/Employee.swift @@ -123,7 +123,7 @@ extension Employee { let name = "CreateEmployee" - func prepare(on database: Database) async throws { + func prepare(on database: any Database) async throws { try await database.schema(Employee.schema) .id() .field("first_name", .string, .required) @@ -135,7 +135,7 @@ extension Employee { .create() } - func revert(on database: Database) async throws { + func revert(on database: any Database) async throws { try await database.schema(Employee.schema).delete() } diff --git a/Sources/App/Models/Vendor.swift b/Sources/App/Models/Vendor.swift index 555bc96..5ce69e9 100644 --- a/Sources/App/Models/Vendor.swift +++ b/Sources/App/Models/Vendor.swift @@ -78,7 +78,7 @@ extension Vendor { struct Migrate: AsyncMigration { let name = "CreateVendor" - func prepare(on database: Database) async throws { + func prepare(on database: any Database) async throws { try await database.schema(Vendor.schema) .id() .field("name", .string, .required) @@ -88,7 +88,7 @@ extension Vendor { .create() } - func revert(on database: Database) async throws { + func revert(on database: any Database) async throws { try await database.schema(Vendor.schema).delete() } } diff --git a/Sources/App/Models/VendorBranch.swift b/Sources/App/Models/VendorBranch.swift index 2eaedde..dd36eee 100644 --- a/Sources/App/Models/VendorBranch.swift +++ b/Sources/App/Models/VendorBranch.swift @@ -83,7 +83,7 @@ extension VendorBranch { struct Migrate: AsyncMigration { let name = "CreateVendorBranch" - func prepare(on database: Database) async throws { + func prepare(on database: any Database) async throws { try await database.schema(VendorBranch.schema) .id() .field("name", .string, .required) @@ -94,7 +94,7 @@ extension VendorBranch { .create() } - func revert(on database: Database) async throws { + func revert(on database: any Database) async throws { try await database.schema(VendorBranch.schema).delete() } } diff --git a/Sources/DatabaseClientLive/Employees.swift b/Sources/DatabaseClientLive/Employees.swift index 8faf733..39fe72e 100644 --- a/Sources/DatabaseClientLive/Employees.swift +++ b/Sources/DatabaseClientLive/Employees.swift @@ -82,7 +82,7 @@ extension Employee { let name = "CreateEmployee" - func prepare(on database: Database) async throws { + func prepare(on database: any Database) async throws { try await database.schema(EmployeeModel.schema) .id() .field("first_name", .string, .required) @@ -94,7 +94,7 @@ extension Employee { .create() } - func revert(on database: Database) async throws { + func revert(on database: any Database) async throws { try await database.schema(EmployeeModel.schema).delete() } diff --git a/Sources/DatabaseClientLive/VendorBranches.swift b/Sources/DatabaseClientLive/VendorBranches.swift index 9075b40..2f29e01 100644 --- a/Sources/DatabaseClientLive/VendorBranches.swift +++ b/Sources/DatabaseClientLive/VendorBranches.swift @@ -55,7 +55,7 @@ extension VendorBranch { struct Migrate: AsyncMigration { let name = "CreateVendorBranch" - func prepare(on database: Database) async throws { + func prepare(on database: any Database) async throws { try await database.schema(VendorBranchModel.schema) .id() .field("name", .string, .required) @@ -66,7 +66,7 @@ extension VendorBranch { .create() } - func revert(on database: Database) async throws { + func revert(on database: any Database) async throws { try await database.schema(VendorBranchModel.schema).delete() } } diff --git a/Sources/DatabaseClientLive/Vendors.swift b/Sources/DatabaseClientLive/Vendors.swift index f0001a7..f2838f3 100644 --- a/Sources/DatabaseClientLive/Vendors.swift +++ b/Sources/DatabaseClientLive/Vendors.swift @@ -52,7 +52,7 @@ extension Vendor { struct Migrate: AsyncMigration { let name = "CreateVendor" - func prepare(on database: Database) async throws { + func prepare(on database: any Database) async throws { try await database.schema(VendorModel.schema) .id() .field("name", .string, .required) @@ -62,7 +62,7 @@ extension Vendor { .create() } - func revert(on database: Database) async throws { + func revert(on database: any Database) async throws { try await database.schema(VendorModel.schema).delete() } }