Files
2022-11-09 08:57:09 +01:00

1 line
9.0 KiB
JSON

{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"RowAdapter"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"type":"text","text":"You provide row adapters to methods that fetch. For example:"}]},{"type":"codeListing","syntax":"swift","code":["try dbQueue.read {"," \/\/ An adapter that ignores the first two columns"," let adapter = SuffixRowAdapter(fromIndex: 2)"," let sql = \"SELECT 1 AS foo, 2 AS bar, 3 AS baz\"",""," \/\/ [baz:3]"," try Row.fetchOne(db, sql: sql, adapter: adapter)","}"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/grdb\/rowadapter"],"traits":[{"interfaceLanguage":"swift"}]}],"relationshipsSections":[{"identifiers":["doc:\/\/GRDB\/documentation\/GRDB\/ColumnMapping","doc:\/\/GRDB\/documentation\/GRDB\/EmptyRowAdapter","doc:\/\/GRDB\/documentation\/GRDB\/RangeRowAdapter","doc:\/\/GRDB\/documentation\/GRDB\/RenameColumnAdapter","doc:\/\/GRDB\/documentation\/GRDB\/ScopeAdapter","doc:\/\/GRDB\/documentation\/GRDB\/SuffixRowAdapter"],"kind":"relationships","title":"Conforming Types","type":"conformingTypes"}],"identifier":{"url":"doc:\/\/GRDB\/documentation\/GRDB\/RowAdapter","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"A type that helps two incompatible row interfaces working together."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"RowAdapter"}],"title":"RowAdapter","roleHeading":"Protocol","role":"symbol","symbolKind":"protocol","externalID":"s:4GRDB10RowAdapterP","modules":[{"name":"GRDB"}],"navigatorTitle":[{"kind":"identifier","text":"RowAdapter"}]},"hierarchy":{"paths":[["doc:\/\/GRDB\/documentation\/GRDB","doc:\/\/GRDB\/documentation\/GRDB\/SQLSupport","doc:\/\/GRDB\/documentation\/GRDB\/Row"]]},"topicSections":[{"title":"Splitting a Row","identifiers":["doc:\/\/GRDB\/documentation\/GRDB\/splittingRowAdapters(columnCounts:)"]},{"title":"Built-in Adapters","identifiers":["doc:\/\/GRDB\/documentation\/GRDB\/ColumnMapping","doc:\/\/GRDB\/documentation\/GRDB\/EmptyRowAdapter","doc:\/\/GRDB\/documentation\/GRDB\/RangeRowAdapter","doc:\/\/GRDB\/documentation\/GRDB\/RenameColumnAdapter","doc:\/\/GRDB\/documentation\/GRDB\/ScopeAdapter","doc:\/\/GRDB\/documentation\/GRDB\/SuffixRowAdapter"]},{"title":"Instance Methods","identifiers":["doc:\/\/GRDB\/documentation\/GRDB\/RowAdapter\/addingScopes(_:)"]}],"references":{"doc://GRDB/documentation/GRDB/SuffixRowAdapter":{"role":"symbol","title":"SuffixRowAdapter","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"SuffixRowAdapter"}],"abstract":[{"type":"text","text":"SuffixRowAdapter is a row adapter that hides the first columns in a row."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/SuffixRowAdapter","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SuffixRowAdapter"}],"url":"\/documentation\/grdb\/suffixrowadapter"},"doc://GRDB/documentation/GRDB/ScopeAdapter":{"role":"symbol","title":"ScopeAdapter","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"ScopeAdapter"}],"abstract":[{"type":"codeVoice","code":"ScopeAdapter"},{"type":"text","text":" is a row adapter that lets you define scopes on rows."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/ScopeAdapter","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"ScopeAdapter"}],"url":"\/documentation\/grdb\/scopeadapter"},"doc://GRDB/documentation/GRDB/SQLSupport":{"role":"collectionGroup","title":"SQL, Prepared Statements, Rows, and Values","abstract":[{"type":"text","text":"SQL is the fundamental language for accessing SQLite databases."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/SQLSupport","kind":"article","type":"topic","url":"\/documentation\/grdb\/sqlsupport"},"doc://GRDB/documentation/GRDB":{"role":"collection","title":"GRDB","abstract":[{"type":"text","text":"A toolkit for SQLite databases, with a focus on application development"}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB","kind":"symbol","type":"topic","url":"\/documentation\/grdb"},"doc://GRDB/documentation/GRDB/RowAdapter":{"role":"symbol","title":"RowAdapter","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"RowAdapter"}],"abstract":[{"type":"text","text":"A type that helps two incompatible row interfaces working together."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/RowAdapter","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"RowAdapter"}],"url":"\/documentation\/grdb\/rowadapter"},"doc://GRDB/documentation/GRDB/RangeRowAdapter":{"role":"symbol","title":"RangeRowAdapter","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"RangeRowAdapter"}],"abstract":[{"type":"text","text":"RangeRowAdapter is a row adapter that only exposes a range of columns."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/RangeRowAdapter","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"RangeRowAdapter"}],"url":"\/documentation\/grdb\/rangerowadapter"},"doc://GRDB/documentation/GRDB/EmptyRowAdapter":{"role":"symbol","title":"EmptyRowAdapter","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"EmptyRowAdapter"}],"abstract":[{"type":"text","text":"EmptyRowAdapter is a row adapter that hides all columns."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/EmptyRowAdapter","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"EmptyRowAdapter"}],"url":"\/documentation\/grdb\/emptyrowadapter"},"doc://GRDB/documentation/GRDB/splittingRowAdapters(columnCounts:)":{"role":"symbol","title":"splittingRowAdapters(columnCounts:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"splittingRowAdapters"},{"kind":"text","text":"("},{"kind":"externalParam","text":"columnCounts"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","text":"Int","preciseIdentifier":"s:Si"},{"kind":"text","text":"]) -> ["},{"kind":"typeIdentifier","text":"RowAdapter","preciseIdentifier":"s:4GRDB10RowAdapterP"},{"kind":"text","text":"]"}],"abstract":[{"type":"text","text":"Returns an array of row adapters that split a row according to the input"},{"type":"text","text":" "},{"type":"text","text":"number of columns."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/splittingRowAdapters(columnCounts:)","kind":"symbol","type":"topic","url":"\/documentation\/grdb\/splittingrowadapters(columncounts:)"},"doc://GRDB/documentation/GRDB/RenameColumnAdapter":{"role":"symbol","title":"RenameColumnAdapter","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"RenameColumnAdapter"}],"abstract":[{"type":"codeVoice","code":"RenameColumnAdapter"},{"type":"text","text":" is a row adapter that renames columns."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/RenameColumnAdapter","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"RenameColumnAdapter"}],"url":"\/documentation\/grdb\/renamecolumnadapter"},"doc://GRDB/documentation/GRDB/RowAdapter/addingScopes(_:)":{"role":"symbol","title":"addingScopes(_:)","fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"addingScopes"},{"kind":"text","text":"(["},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":" : "},{"kind":"typeIdentifier","text":"RowAdapter","preciseIdentifier":"s:4GRDB10RowAdapterP"},{"kind":"text","text":"]) -> "},{"kind":"typeIdentifier","text":"RowAdapter","preciseIdentifier":"s:4GRDB10RowAdapterP"}],"abstract":[{"type":"text","text":"Returns an adapter based on self, with added scopes."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/RowAdapter\/addingScopes(_:)","kind":"symbol","type":"topic","url":"\/documentation\/grdb\/rowadapter\/addingscopes(_:)"},"doc://GRDB/documentation/GRDB/Row":{"role":"symbol","title":"Row","fragments":[{"kind":"keyword","text":"class"},{"kind":"text","text":" "},{"kind":"identifier","text":"Row"}],"abstract":[{"type":"text","text":"A database row."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/Row","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"Row"}],"url":"\/documentation\/grdb\/row"},"doc://GRDB/documentation/GRDB/ColumnMapping":{"role":"symbol","title":"ColumnMapping","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"ColumnMapping"}],"abstract":[{"type":"text","text":"ColumnMapping is a row adapter that maps column names."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/ColumnMapping","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"ColumnMapping"}],"url":"\/documentation\/grdb\/columnmapping"}}}