bind db and options to emit function
make index options and db available to emit functions