public static Identifier ( string name ) : string | ||
name | string | |
return | string |
public static string GetSchemaName(string fullObjectName) { int dotPosition = fullObjectName.IndexOf('.'); if (dotPosition == -1) { throw new FrameworkException($"Missing schema name for database object '{fullObjectName}'."); } var schema = fullObjectName.Substring(0, dotPosition); return(SqlUtility.Identifier(schema)); }
public static string GetShortName(string fullObjectName) { int dotPosition = fullObjectName.IndexOf('.'); if (dotPosition == -1) { return(fullObjectName); } var shortName = fullObjectName.Substring(dotPosition + 1); int secondDot = shortName.IndexOf('.'); if (secondDot != -1 || string.IsNullOrEmpty(shortName)) { throw new FrameworkException("Invalid database object name: '" + fullObjectName + "'. Expected format is 'schema.name' or 'name'."); } return(SqlUtility.Identifier(shortName)); }
public static string GetSchemaName(string fullObjectName) { int dotPosition = fullObjectName.IndexOf('.'); if (dotPosition == -1) { if (DatabaseLanguageIsMsSql.Value) { return("dbo"); } else if (DatabaseLanguageIsOracle.Value) { throw new FrameworkException("Missing schema name for database object '" + fullObjectName + "'."); } else { throw new FrameworkException(UnsupportedLanguageError); } } var schema = fullObjectName.Substring(0, dotPosition); return(SqlUtility.Identifier(schema)); }