Replica Databases Helper

This is a importable notebook that provides simple helpers for performing queries on the labsdb replica databases from PAWS. It is stateful and designed to be easy to use in an interactive setup.

Import behavior

As soon as you import this notebook, it sets up a simple mysql connection pool to the replica. No actual connections are made until you try to use any of the functions.

It provides the following functions:

sql(query, *args, dbname=None)

This runs the given query (with passed in parameters) on the currently selected db. It returns an iterator

use_db(dbname)