update to handle sql connection, and querying