当前位置: 首页>>代码示例>>C#>>正文


C# IParser.ParseSqlScript方法代码示例

本文整理汇总了C#中IParser.ParseSqlScript方法的典型用法代码示例。如果您正苦于以下问题:C# IParser.ParseSqlScript方法的具体用法?C# IParser.ParseSqlScript怎么用?C# IParser.ParseSqlScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IParser的用法示例。


在下文中一共展示了IParser.ParseSqlScript方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ScriptFile

 /// <summary>
 /// Instantiates a build script object.
 /// </summary>
 /// <remarks>
 /// This constructor will attempt to parse the given SQL and determine whether it is valid 
 /// and whether the script creates the object specified by the given identifier.  If the 
 /// script is invalid in anyway, the <see cref="ScriptError"/> property will reflect that.
 /// </remarks>
 /// <param name="scriptObject">The identifier of the database object to build.</param>
 /// <param name="scriptContent">The build script SQL content.</param>
 /// <param name="parser">The sql script parser for reading the SQL script content.</param>
 public ScriptFile(TypedDatabaseObject scriptObject, string scriptContent, IParser parser)
 {
     ScriptObject = scriptObject;
     Content = scriptContent;
     existingDependencies = new HashSet<TypedDatabaseObject>();
     try
     {
         Sql = parser.ParseSqlScript(scriptContent);
         AssertMatchingContent();
     }
     catch (SqlParseException ex)
     {
         ScriptError = new SqlParseError(ex.Message);
         Sql = null;
     }
     catch(EmptyTextException)
     {
         ScriptError = new EmptyTextError();
         Sql = null;
     }
     catch(MultipleStatementException ex)
     {
         ScriptError = new MultipleStatementError(ex.Count, ex.Allotment);
         Sql = null;
     }
     catch(UnexpectedObjectTypeException ex)
     {
         ScriptError = new UnexpectedObjectTypeError(ex.TypeName);
         Sql = null;
     }
 }
开发者ID:Zocdoc,项目名称:ZocBuild.Database,代码行数:42,代码来源:ScriptFile.cs


注:本文中的IParser.ParseSqlScript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。