Make --write-sql value optional instead of none