Exemplo n.º 1
0
def run_with_outletify_db(f):
    dbname = rand_db()
    handle = db.connect(dbname)
    try:
        db.create_outletify_tables(handle)
        f(handle)
    finally:
        db.close_handle(handle)
        os.remove(dbname)
def run_with_outletify_db(f):
    dbname = rand_db()
    handle = db.connect(dbname)
    try:
        db.create_outletify_tables(handle)
        f(handle)
    finally:
        db.close_handle(handle)
        os.remove(dbname)
Exemplo n.º 3
0
## @file
# Script to add some random data to an Outletify database

import db_interface as db
import random

dbhandle = db.connect()
try:
    for i in range(0, 100):
        for _ in range(0, random.randint(5, 20)):
            db.add_row(i, random.randint(0, 2000), dbhandle)
finally:
    db.close_handle(dbhandle)