set up stream functionality for reading from mysql