public override IASTNode VisitDropIndex(SqlServerCommandParser.DropIndexContext context) { DropIndexCommand result = new DropIndexCommand(); result.Indexes.Add((IndexSegment)Visit(context.indexName())); result.Table = (SimpleTableSegment)Visit(context.tableName()); return(result); }
public string[] CreateStatements(DropIndexCommand command) { return(new [] { string.Format(" drop index {1} on {0} ", _dialect.QuoteForTableName(PrefixTableName(command.TableName)), _dialect.QuoteForColumnName(command.IndexName) ) }); }
public void Visit(StringBuilder builder, DropIndexCommand command) { if (ExecuteCustomInterpreter(command)) { return; } builder.AppendFormat("drop index {0} ON {1}", _dialect.QuoteForColumnName(PrefixTableName(command.IndexName)), _dialect.QuoteForTableName(PrefixTableName(command.TableName))); _sqlStatements.Add(builder.ToString()); }
private ICollection <string> GetTableNamesFromMetaData(DropIndexCommand dropIndexCommand) { ICollection <string> result = new LinkedList <string>(); foreach (var index in dropIndexCommand.Indexes) { var tableName = FindLogicTableNameFromMetaData(index.Identifier.GetValue()); ShardingAssert.ShouldBeNotNull(tableName, $"Cannot find index name `{index.Identifier.GetValue()}`."); result.Add(tableName); } return(result); }
public string[] CreateStatements(DropIndexCommand command) { return(new string[0]); }
public InvalidIndexException(string message, DropIndexCommand command) : base(message) { Command = command; }
public virtual void Run(StringBuilder builder, DropIndexCommand command) { builder.AppendFormat("drop index {0} ON {1}", _dialect.QuoteForColumnName(command.IndexName), _dialect.QuoteForTableName(command.TableName)); }