mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Enhance documentation of generated columns
This commit is contained in:
1 parent
33103bb373
commit
96c9eb5699
1 file changed
+20
-8
@@ -370,8 +370,8 @@ public final class ColumnDefinition {
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// When you want to ignore generated columns in record types, instruct
|
||||
/// GRDB not to select them:
|
||||
/// To remove the generated columns from the selection of record types,
|
||||
/// define their `databaseSelection`:
|
||||
///
|
||||
/// ```swift
|
||||
/// struct Player: Codable {
|
||||
@@ -383,6 +383,9 @@ public final class ColumnDefinition {
|
||||
///
|
||||
/// extension Player: FetchableRecord, PersistableRecord {
|
||||
/// static var databaseSelection: [any SQLSelectable] {
|
||||
/// // Option 1
|
||||
/// [Column("id"), Column("score"), Column("bonus")]
|
||||
/// // Option 2
|
||||
/// [.allColumns(excluding: ["totalScore"])]
|
||||
/// }
|
||||
/// }
|
||||
@@ -432,8 +435,8 @@ public final class ColumnDefinition {
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// When you want to ignore generated columns in record types, instruct
|
||||
/// GRDB not to select them:
|
||||
/// To remove the generated columns from the selection of record types,
|
||||
/// define their `databaseSelection`:
|
||||
///
|
||||
/// ```swift
|
||||
/// struct Player: Codable {
|
||||
@@ -445,6 +448,9 @@ public final class ColumnDefinition {
|
||||
///
|
||||
/// extension Player: FetchableRecord, PersistableRecord {
|
||||
/// static var databaseSelection: [any SQLSelectable] {
|
||||
/// // Option 1
|
||||
/// [Column("id"), Column("score"), Column("bonus")]
|
||||
/// // Option 2
|
||||
/// [.allColumns(excluding: ["totalScore"])]
|
||||
/// }
|
||||
/// }
|
||||
@@ -493,8 +499,8 @@ public final class ColumnDefinition {
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// When you want to ignore generated columns in record types, instruct
|
||||
/// GRDB not to select them:
|
||||
/// To remove the generated columns from the selection of record types,
|
||||
/// define their `databaseSelection`:
|
||||
///
|
||||
/// ```swift
|
||||
/// struct Player: Codable {
|
||||
@@ -506,6 +512,9 @@ public final class ColumnDefinition {
|
||||
///
|
||||
/// extension Player: FetchableRecord, PersistableRecord {
|
||||
/// static var databaseSelection: [any SQLSelectable] {
|
||||
/// // Option 1
|
||||
/// [Column("id"), Column("score"), Column("bonus")]
|
||||
/// // Option 2
|
||||
/// [.allColumns(excluding: ["totalScore"])]
|
||||
/// }
|
||||
/// }
|
||||
@@ -556,8 +565,8 @@ public final class ColumnDefinition {
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// When you want to ignore generated columns in record types, instruct
|
||||
/// GRDB not to select them:
|
||||
/// To remove the generated columns from the selection of record types,
|
||||
/// define their `databaseSelection`:
|
||||
///
|
||||
/// ```swift
|
||||
/// struct Player: Codable {
|
||||
@@ -569,6 +578,9 @@ public final class ColumnDefinition {
|
||||
///
|
||||
/// extension Player: FetchableRecord, PersistableRecord {
|
||||
/// static var databaseSelection: [any SQLSelectable] {
|
||||
/// // Option 1
|
||||
/// [Column("id"), Column("score"), Column("bonus")]
|
||||
/// // Option 2
|
||||
/// [.allColumns(excluding: ["totalScore"])]
|
||||
/// }
|
||||
/// }
|
||||
|
||||
Reference in new issue
Block a user