     }
 }
 
+// TODO: doc
 public enum SQLOrdering : String {
     case Asc = "ASC"
     case Desc = "DESC"
 }
 
+// TODO: doc
 public enum SQLCollation : String {
     case Binary = "BINARY"
     case Nocase = "NOCASE"
     case Rtrim = "RTRIM"
 }
 
+// TODO: doc
 public enum SQLConflictResolution : String {
     case Rollback = "ROLLBACK"
     case Abort = "ABORT"

        self.type = type
    }
    
    public func primaryKey(ordering ordering: SQLOrdering? = nil, onConflict conflictResolution: SQLConflictResolution? = nil, autoincrement: Bool = false) {
        primaryKey = (ordering: ordering, conflictResolution: conflictResolution, autoincrement: autoincrement)
    }
    
    public func notNull(onConflict conflictResolution: SQLConflictResolution? = nil) {
        notNullConflictResolution = conflictResolution ?? .Abort
    }
    
    public func unique(onConflict conflictResolution: SQLConflictResolution? = nil) {
        uniqueConflictResolution = conflictResolution ?? .Abort
    }
    
    public func check(@noescape condition: (SQLColumn) -> _SQLExpressible) {
        checkExpression = condition(SQLColumn(name)).sqlExpression
    }
    
    public func defaults(value: _SQLExpressible) {
        defaultExpression = value.sqlExpression
    }
    
    public func collate(collation: SQLCollation) {
        collationName = collation.rawValue
    }
    
    public func collate(collation: DatabaseCollation) {
        collationName = collation.name
    }
    
    public func references(table: String, column: String? = nil, onDelete deleteAction: SQLForeignKeyAction? = nil, onUpdate updateAction: SQLForeignKeyAction? = nil, deferred: Bool = false) {
        reference = (table: table, column: column, deleteAction: deleteAction, updateAction: updateAction, deferred: deferred)
    }

    case Datetime = "DATETIME"
}

// TODO: doc
public enum SQLForeignKeyAction : String {
    case Cascade = "CASCADE"
    case Restrict = "RESTRICT"
