mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-22 04:00:39 +00:00
Merge pull request #1605 from groue/dev/GRDB7-DatabaseCursor-primary-associated-type
GRDB 7: DatabaseCursor has a primary associated type
This commit is contained in:
3 files changed
+11
-2
No files matched your search
@@ -719,7 +719,7 @@ extension Statement {
|
||||
/// [`sqlite3_reset`](https://www.sqlite.org/c3ref/reset.html) when the cursor
|
||||
/// is created, and when it is deallocated. Don't share the same prepared
|
||||
/// statement between two cursors!
|
||||
public protocol DatabaseCursor: Cursor {
|
||||
public protocol DatabaseCursor<Element>: Cursor {
|
||||
/// Must be initialized to false.
|
||||
var _isDone: Bool { get set }
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
- [ ] GRDB7: Sendable: SQL (ac33856f)
|
||||
- [ ] GRDB7: Split Row.swift (2ce8a619)
|
||||
- [ ] GRDB7: Cleanup ValueReducer (6c73b1c5)
|
||||
- [ ] GRDB7: DatabaseCursor has a primary associated type (b11c5dd2)
|
||||
- [X] GRDB7: DatabaseCursor has a primary associated type (b11c5dd2)
|
||||
- [ ] GRDB7: Enable Strict Concurrency Checks (6aa43ded)
|
||||
- [ ] GRDB7: Sendable: OrderedDictionary (e022c35b)
|
||||
- [ ] GRDB7: Rename ReadWriteBox to ReadWriteLock (7f5205ef)
|
||||
|
||||
@@ -213,6 +213,15 @@ class DatabaseCursorTests: GRDBTestCase {
|
||||
// }
|
||||
}
|
||||
|
||||
// This test passes if it compiles
|
||||
func testAssociatedType() throws {
|
||||
func accept(_ cursor: some DatabaseCursor<String>) { }
|
||||
func useCursor(_ db: Database) throws {
|
||||
let cursor = try String.fetchCursor(db, sql: "SELECT 'foo'")
|
||||
accept(cursor)
|
||||
}
|
||||
}
|
||||
|
||||
// For profiling tests
|
||||
let profilingSQL = """
|
||||
WITH RECURSIVE
|
||||
|
||||
Reference in new issue
Block a user