本文整理汇总了C#中SqlWriter类的典型用法代码示例。如果您正苦于以下问题:C# SqlWriter类的具体用法?C# SqlWriter怎么用?C# SqlWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlWriter类属于命名空间,在下文中一共展示了SqlWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteTo
public override void WriteTo(SqlWriter writer) {
base.WriteTo(writer);
writer.WriteKeyword("DEFAULT ");
writer.Write('(');
writer.WriteScript(defaultValue, WhitespacePadding.None);
writer.Write(')');
}
示例2: WriteNonGlobalInternal
internal void WriteNonGlobalInternal(SqlWriter writer) {
if (!quote) {
writer.Write(Value);
} else {
base.WriteToInternal(writer, false);
}
}
示例3: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteKeyword("CREATE XML SCHEMA COLLECTION ");
writer.WriteScript(xmlSchemaCollectionName, WhitespacePadding.None);
writer.WriteKeyword(" AS ");
writer.WriteScript(expression, WhitespacePadding.None);
}
示例4: WriteSql
/// <summary>
/// We delegate the writing of the fragment to the appropriate type.
/// </summary>
/// <param name="writer"></param>
/// <param name="sqlGenerator"></param>
public void WriteSql(SqlWriter writer, SqlGenerator sqlGenerator)
{
if (null != _sqlFragments)
{
foreach (object o in _sqlFragments)
{
string str = (o as String);
if (null != str)
{
writer.Write(str);
}
else
{
ISqlFragment sqlFragment = (o as ISqlFragment);
if (null != sqlFragment)
{
sqlFragment.WriteSql(writer, sqlGenerator);
}
else
{
throw new InvalidOperationException();
}
}
}
}
}
示例5: WriteToInternal
protected internal override void WriteToInternal(SqlWriter writer, bool isPartOfQualifiedName) {
Debug.Assert(!isPartOfQualifiedName);
if (global) {
writer.WriteKeyword("GLOBAL ");
}
WriteNonGlobalInternal(writer);
}
示例6: CreateAddColumnStatement
public static Statement CreateAddColumnStatement(string tableName, Column column)
{
var writer = new SqlWriter();
writer.Alter.Table.QuotedName(tableName).Add.Flush();
WriteColumnDefinition(writer, column);
return new Statement(writer.ToString(), Statement.StatementType.Text, Statement.ResultType.None);
}
示例7: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteKeyword("OPTION ");
writer.Write('(');
writer.WriteScriptSequence(options, WhitespacePadding.None, w => w.Write(", "));
writer.Write(')');
}
示例8: WriteToInternal
protected internal override void WriteToInternal(SqlWriter writer, bool isPartOfQualifiedName) {
if (IsWildcard) {
writer.Write(Value);
} else {
base.WriteToInternal(writer, isPartOfQualifiedName);
}
}
示例9: WriteTo
public override void WriteTo(SqlWriter writer) {
base.WriteTo(writer);
writer.WriteKeyword("CHECK ");
writer.WriteScript(replication, WhitespacePadding.SpaceAfter);
writer.WriteScript(predicate, WhitespacePadding.None);
writer.Write(')');
}
示例10: WriteTo
public override void WriteTo(SqlWriter writer) {
writer.WriteScript(serverName, WhitespacePadding.None, null, w => w.Write('.'));
writer.WriteScript(databaseName, WhitespacePadding.None, null, w => w.Write('.'));
writer.WriteScript(schemaName, WhitespacePadding.None, null, w => w.Write('.'));
writer.WriteScript(tableName, WhitespacePadding.None);
base.WriteTo(writer);
}
示例11: ProcedureGenerator
/// <summary>
/// Initializes a new instance of the <see cref="ProcedureGenerator"/> class.
/// </summary>
/// <param name="table">The table.</param>
public ProcedureGenerator(DatabaseTable table)
: base(table)
{
SqlWriter = new SqlWriter(table, SqlType.Oracle);
SqlWriter.InStoredProcedure = true;
PackageName = "PACK_" + TableName;
}
示例12: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteFunction("UPDATE");
writer.Write('(');
writer.WriteScript(columnName, WhitespacePadding.None);
writer.Write(')');
}
示例13: WriteTo
public override void WriteTo(SqlWriter writer) {
writer.WriteFunction("COUNT");
writer.Write('(');
writer.WriteDuplicateRestriction(restriction, WhitespacePadding.SpaceAfter);
writer.WriteScript(expression, WhitespacePadding.None);
writer.Write(')');
}
示例14: WriteToInternal
protected internal override void WriteToInternal(SqlWriter writer, bool isPartOfQualifiedName) {
if (isPartOfQualifiedName || (!IsBuiltinType)) {
base.WriteToInternal(writer, isPartOfQualifiedName);
} else {
writer.WriteType(Value);
}
}
示例15: WriteTo
public override void WriteTo(SqlWriter writer) {
WriteCommentsTo(writer);
writer.WriteScript(valueExpression, WhitespacePadding.None);
base.WriteTo(writer);
writer.WriteKeyword(" IN ");
writer.WriteScript(tuple, WhitespacePadding.None);
}