Added a USE_SQLITE config define for dev purposes and a if here to decide which date bounds query to use based on that.