1 /* 2 * Copyright 2015-2018 HuntLabs.cn 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 module hunt.sql.dialect.mysql.ast.statement.MySqlShowProfileStatement; 17 18 19 import hunt.collection; 20 21 import hunt.sql.ast.SQLExpr; 22 import hunt.sql.ast.SQLLimit; 23 import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor; 24 import hunt.sql.dialect.mysql.ast.statement.MySqlStatementImpl; 25 import hunt.sql.dialect.mysql.ast.statement.MySqlShowStatement; 26 27 public class MySqlShowProfileStatement : MySqlStatementImpl , MySqlShowStatement { 28 alias accept0 = MySqlStatementImpl.accept0; 29 30 enum Type : string { 31 ALL = "ALL", 32 BLOCK_IO = "BLOCK IO", 33 CONTEXT_SWITCHES = "CONTEXT SWITCHES", 34 CPU = "CPU", 35 IPC = "IPC", 36 MEMORY = "MEMORY", 37 PAGE_FAULTS = "PAGE FAULTS", 38 SOURCE = "SOURCE", 39 SWAPS = "SWAPS" 40 } 41 42 private List!(Type) types; 43 44 private SQLExpr forQuery; 45 46 private SQLLimit limit; 47 48 this(){ 49 types = new ArrayList!(Type)(); 50 } 51 52 override public void accept0(MySqlASTVisitor visitor) { 53 visitor.visit(this); 54 visitor.endVisit(this); 55 } 56 57 public List!(Type) getTypes() { 58 return types; 59 } 60 61 public SQLExpr getForQuery() { 62 return forQuery; 63 } 64 65 public void setForQuery(SQLExpr forQuery) { 66 this.forQuery = forQuery; 67 } 68 69 public SQLLimit getLimit() { 70 return limit; 71 } 72 73 public void setLimit(SQLLimit limit) { 74 this.limit = limit; 75 } 76 77 78 79 }