We throw Database name cannot be empty errors if name.trim() is the empty string in two places.
This is wrong, because a) it allows a lot of forbidden characters and b) disallows names that contain only non-space whitespace (which are technically valid).
See https://docs.mongodb.com/v5.0/reference/limits/#naming-restrictions / https://github.com/mongodb/mongo/blob/c865688f1993bba72cbffc39d5e80f21313ba4ee/src/mongo/db/namespace_string.h#L658 for the actual rules.