public SqlObject()

in src/SqlObject.cs [54:79]


        public SqlObject(string fullName)
        {
            var parser = new TSql150Parser(false);
            var stringReader = new StringReader(fullName);
            SchemaObjectName tree = parser.ParseSchemaObjectName(stringReader, out IList<ParseError> errors);

            if (errors.Count > 0)
            {
                string errorMessages = "Encountered error(s) while parsing schema and object name:\n";
                foreach (ParseError err in errors)
                {
                    errorMessages += $"{err.Message}\n";
                }
                throw new InvalidOperationException(errorMessages);
            }

            var visitor = new TSqlObjectFragmentVisitor();
            tree.Accept(visitor);
            this.Schema = visitor.schemaName;
            this.QuotedSchema = this.Schema == SCHEMA_NAME_FUNCTION ? this.Schema : this.Schema.AsSingleQuotedString();
            this.Name = visitor.objectName;
            this.QuotedName = this.Name.AsSingleQuotedString();
            this.FullName = this.Schema == SCHEMA_NAME_FUNCTION ? this.Name : $"{this.Schema}.{this.Name}";
            this.BracketQuotedFullName = this.Schema == SCHEMA_NAME_FUNCTION ? this.Name.AsBracketQuotedString() : $"{this.Schema.AsBracketQuotedString()}.{this.Name.AsBracketQuotedString()}";
            this.QuotedFullName = this.BracketQuotedFullName.AsSingleQuotedString();
        }