Initializergrdb 7.2.0GRDB
init(_:)
Creates an adapter that preserves row contents and add scoped rows.
init(_ scopes: [String : any RowAdapter])
Parameters
- scopes
A dictionary that maps scope names to row adapters.
For example:
let adapter = ScopeAdapter(["suffix": SuffixRowAdapter(fromIndex: 1)])
let row = try Row.fetchOne(db, sql: "SELECT 1, 2, 3", adapter: adapter)!
row // [1, 2, 3]
row.scopes["suffix"] // [2, 3]