From 9c864bc7687f44ce76ca41beb0e06efdbc3fb459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 4 Aug 2019 14:37:10 +0200 Subject: [PATCH] Failling test for rowid optimization in Database.recordingSelectedRegion --- .../GRDBTests/ValueObservationRegionRecordingTests.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift index 67b498048..944cf2821 100644 --- a/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift +++ b/Tests/GRDBTests/ValueObservationRegionRecordingTests.swift @@ -33,6 +33,15 @@ class ValueObservationRegionRecordingTests: GRDBTestCase { XCTAssertEqual(region.description, "player(name)") } + do { + // Test for rowID optimization + struct Player: TableRecord, FetchableRecord, Decodable { } + let (_, region) = try db.recordingSelectedRegion { + _ = try Player.fetchOne(db, key: 123) + } + XCTAssertEqual(region.description, "player(id,name)[123]") + } + do { let (_, region) = try db.recordingSelectedRegion { _ = try Row.fetchAll(db, sql: "SELECT * FROM team")