Add some logic, dump sql