Skip to content

Commit 119f226

Browse files
committed
DocC: GeneratedColumnQualification
1 parent d2db26d commit 119f226

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

GRDB/QueryInterface/Schema/TableDefinition.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,7 @@ public final class TableAlteration {
14001400
///
14011401
/// - ``generatedAs(_:_:)``
14021402
/// - ``generatedAs(sql:_:)``
1403+
/// - ``GeneratedColumnQualification``
14031404
///
14041405
/// ### Other Constraints
14051406
///
@@ -1428,12 +1429,13 @@ public final class ColumnDefinition {
14281429
var deferred: Bool
14291430
}
14301431

1431-
/// The `GeneratedColumnQualification` enum defines whether a generated
1432-
/// column sis virtual or stored.
1432+
/// The kind of a generated column.
14331433
///
14341434
/// Related SQLite documentation: <https://sqlite.org/gencol.html#virtual_versus_stored_columns>
14351435
public enum GeneratedColumnQualification {
1436+
/// A `VIRTUAL` generated column.
14361437
case virtual
1438+
/// A `STORED` generated column.
14371439
case stored
14381440
}
14391441

@@ -1714,13 +1716,13 @@ public final class ColumnDefinition {
17141716
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
17151717
/// // score INTEGER NOT NULL,
17161718
/// // bonus INTEGER NOT NULL,
1717-
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1719+
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
17181720
/// // )
17191721
/// try db.create(table: "player") { t in
17201722
/// t.autoIncrementedPrimaryKey("id")
17211723
/// t.column("score", .integer).notNull()
17221724
/// t.column("bonus", .integer).notNull()
1723-
/// t.column("totalScore", .integer).generatedAs(sql: "score + bonus", .stored)
1725+
/// t.column("totalScore", .integer).generatedAs(sql: "score + bonus")
17241726
/// }
17251727
/// ```
17261728
///
@@ -1753,13 +1755,13 @@ public final class ColumnDefinition {
17531755
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
17541756
/// // score INTEGER NOT NULL,
17551757
/// // bonus INTEGER NOT NULL,
1756-
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1758+
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
17571759
/// // )
17581760
/// try db.create(table: "player") { t in
17591761
/// t.autoIncrementedPrimaryKey("id")
17601762
/// t.column("score", .integer).notNull()
17611763
/// t.column("bonus", .integer).notNull()
1762-
/// t.column("totalScore", .integer).generatedAs(Column("score") + Column("bonus"), .stored)
1764+
/// t.column("totalScore", .integer).generatedAs(Column("score") + Column("bonus"))
17631765
/// }
17641766
/// ```
17651767
///
@@ -1791,13 +1793,13 @@ public final class ColumnDefinition {
17911793
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
17921794
/// // score INTEGER NOT NULL,
17931795
/// // bonus INTEGER NOT NULL,
1794-
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1796+
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
17951797
/// // )
17961798
/// try db.create(table: "player") { t in
17971799
/// t.autoIncrementedPrimaryKey("id")
17981800
/// t.column("score", .integer).notNull()
17991801
/// t.column("bonus", .integer).notNull()
1800-
/// t.column("totalScore", .integer).generatedAs(sql: "score + bonus", .stored)
1802+
/// t.column("totalScore", .integer).generatedAs(sql: "score + bonus")
18011803
/// }
18021804
/// ```
18031805
///
@@ -1831,13 +1833,13 @@ public final class ColumnDefinition {
18311833
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
18321834
/// // score INTEGER NOT NULL,
18331835
/// // bonus INTEGER NOT NULL,
1834-
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1836+
/// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
18351837
/// // )
18361838
/// try db.create(table: "player") { t in
18371839
/// t.autoIncrementedPrimaryKey("id")
18381840
/// t.column("score", .integer).notNull()
18391841
/// t.column("bonus", .integer).notNull()
1840-
/// t.column("totalScore", .integer).generatedAs(Column("score") + Column("bonus"), .stored)
1842+
/// t.column("totalScore", .integer).generatedAs(Column("score") + Column("bonus"))
18411843
/// }
18421844
/// ```
18431845
///

0 commit comments

Comments
 (0)