Skip to content

Commit

Permalink
Update tests for deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynne committed May 12, 2024
1 parent b13ee05 commit 308ddcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/FluentBenchmark/Tests/FilterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extension FluentBenchmarker {
SolarSystem()
]) {
let moon = try Moon.query(on: self.database)
.filter(\.$name == .sql(raw: "'Moon'"))
.filter(\.$name == .sql(unsafeRaw: "'Moon'"))
.first()
.wait()

Expand Down
6 changes: 3 additions & 3 deletions Sources/FluentBenchmark/Tests/SchemaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ extension FluentBenchmarker {
.constraint(.sql(embed: "CONSTRAINT \(normalized1) UNIQUE (\(ident: "id"))"))

// Test raw SQL for table constraint definitions (but not names):
.constraint(.constraint(.sql(raw: "UNIQUE (id)"), name: "id_unq_2"))
.constraint(.constraint(.sql(unsafeRaw: "UNIQUE (id)"), name: "id_unq_2"))
.constraint(.constraint(.sql(embed: "UNIQUE (\(ident: "id"))"), name: "id_unq_3"))

.create().wait()

if (self.database as! any SQLDatabase).dialect.alterTableSyntax.allowsBatch {
try self.database.schema("custom_constraints")
// Test raw SQL for dropping constraints:
.deleteConstraint(.sql(embed: "\(SQLDropTypedConstraint(name: SQLIdentifier("id_unq_1"), algorithm: .sql(raw: "")))"))
.deleteConstraint(.sql(embed: "\(SQLDropTypedConstraint(name: SQLIdentifier("id_unq_1"), algorithm: .sql(unsafeRaw: "")))"))
.update().wait()
}
}
Expand All @@ -127,7 +127,7 @@ extension FluentBenchmarker {
.field("neverbeid", .string, .sql(embed: "NOT NULL"))

// Test raw SQL for entire field definitions:
.field(.sql(raw: "idnah INTEGER NOT NULL"))
.field(.sql(unsafeRaw: "idnah INTEGER NOT NULL"))
.field(.sql(embed: "\(ident: "notid") INTEGER"))

.create().wait()
Expand Down

0 comments on commit 308ddcc

Please sign in to comment.