Makes 'db' argument to connection optional.