Skip to content

Commit ac15213

Browse files
author
Roman A. Grigorovich
committed
test: remove no needed test for PG17 feature WhenNotMatchedBySource
1 parent f8f30c5 commit ac15213

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

dialect/psql/merge_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -614,42 +614,4 @@ func TestMergeWithVersion(t *testing.T) {
614614
t.Errorf("expected no args, got %v", args)
615615
}
616616
})
617-
618-
t.Run("version 17+ with WhenNotMatchedBySource (PG17 feature)", func(t *testing.T) {
619-
ctx := context.Background()
620-
ctx = psql.SetVersion(ctx, 17)
621-
622-
q := psql.Merge(
623-
mm.Into("target"),
624-
mm.Using("source").As("s").On(
625-
psql.Quote("s", "id").EQ(psql.Quote("target", "id")),
626-
),
627-
mm.WhenMatched(
628-
mm.ThenUpdate(
629-
mm.SetCol("name").ToExpr(psql.Quote("s", "name")),
630-
),
631-
),
632-
mm.WhenNotMatchedBySource(
633-
mm.ThenDelete(),
634-
),
635-
mm.Returning(psql.Quote("target", "id")),
636-
)
637-
638-
sql, args, err := bob.Build(ctx, q)
639-
if err != nil {
640-
t.Fatalf("error: %v", err)
641-
}
642-
643-
expectedSQL := `MERGE INTO target USING source AS "s" ON "s"."id" = "target"."id" WHEN MATCHED THEN UPDATE SET "name" = "s"."name" WHEN NOT MATCHED BY SOURCE THEN DELETE RETURNING "target"."id"`
644-
diff, err := testutils.QueryDiff(expectedSQL, sql, formatter)
645-
if err != nil {
646-
t.Fatalf("error: %v", err)
647-
}
648-
if diff != "" {
649-
t.Errorf("SQL mismatch:\n%s\nGot: %s", diff, sql)
650-
}
651-
if len(args) != 0 {
652-
t.Errorf("expected no args, got %v", args)
653-
}
654-
})
655617
}

0 commit comments

Comments
 (0)