[SERVER-77345] Move NamespaceString::validDBName to DatabaseName Created: 22/May/23  Updated: 07/Nov/23  Resolved: 07/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Matt Broadstone Assignee: Dominic Hernandez
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2023-10-30, Service Arch 2023-11-13
Participants:

 Description   

NamespaceString has a few methods for determining if a database name is valid, some which take a string others which take a DatabaseName. These feel like they belong on the new DatabaseName type (which is concerned with thinking about database names). I propose the following changes:

  • DatabaseName::isValid which can validate an existing DatabaseName is valid, per the rules in NamespaceString::validDbName(DatabaseName)
  • static DatabaseName::isValid(StringData) which replaces NamespaceString::validDbName(StringData)
  • All cases where we call validDBName(DatabaseName::db) (example) be converted to use the new DatbaseName::isValid


 Comments   
Comment by Githook User [ 06/Nov/23 ]

Author:

{'name': 'dominichernandez', 'email': 'dominic.hernandez@mongodb.com', 'username': 'dom-hernandez'}

Message: SERVER-77345, valdiDBName moves to DatabaseName, changed DatabaseName::validDBName to isValid

SERVER-77345: Split/Moved unit test from namespaceString to DatabaseNmae
Branch: master
https://github.com/mongodb/mongo/commit/0b9e8acbc6791a6fa50b1ac659981e4e34a3987e

Generated at Thu Feb 08 06:35:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.