Skip to content

Commit

Permalink
Fix up FluentKit tests after SQLKit update
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynne committed Apr 15, 2024
1 parent 5f0938a commit a6c86ea
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
28 changes: 14 additions & 14 deletions Tests/FluentKitTests/AsyncTests/AsyncFluentKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ final class AsyncFluentKitTests: XCTestCase {

_ = try await Planet.query(on: db).unique().count(\.$name)
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT COUNT(DISTINCT("planets"."name")) AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT COUNT(DISTINCT "planets"."name") AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
db.reset()

_ = try await Planet.query(on: db).unique().sum(\.$id)
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT SUM(DISTINCT("planets"."id")) AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT SUM(DISTINCT "planets"."id") AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
db.reset()
}

Expand All @@ -141,7 +141,7 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT NOT NULL)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT NOT NULL)"#)
}

func testIdentifierFieldConstraint() async throws {
Expand All @@ -151,15 +151,15 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT PRIMARY KEY)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT PRIMARY KEY)"#)
db.reset()

try await db.schema("planets")
.field("id", .int64, .identifier(auto: true))
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
}

func testForeignKeyFieldConstraint() async throws {
Expand All @@ -169,15 +169,15 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
db.reset()

try await db.schema("planets")
.field("galaxy_id", .int64, .references("galaxies", "id", onDelete: .restrict, onUpdate: .cascade))
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
}

func testMultipleFieldConstraint() async throws {
Expand All @@ -187,7 +187,7 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
}

func testUniqueTableConstraint() async throws {
Expand All @@ -198,7 +198,7 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT, CONSTRAINT "uq:planets.id" UNIQUE ("id"))"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT, CONSTRAINT "uq:planets.id" UNIQUE ("id"))"#)
db.reset()

try await db.schema("planets")
Expand All @@ -208,7 +208,7 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT, "name" TEXT, CONSTRAINT "uq:planets.id+planets.name" UNIQUE ("id", "name"))"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT, "name" TEXT, CONSTRAINT "uq:planets.id+planets.name" UNIQUE ("id", "name"))"#)
}

func testForeignKeyTableConstraint() async throws {
Expand All @@ -219,7 +219,7 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
db.reset()

try await db.schema("planets")
Expand All @@ -233,7 +233,7 @@ final class AsyncFluentKitTests: XCTestCase {
.create()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
}

func testIfNotExistsTableCreate() async throws {
Expand All @@ -245,7 +245,7 @@ final class AsyncFluentKitTests: XCTestCase {


XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE IF NOT EXISTS "planets"("galaxy_id" BIGINT)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE IF NOT EXISTS "planets" ("galaxy_id" BIGINT)"#)
db.reset()

try await db.schema("planets")
Expand All @@ -254,7 +254,7 @@ final class AsyncFluentKitTests: XCTestCase {


XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT)"#)
}

func testCreateEmptyModelArrayDoesntQuery() async throws {
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluentKitTests/CompositeIDTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ final class CompositeIDTests: XCTestCase {
let db = DummyDatabaseForTestSQLSerializer()
try CompositePlanetTagMigration().prepare(on: db).wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "composite+planet+tag"("planet_id" UUID NOT NULL REFERENCES "planets" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, "tag_id" UUID NOT NULL REFERENCES "tags" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, "notation" TEXT NOT NULL, "createdAt" TIMESTAMPTZ, "updatedAt" TIMESTAMPTZ, "deletedAt" TIMESTAMPTZ, PRIMARY KEY ("planet_id", "tag_id"))"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "composite+planet+tag" ("planet_id" UUID NOT NULL REFERENCES "planets" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, "tag_id" UUID NOT NULL REFERENCES "tags" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, "notation" TEXT NOT NULL, "createdAt" TIMESTAMPTZ, "updatedAt" TIMESTAMPTZ, "deletedAt" TIMESTAMPTZ, PRIMARY KEY ("planet_id", "tag_id"))"#)
}

func testCompositeIDRelations() throws {
Expand Down
32 changes: 16 additions & 16 deletions Tests/FluentKitTests/FluentKitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ final class FluentKitTests: XCTestCase {

_ = try? Planet.query(on: db).unique().count(\.$name).wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT COUNT(DISTINCT("planets"."name")) AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT COUNT(DISTINCT "planets"."name") AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
db.reset()

_ = try? Planet.query(on: db).unique().sum(\.$id).wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT SUM(DISTINCT("planets"."id")) AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"SELECT SUM(DISTINCT "planets"."id") AS "aggregate" FROM "planets" WHERE ("planets"."deleted_at" IS NULL OR "planets"."deleted_at" > $1)"#)
db.reset()
}

Expand All @@ -198,7 +198,7 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT NOT NULL)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT NOT NULL)"#)
}

func testIdentifierFieldConstraint() throws {
Expand All @@ -208,15 +208,15 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT PRIMARY KEY)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT PRIMARY KEY)"#)
db.reset()

try db.schema("planets")
.field("id", .int64, .identifier(auto: true))
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
}

func testForeignKeyFieldConstraint() throws {
Expand All @@ -226,15 +226,15 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
db.reset()

try db.schema("planets")
.field("galaxy_id", .int64, .references("galaxies", "id", onDelete: .restrict, onUpdate: .cascade))
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
}

func testMultipleFieldConstraint() throws {
Expand All @@ -244,7 +244,7 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)"#)
}

func testUniqueTableConstraint() throws {
Expand All @@ -255,7 +255,7 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT, CONSTRAINT "uq:planets.id" UNIQUE ("id"))"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT, CONSTRAINT "uq:planets.id" UNIQUE ("id"))"#)
db.reset()

