vitess.io/vitess@v0.16.2/go/vt/vtgate/planbuilder/operators/delete.go (about) 1 /* 2 Copyright 2022 The Vitess Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package operators 18 19 import ( 20 "vitess.io/vitess/go/vt/sqlparser" 21 "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" 22 "vitess.io/vitess/go/vt/vtgate/semantics" 23 "vitess.io/vitess/go/vt/vtgate/vindexes" 24 ) 25 26 type Delete struct { 27 QTable *QueryTable 28 VTable *vindexes.Table 29 OwnedVindexQuery string 30 AST *sqlparser.Delete 31 32 noInputs 33 noColumns 34 noPredicates 35 } 36 37 var _ ops.PhysicalOperator = (*Delete)(nil) 38 39 // Introduces implements the PhysicalOperator interface 40 func (d *Delete) Introduces() semantics.TableSet { 41 return d.QTable.ID 42 } 43 44 // IPhysical implements the PhysicalOperator interface 45 func (d *Delete) IPhysical() {} 46 47 // Clone implements the Operator interface 48 func (d *Delete) Clone(inputs []ops.Operator) ops.Operator { 49 return &Delete{ 50 QTable: d.QTable, 51 VTable: d.VTable, 52 OwnedVindexQuery: d.OwnedVindexQuery, 53 AST: d.AST, 54 } 55 } 56 57 func (d *Delete) TablesUsed() []string { 58 if d.VTable != nil { 59 return SingleQualifiedIdentifier(d.VTable.Keyspace, d.VTable.Name) 60 } 61 return nil 62 }