@@ -1400,6 +1400,7 @@ public final class TableAlteration {
1400
1400
///
1401
1401
/// - ``generatedAs(_:_:)``
1402
1402
/// - ``generatedAs(sql:_:)``
1403
+ /// - ``GeneratedColumnQualification``
1403
1404
///
1404
1405
/// ### Other Constraints
1405
1406
///
@@ -1428,12 +1429,13 @@ public final class ColumnDefinition {
1428
1429
var deferred : Bool
1429
1430
}
1430
1431
1431
- /// The `GeneratedColumnQualification` enum defines whether a generated
1432
- /// column sis virtual or stored.
1432
+ /// The kind of a generated column.
1433
1433
///
1434
1434
/// Related SQLite documentation: <https://sqlite.org/gencol.html#virtual_versus_stored_columns>
1435
1435
public enum GeneratedColumnQualification {
1436
+ /// A `VIRTUAL` generated column.
1436
1437
case virtual
1438
+ /// A `STORED` generated column.
1437
1439
case stored
1438
1440
}
1439
1441
@@ -1714,13 +1716,13 @@ public final class ColumnDefinition {
1714
1716
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
1715
1717
/// // score INTEGER NOT NULL,
1716
1718
/// // bonus INTEGER NOT NULL,
1717
- /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1719
+ /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
1718
1720
/// // )
1719
1721
/// try db.create(table: "player") { t in
1720
1722
/// t.autoIncrementedPrimaryKey("id")
1721
1723
/// t.column("score", .integer).notNull()
1722
1724
/// t.column("bonus", .integer).notNull()
1723
- /// t.column("totalScore", .integer).generatedAs(sql: "score + bonus", .stored )
1725
+ /// t.column("totalScore", .integer).generatedAs(sql: "score + bonus")
1724
1726
/// }
1725
1727
/// ```
1726
1728
///
@@ -1753,13 +1755,13 @@ public final class ColumnDefinition {
1753
1755
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
1754
1756
/// // score INTEGER NOT NULL,
1755
1757
/// // bonus INTEGER NOT NULL,
1756
- /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1758
+ /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
1757
1759
/// // )
1758
1760
/// try db.create(table: "player") { t in
1759
1761
/// t.autoIncrementedPrimaryKey("id")
1760
1762
/// t.column("score", .integer).notNull()
1761
1763
/// 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"))
1763
1765
/// }
1764
1766
/// ```
1765
1767
///
@@ -1791,13 +1793,13 @@ public final class ColumnDefinition {
1791
1793
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
1792
1794
/// // score INTEGER NOT NULL,
1793
1795
/// // bonus INTEGER NOT NULL,
1794
- /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1796
+ /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
1795
1797
/// // )
1796
1798
/// try db.create(table: "player") { t in
1797
1799
/// t.autoIncrementedPrimaryKey("id")
1798
1800
/// t.column("score", .integer).notNull()
1799
1801
/// t.column("bonus", .integer).notNull()
1800
- /// t.column("totalScore", .integer).generatedAs(sql: "score + bonus", .stored )
1802
+ /// t.column("totalScore", .integer).generatedAs(sql: "score + bonus")
1801
1803
/// }
1802
1804
/// ```
1803
1805
///
@@ -1831,13 +1833,13 @@ public final class ColumnDefinition {
1831
1833
/// // id INTEGER PRIMARY KEY AUTOINCREMENT,
1832
1834
/// // score INTEGER NOT NULL,
1833
1835
/// // bonus INTEGER NOT NULL,
1834
- /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) STORED
1836
+ /// // totalScore INTEGER GENERATED ALWAYS AS (score + bonus) VIRTUAL
1835
1837
/// // )
1836
1838
/// try db.create(table: "player") { t in
1837
1839
/// t.autoIncrementedPrimaryKey("id")
1838
1840
/// t.column("score", .integer).notNull()
1839
1841
/// 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"))
1841
1843
/// }
1842
1844
/// ```
1843
1845
///
0 commit comments