try db.schema("planets")
Expand All @@ -265,7 +265,7 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("id" BIGINT, "name" TEXT, CONSTRAINT "uq:planets.id+planets.name" UNIQUE ("id", "name"))"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("id" BIGINT, "name" TEXT, CONSTRAINT "uq:planets.id+planets.name" UNIQUE ("id", "name"))"#)
}

func testForeignKeyTableConstraint() throws {
Expand All @@ -276,7 +276,7 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)"#)
db.reset()

try db.schema("planets")
Expand All @@ -290,7 +290,7 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT, CONSTRAINT "fk:planets.galaxy_id+planets.id" FOREIGN KEY ("galaxy_id") REFERENCES "galaxies" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)"#)
db.reset()

try db.schema("planets")
Expand All @@ -304,7 +304,7 @@ final class FluentKitTests: XCTestCase {
.create()
.wait()
XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT, "galaxy_name" TEXT, CONSTRAINT "fk:planets.galaxy_id+planets.galaxy_name+planets.id+planets.name" FOREIGN KEY ("galaxy_id", "galaxy_name") REFERENCES "galaxies" ("id", "name") ON DELETE NO ACTION ON UPDATE CASCADE)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT, "galaxy_name" TEXT, CONSTRAINT "fk:planets.galaxy_id+planets.galaxy_name+planets.id+planets.name" FOREIGN KEY ("galaxy_id", "galaxy_name") REFERENCES "galaxies" ("id", "name") ON DELETE NO ACTION ON UPDATE CASCADE)"#)
}

func testIfNotExistsTableCreate() throws {
Expand All @@ -316,7 +316,7 @@ final class FluentKitTests: XCTestCase {
.wait()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE IF NOT EXISTS "planets"("galaxy_id" BIGINT)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE IF NOT EXISTS "planets" ("galaxy_id" BIGINT)"#)
db.reset()

try db.schema("planets")
Expand All @@ -325,7 +325,7 @@ final class FluentKitTests: XCTestCase {
.wait()

XCTAssertEqual(db.sqlSerializers.count, 1)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets"("galaxy_id" BIGINT)"#)
XCTAssertEqual(db.sqlSerializers.first?.sql, #"CREATE TABLE "planets" ("galaxy_id" BIGINT)"#)
}

func testDecodeWithoutID() throws {
Expand Down Expand Up @@ -734,7 +734,7 @@ final class FluentKitTests: XCTestCase {
_ = try Star.query(on: db).join(AltPlanet.self, on: \AltPlanet.$star.$id == \Star.$id).fields(for: Star.self).withDeleted().first().wait()

XCTAssertEqual(db.sqlSerializers.count, 6)
XCTAssertEqual(db.sqlSerializers.dropFirst(0).first?.sql, #"CREATE TABLE "mirror_universe"."planets"("id" UUID PRIMARY KEY, "name" TEXT NOT NULL, "star_id" UUID REFERENCES "stars" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION NOT NULL, "possible_star_id" UUID REFERENCES "stars" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, "createdAt" TIMESTAMPTZ, "updatedAt" TIMESTAMPTZ, "deletedAt" TIMESTAMPTZ DEFAULT NULL)"#)
XCTAssertEqual(db.sqlSerializers.dropFirst(0).first?.sql, #"CREATE TABLE "mirror_universe"."planets" ("id" UUID PRIMARY KEY, "name" TEXT NOT NULL, "star_id" UUID REFERENCES "stars" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION NOT NULL, "possible_star_id" UUID REFERENCES "stars" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION, "createdAt" TIMESTAMPTZ, "updatedAt" TIMESTAMPTZ, "deletedAt" TIMESTAMPTZ DEFAULT NULL)"#)
XCTAssertEqual(db.sqlSerializers.dropFirst(1).first?.sql, #"SELECT "mirror_universe"."planets"."id" AS "mirror_universe_planets_id", "mirror_universe"."planets"."name" AS "mirror_universe_planets_name", "mirror_universe"."planets"."star_id" AS "mirror_universe_planets_star_id", "mirror_universe"."planets"."possible_star_id" AS "mirror_universe_planets_possible_star_id", "mirror_universe"."planets"."createdAt" AS "mirror_universe_planets_createdAt", "mirror_universe"."planets"."updatedAt" AS "mirror_universe_planets_updatedAt", "mirror_universe"."planets"."deletedAt" AS "mirror_universe_planets_deletedAt" FROM "mirror_universe"."planets" WHERE "mirror_universe"."planets"."name" = $1 AND ("mirror_universe"."planets"."deletedAt" IS NULL OR "mirror_universe"."planets"."deletedAt" > $2)"#)
XCTAssertEqual(db.sqlSerializers.dropFirst(2).first?.sql, #"INSERT INTO "mirror_universe"."planets" ("id", "name", "star_id", "possible_star_id", "createdAt", "updatedAt", "deletedAt") VALUES ($1, $2, DEFAULT, DEFAULT, $3, $4, DEFAULT)"#)
XCTAssertEqual(db.sqlSerializers.dropFirst(3).first?.sql, #"UPDATE "mirror_universe"."planets" SET "id" = $1, "name" = $2, "updatedAt" = $3 WHERE "mirror_universe"."planets"."id" = $4 AND ("mirror_universe"."planets"."deletedAt" IS NULL OR "mirror_universe"."planets"."deletedAt" > $5)"#)
Expand Down

0 comments on commit a6c86ea

Please sign in to comment.