Closed
Description
Before it was easy just to write
import rethinkdb as r
conn = r.connect(...)
r.table(...).run(conn)
But documentation (simply README) of rethinkdb python driver >=2.4.0 insist that now the proper way to do it is this:
from rethinkdb import RethinkDB
r = RethinkDB()
conn = r.connect(...)
r.table(...).run(conn)
It's OK to do it in single function. But it is NOT OK to do it in multiple functions and pass around the rethinkdb_instance
parameter in each function that makes requests to your rethinkdb.