MCPcopy Create free account
hub / github.com/bytebase/bytebase / IsObjectCaseSensitive

Function IsObjectCaseSensitive

backend/store/instance.go:332–346  ·  view source on GitHub ↗

IsObjectCaseSensitive returns true if the engine ignores database and table case sensitive.

(instance *InstanceMessage)

Source from the content-addressed store, hash-verified

330
331// IsObjectCaseSensitive returns true if the engine ignores database and table case sensitive.
332func IsObjectCaseSensitive(instance *InstanceMessage) bool {
333 switch instance.Metadata.GetEngine() {
334 case storepb.Engine_TIDB:
335 return false
336 case storepb.Engine_MYSQL, storepb.Engine_MARIADB, storepb.Engine_OCEANBASE:
337 return instance.Metadata == nil || instance.Metadata.MysqlLowerCaseTableNames == 0
338 case storepb.Engine_MSSQL:
339 // In fact, SQL Server is possible to create a case-sensitive database and case-insensitive database on one instance.
340 // https://www.webucator.com/article/how-to-check-case-sensitivity-in-sql-server/
341 // But by default, SQL Server is case-insensitive.
342 return false
343 default:
344 return true
345 }
346}
347
348func (s *Store) obfuscateInstance(ctx context.Context, instance *storepb.Instance) (*storepb.Instance, error) {
349 secret, err := s.GetAuthSecret(ctx)

Callers 14

doSyncDatabaseSchemaMethod · 0.92
backupDataMethod · 0.92
runReviewMethod · 0.92
getResourcesForMySQLFunction · 0.92
getResourcesForPostgresFunction · 0.92
getResourcesForRedshiftFunction · 0.92
queryRetryFunction · 0.92
getSourceDBMetadataMethod · 0.92
getTargetDBMetadataMethod · 0.92
checkReleaseVersionedMethod · 0.92

Calls 1

GetEngineMethod · 0.45

Tested by

no test coverage detected