part of '../ast.dart'; class UpsertClause extends AstNode implements HasWhereClause { final List /*?*/ onColumns; @override Expression where; UpsertAction action; UpsertClause({this.onColumns, this.where, @required this.action}); @override R accept(AstVisitor visitor, A arg) { return visitor.visitUpsertClause(this, arg); } @override void transformChildren(Transformer transformer, A arg) { transformer.transformChildren(onColumns, this, arg); where = transformer.transformNullableChild(where, this, arg); action = transformer.transformChild(action, this, arg); } @override Iterable get childNodes { return [ if (onColumns != null) ...onColumns, if (where != null) where, action, ]; } } abstract class UpsertAction extends AstNode {} class DoNothing extends UpsertAction { @override R accept(AstVisitor visitor, A arg) { return visitor.visitDoNothing(this, arg); } @override void transformChildren(Transformer transformer, A arg) {} @override Iterable get childNodes => const []; } class DoUpdate extends UpsertAction implements HasWhereClause { final List set; @override Expression where; DoUpdate(this.set, {this.where}); @override R accept(AstVisitor visitor, A arg) { return visitor.visitDoUpdate(this, arg); } @override void transformChildren(Transformer transformer, A arg) { transformer.transformChildren(set, this, arg); where = transformer.transformNullableChild(where, this, arg); } @override Iterable get childNodes => [...set, if (where != null) where]; }