@@ -0,0 +1,1467 @@
+#!/usr/bin/env python%0A%0Aimport os%0A%0Afrom sqlalchemy import create_engine%0Afrom sqlalchemy.ext.declarative import declarative_base, ConcreteBase%0Afrom sqlalchemy import Column, Integer, String%0Afrom sqlalchemy.orm import sessionmaker%0A%0AMS_WD = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))%0ADB_NAME = 'sqlite.db'%0AFULL_DB_PATH = os.path.join(MS_WD, DB_NAME)%0A%0A%0ABase = declarative_base()%0A%0A%0Aclass Record(Base):%0A    __tablename__ = %22Records%22%0A%0A    task_id = Column(Integer, primary_key=True)%0A    task_status = Column(String)%0A    report_id = Column(Integer, unique=True)%0A%0A    def __repr__(self):%0A        return '%3CTask(%22%7B0%7D%22,%22%7B1%7D%22,%22%7B2%7D%22)%3E'.format(%0A            self.task_id, self.task_status, self.report_id%0A        )%0A%0A%0Adef init_sqlite_db():%0A    global Base%0A    eng = create_engine('sqlite:///%25s' %25 FULL_DB_PATH)%0A    Base.metadata.bind = eng%0A    Base.metadata.create_all()%0A%0A%0Adef add_record(task_id=None, task_status='Pending', report_id=None):%0A    eng = create_engine('sqlite:///%25s' %25 FULL_DB_PATH)%0A    Session = sessionmaker(bind=eng)%0A    ses = Session()%0A%0A%0A    ses.add(Record(task_status='Pending', report_id=None))%0A    ses.commit()%0A%0Adef print_all_records():%0A    eng = create_engine('sqlite:///%25s' %25 FULL_DB_PATH)%0A    Session = sessionmaker(bind=eng)%0A    ses = Session()%0A    rs = ses.query(Record).all()%0A%0A    for record in rs:%0A           print record%0A%0A%0Adef main():%0A    init_sqlite_db()%0A%0A    add_record()%0A%0A    print_all_records()%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add sqlite driver module