Enhance documentation

This commit is contained in:
Gwendal Roué committed 2022-11-27 13:01:42 +01:00
1 parent f774aa7c07
commit f8728bbed8
1 file changed
+7 -1
@@ -117,14 +117,20 @@ extension Database {
/// The `column()` method returns a ``ColumnDefinition`` that you can
/// further configure:
///
/// ### NOT NULL constraints, DEFAULT values
/// ### Not null constraints, default values
///
/// ```swift
/// // email TEXT NOT NULL,
/// t.column("email", .text).notNull()
///
/// // name TEXT DEFAULT 'O''Reilly',
/// t.column("name", .text).defaults(to: "O'Reilly")
///
/// // flag BOOLEAN NOT NULL DEFAULT 0,
/// t.column("flag", .boolean).notNull().defaults(to: false)
///
/// // creationDate DATETIME DEFAULT CURRENT_TIMESTAMP,
/// t.column("creationDate", .datetime).defaults(sql: "CURRENT_TIMESTAMP")
/// ```
///
/// ### Primary, unique, and foreign keys