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 static ExprTableFullName WithTableName(this ExprTableFullName original, ExprTableName newTableName) => new ExprTableFullName(dbSchema: original.DbSchema, tableName: newTableName);
public static ExprTableFullName WithDbSchema(this ExprTableFullName original, ExprDbSchema?newDbSchema) => new ExprTableFullName(dbSchema: newDbSchema, tableName: original.TableName);
public override bool VisitExprTableFullName(ExprTableFullName exprTableFullName, IExpr?parent) => this.VisitExprTableFullNameCommon(exprTableFullName, parent);
public abstract bool VisitExprTableFullName(ExprTableFullName exprTableFullName, IExpr?parent);
public StatementIfTableExists(ExprTableFullName exprTable, StatementList statements, StatementList?elseStatements) : base(statements, elseStatements) { this.ExprTable = exprTable; }