示例#1
0
def _create_table(table_name):
    logger.info("Creating {} table...".format(table_name))
    with get_connection() as conn:
        try:
            r.table_create(table_name).run(conn)
            logger.info("Created table {} successfully.".format(table_name))
        except:
            logger.info("Failed to create table {}!".format(table_name))
示例#2
0
def drop_db():
    logger.info("Dropping RethinkDB database '{}'...".format(RETHINKDB_NAME))
    try:
        with get_connection() as conn:
            r.db_drop(RETHINKDB_NAME).run(conn)
            logger.info("RethinkDB database dropped successfully.")
    except r.RqlRuntimeError:
        logger.info("Database '{}' does not exist on {}:{}".format(
            RETHINKDB_NAME, RETHINKDB_HOST, RETHINKDB_PORT))
示例#3
0
def create_db():
    logger.info("Creating RethinkDB database '{}'...".format(RETHINKDB_NAME))
    with get_connection() as conn:
        r.db_create(RETHINKDB_NAME).run(conn)
        logger.info("RethinkDB instance created successfully.")