Files
GRDB.swift/docs/6.3/data/documentation/grdb/databasecolumndecodingstrategy.json
T
2022-11-09 08:57:09 +01:00

1 line
12 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"seeAlsoSections":[{"title":"Configuring Row Decoding for the Standard Decodable Protocol","identifiers":["doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseColumnDecodingStrategy-6uefz","doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseDateDecodingStrategy-78y03","doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseDecodingUserInfo-77jim","doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseJSONDecoder(for:)-7lmxd","doc:\/\/GRDB\/documentation\/GRDB\/DatabaseDateDecodingStrategy"],"generated":true}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"DatabaseColumnDecodingStrategy"}],"languages":["swift"],"platforms":["macOS"]}]},{"kind":"content","content":[{"anchor":"overview","level":2,"type":"heading","text":"Overview"},{"type":"paragraph","inlineContent":[{"type":"text","text":"For example:"}]},{"type":"codeListing","syntax":null,"code":["struct Player: FetchableRecord, Decodable {"," static let databaseColumnDecodingStrategy = DatabaseColumnDecodingStrategy.convertFromSnakeCase",""," \/\/ Decoded from the player_id column"," var playerID: Int","}"]}]}],"variants":[{"paths":["\/documentation\/grdb\/databasecolumndecodingstrategy"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy","interfaceLanguage":"swift"},"abstract":[{"type":"codeVoice","code":"DatabaseColumnDecodingStrategy"},{"type":"text","text":" specifies how "},{"type":"codeVoice","code":"FetchableRecord"},{"type":"text","text":" types that"},{"type":"text","text":" "},{"type":"text","text":"also adopt the standard "},{"type":"codeVoice","code":"Decodable"},{"type":"text","text":" protocol look for the database columns"},{"type":"text","text":" "},{"type":"text","text":"that match their coding keys."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"DatabaseColumnDecodingStrategy"}],"title":"DatabaseColumnDecodingStrategy","roleHeading":"Enumeration","role":"symbol","symbolKind":"enum","externalID":"s:4GRDB30DatabaseColumnDecodingStrategyO","modules":[{"name":"GRDB"}],"navigatorTitle":[{"kind":"identifier","text":"DatabaseColumnDecodingStrategy"}]},"hierarchy":{"paths":[["doc:\/\/GRDB\/documentation\/GRDB","doc:\/\/GRDB\/documentation\/GRDB\/QueryInterface","doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord"]]},"topicSections":[{"title":"Enumeration Cases","identifiers":["doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy\/convertFromSnakeCase","doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy\/custom(_:)","doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy\/useDefaultKeys"]}],"references":{"doc://GRDB/documentation/GRDB/FetchableRecord/databaseJSONDecoder(for:)-7lmxd":{"defaultImplementations":1,"role":"symbol","title":"databaseJSONDecoder(for:)","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"databaseJSONDecoder"},{"kind":"text","text":"("},{"kind":"externalParam","text":"for"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"JSONDecoder","preciseIdentifier":"s:10Foundation11JSONDecoderC"}],"abstract":[{"type":"text","text":"Returns the "},{"type":"codeVoice","code":"JSONDecoder"},{"type":"text","text":" that decodes the value for a given column."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseJSONDecoder(for:)-7lmxd","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/grdb\/fetchablerecord\/databasejsondecoder(for:)-7lmxd"},"doc://GRDB/documentation/GRDB/DatabaseColumnDecodingStrategy/useDefaultKeys":{"role":"symbol","title":"DatabaseColumnDecodingStrategy.useDefaultKeys","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"useDefaultKeys"}],"abstract":[{"type":"text","text":"A key decoding strategy that doesn’t change key names during decoding."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy\/useDefaultKeys","kind":"symbol","type":"topic","url":"\/documentation\/grdb\/databasecolumndecodingstrategy\/usedefaultkeys"},"doc://GRDB/documentation/GRDB/FetchableRecord/databaseDecodingUserInfo-77jim":{"defaultImplementations":1,"role":"symbol","title":"databaseDecodingUserInfo","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"databaseDecodingUserInfo"},{"kind":"text","text":": ["},{"kind":"typeIdentifier","text":"CodingUserInfoKey","preciseIdentifier":"s:s17CodingUserInfoKeyV"},{"kind":"text","text":" : "},{"kind":"keyword","text":"Any"},{"kind":"text","text":"]"}],"abstract":[{"type":"text","text":"Contextual information made available to the"},{"type":"text","text":" "},{"type":"codeVoice","code":"Decodable.init(from:)"},{"type":"text","text":" initializer."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseDecodingUserInfo-77jim","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/grdb\/fetchablerecord\/databasedecodinguserinfo-77jim"},"doc://GRDB/documentation/GRDB/FetchableRecord/databaseColumnDecodingStrategy-6uefz":{"defaultImplementations":1,"role":"symbol","title":"databaseColumnDecodingStrategy","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"databaseColumnDecodingStrategy"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"DatabaseColumnDecodingStrategy","preciseIdentifier":"s:4GRDB30DatabaseColumnDecodingStrategyO"}],"abstract":[{"type":"text","text":"The strategy for converting column names to coding keys."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseColumnDecodingStrategy-6uefz","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/grdb\/fetchablerecord\/databasecolumndecodingstrategy-6uefz"},"doc://GRDB/documentation/GRDB/DatabaseColumnDecodingStrategy/convertFromSnakeCase":{"role":"symbol","title":"DatabaseColumnDecodingStrategy.convertFromSnakeCase","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"convertFromSnakeCase"}],"abstract":[{"type":"text","text":"A key decoding strategy that converts snake-case keys to camel-case keys."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy\/convertFromSnakeCase","kind":"symbol","type":"topic","url":"\/documentation\/grdb\/databasecolumndecodingstrategy\/convertfromsnakecase"},"doc://GRDB/documentation/GRDB/FetchableRecord":{"role":"symbol","title":"FetchableRecord","fragments":[{"kind":"keyword","text":"protocol"},{"kind":"text","text":" "},{"kind":"identifier","text":"FetchableRecord"}],"abstract":[{"type":"text","text":"A type that can decode itself from a database row."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"FetchableRecord"}],"url":"\/documentation\/grdb\/fetchablerecord"},"doc://GRDB/documentation/GRDB/FetchableRecord/databaseDateDecodingStrategy-78y03":{"defaultImplementations":1,"role":"symbol","title":"databaseDateDecodingStrategy","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"databaseDateDecodingStrategy"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"DatabaseDateDecodingStrategy","preciseIdentifier":"s:4GRDB28DatabaseDateDecodingStrategyO"}],"abstract":[{"type":"text","text":"The strategy for decoding "},{"type":"codeVoice","code":"Date"},{"type":"text","text":" columns."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/FetchableRecord\/databaseDateDecodingStrategy-78y03","kind":"symbol","required":true,"type":"topic","url":"\/documentation\/grdb\/fetchablerecord\/databasedatedecodingstrategy-78y03"},"doc://GRDB/documentation/GRDB/QueryInterface":{"role":"collectionGroup","title":"Record Types and the Query Interface","abstract":[{"type":"text","text":"Record types and the query interface build SQL queries for you"}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/QueryInterface","kind":"article","type":"topic","url":"\/documentation\/grdb\/queryinterface"},"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/DatabaseDateDecodingStrategy":{"role":"symbol","title":"DatabaseDateDecodingStrategy","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"DatabaseDateDecodingStrategy"}],"abstract":[{"type":"codeVoice","code":"DatabaseDateDecodingStrategy"},{"type":"text","text":" specifies how "},{"type":"codeVoice","code":"FetchableRecord"},{"type":"text","text":" types that"},{"type":"text","text":" "},{"type":"text","text":"also adopt the standard "},{"type":"codeVoice","code":"Decodable"},{"type":"text","text":" protocol decode their"},{"type":"text","text":" "},{"type":"codeVoice","code":"Date"},{"type":"text","text":" properties."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/DatabaseDateDecodingStrategy","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"DatabaseDateDecodingStrategy"}],"url":"\/documentation\/grdb\/databasedatedecodingstrategy"},"doc://GRDB/documentation/GRDB/DatabaseColumnDecodingStrategy":{"role":"symbol","title":"DatabaseColumnDecodingStrategy","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"DatabaseColumnDecodingStrategy"}],"abstract":[{"type":"codeVoice","code":"DatabaseColumnDecodingStrategy"},{"type":"text","text":" specifies how "},{"type":"codeVoice","code":"FetchableRecord"},{"type":"text","text":" types that"},{"type":"text","text":" "},{"type":"text","text":"also adopt the standard "},{"type":"codeVoice","code":"Decodable"},{"type":"text","text":" protocol look for the database columns"},{"type":"text","text":" "},{"type":"text","text":"that match their coding keys."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"DatabaseColumnDecodingStrategy"}],"url":"\/documentation\/grdb\/databasecolumndecodingstrategy"},"doc://GRDB/documentation/GRDB/DatabaseColumnDecodingStrategy/custom(_:)":{"role":"symbol","title":"DatabaseColumnDecodingStrategy.custom(_:)","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"custom"},{"kind":"text","text":"(("},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"CodingKey","preciseIdentifier":"s:s9CodingKeyP"},{"kind":"text","text":")"}],"abstract":[{"type":"text","text":"A key decoding strategy defined by the closure you supply."}],"identifier":"doc:\/\/GRDB\/documentation\/GRDB\/DatabaseColumnDecodingStrategy\/custom(_:)","kind":"symbol","type":"topic","url":"\/documentation\/grdb\/databasecolumndecodingstrategy\/custom(_:)"}}}