示例#1
0
def set_up_db():
    '''Connects to an in-memory SQLite database,
    with the purpose of emptying it and recreating it.'''
    metadata.bind = "sqlite:///:memory:"
    #     metadata.bind.echo = True
    setup_all()
    create_all()
def set_up_db():
    '''Connects to an in-memory SQLite database,
    with the purpose of emptying it and recreating it.'''
    metadata.bind = "sqlite:///:memory:"
#     metadata.bind.echo = True
    setup_all()
    create_all()
示例#3
0
 def clean_up_db():
     metadata.bind = 'sqlite:///simplemmo.sqlite'
     setup_all()
     create_all()
     for u in User.query.all():
         print "Deleting %r" % u
         u.delete()
     session.commit()