def ensure_db(db_name, *args, **kwargs):
    conn = r.connect()

    try:
        r.db_create(db_name, *args, **kwargs).run(conn)
    except r.RqlRuntimeError:
        pass  # Ignore DB already created
Creates a DB if it doesn't exist.
dataset/ETHPy150Open vim-awesome/vim-awesome/db/util.py/ensure_db