     }
     
     /// Returns the entry for a particular table.
-    public func tableNamed(tableName:String) -> SchemaEntry? {
+    public func tableNamed(tableName:String) -> SchemaEntryInfo? {
         for entry in schemaEntries {
             if entry.isTable && entry.name == tableName {
                 return entry

    // MARK:  Schema Items
    
    /// The entries in the Schema, each describing a table, index, or other structure.
    public let schemaEntries: [SchemaEntry]
    
    public subscript(entryName:String) -> SchemaEntry? {
        return entryNamed(entryName)
    }
    
    /// Returns the entry with the given name -- table, index, or trigger.
    public func entryNamed(entryName:String) -> SchemaEntry? {
        for entry in schemaEntries {
            if entry.name == entryName {
                return entry

    // MARK:  Schema Introspection
    
    /// The database schema. If an error occurs, an empty Schema object is returned.
    public var schema: SchemaInfo {
        var schemaEntries = [SchemaEntryInfo]()
        
        do {
            let statement = try prepareStatement("SELECT * FROM sqlite_master")
            while try statement.next() {
                let SchemaEntryInfo = SchemaEntryInfo(type:     statement.stringValue("type"),
                                              name:     statement.stringValue("name"),
                                              tableName:statement.stringValue("tbl_name"),
                                              rootPage: statement.intValue("rootpage"),
                                              sql:      statement.stringValue("sql"))
                
                schemaEntries.append(SchemaEntryInfo)
            }
        } catch let error {
            NSLog("Error preparing statement to read database schema: \(error)")
            return SchemaInfo()
        }
        
        return SchemaInfo(schemaEntries: schemaEntries)
    }
    
    /// Fetches details about a table in the database.
