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))
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))
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.")