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