public override void VisitDropTable(StatementDropTable statementDropTable) { if (!statementDropTable.IfExists) { this.Builder.Append("DROP TABLE "); statementDropTable.Table.Accept(this.ExprBuilder, null); } else { StatementIfExists ifExists = statementDropTable.Table switch { ExprTableFullName t => new StatementIfTableExists( t, StatementList.Combine(new StatementDropTable(statementDropTable.Table, false)), null), ExprTempTableName tempTable => new StatementIfTempTableExists( tempTable, StatementList.Combine(new StatementDropTable(statementDropTable.Table, false)), null), _ => throw new ArgumentOutOfRangeException() }; ifExists.Accept(this); } }
public IStatement DropAndCreate() { return(StatementList.Combine(this.DropIfExist(), this.Create())); }