Pass connection name to query event. Closes #1300.