Beispiel #1
0
def main(args):
    print('Star Spider...')
    db = BaseTable()
    db.connect()
    row = BaseTable(code='001', name='jeck')
    db.add(row)
    for row in db.get_all():
        print(row['code'], row['name'])
def main(args):
    print('Star Spider...')
    db = BaseTable()
    db.connect()
    row = BaseTable(code='001', name='jeck')
    db.add(row)
    row = BaseTable(code='002', name='frank')
    db.add(row)
    for row in db.get_all():
        print(row.id, row.code, row.name)
def main(args):
    print('Star Spider...')
    db = BaseTable()
    db.connect()
    row = BaseTable(code='001', name='jeck')
    db.add(row)
    row = BaseTable(code='002', name='frank')
    db.add(row)

    db.find(BaseTable.id=1, BaseTable.name='jeck')

    for row in db.get_all():
        print(row.id, row.code, row.name, row.createtime, row.modifytime)
def main(args):
    print('Star Spider...')
    db = BaseTable()
    db.connect()
    row = BaseTable(code='001', name='jeck')
    db.add(row)
    row = BaseTable(code='002', name='frank')
    db.add(row)

    rst = db.session.query.filter()

    for row in db.get_all():
        print(row.id, row.code, row.name, row.createtime, row.modifytime)
def main(args):
    print('Star Spider...')
    db = BaseTable()
    db.connect()
    row = BaseTable(code='001', name='jeck')
    db.add(row)
    row = BaseTable(code='002', name='frank')
    db.add(row)

    rst = db.session.query(BaseTable).filter(BaseTable.id == 2).first()
    rst.name = 'new name'
    db.update(rst)

    row = BaseTable(code='003', name='black')
    db.add(row)
    db.delete(rst)

    for row in db.get_all():
        print(row.id, row.code, row.name, row.createtime, row.modifytime)