 // =====================================================================================================================
 // MARK:- Table
 
+/// Describes the structure of a table -- it's columns.
 public class TableInfo : NSObject {
     
     public init(name:String, columns:[ColumnInfo]) {

    // -----------------------------------------------------------------------------------------------------------------
    // MARK:  ALTER TABLE
    
    public func renameTable(tableName:String, to:String, error:NSErrorPointer = nil) -> Bool {
        let renameTableSql = "ALTER TABLE " + escapeIdentifier(tableName)
                                + " RENAME TO " + escapeIdentifier(to)

    // -----------------------------------------------------------------------------------------------------------------
    // MARK:  Name
    
    /// The table name.
    public let name: String
    
    // -----------------------------------------------------------------------------------------------------------------
    // MARK:  Columns

    /// Details about the table's columns.
    public let columns: [ColumnInfo]

    /// The names of all columns in the table.
    public var columnNames : [String] {
        return columns.map { $0.name }
    }
    
}

/// Describes a column in a database table.
public class ColumnInfo : NSObject {
    
    public init(index:Int, name:String, type:String?, notNull:Bool, defaultValue:String?, primaryKeyIndex:Int) {
