'Write the database to a file'

def commit(self):

    out = open(self.name, 'wb')
    pickle.dump(self.fields, out, self.protocol)
    pickle.dump(self.next_id, out, self.protocol)
    pickle.dump(self.records, out, self.protocol)
    pickle.dump(self.indices, out, self.protocol)
    out.close()
