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.MySqlShowEngineStatement;
17 
18 import hunt.sql.ast.SQLExpr;
19 import hunt.sql.dialect.mysql.visitor.MySqlASTVisitor;
20 import hunt.sql.dialect.mysql.ast.statement.MySqlStatementImpl;
21 import hunt.sql.dialect.mysql.ast.statement.MySqlShowStatement;
22 
23 public class MySqlShowEngineStatement : MySqlStatementImpl , MySqlShowStatement {
24     alias accept0 = MySqlStatementImpl.accept0;
25     private SQLExpr name;
26     private Option  option;
27 
28     override public void accept0(MySqlASTVisitor visitor) {
29         if (visitor.visit(this)) {
30             acceptChild(visitor, name);
31         }
32         visitor.endVisit(this);
33     }
34 
35     public SQLExpr getName() {
36         return name;
37     }
38 
39     public void setName(SQLExpr name) {
40         this.name = name;
41     }
42 
43     public Option getOption() {
44         return option;
45     }
46 
47     public void setOption(Option option) {
48         this.option = option;
49     }
50 
51     public static struct Option {
52         enum Option STATUS = Option("STATUS");
53         enum Option MUTEX = Option("MUTEX");
54 
55         private string _name;
56 
57         this(string name)
58         {
59             _name = name;
60         }
61 
62         @property string name()
63         {
64             return _name;
65         }
66 
67         bool opEquals(const Option h) nothrow {
68         return _name == h._name ;
69         } 
70 
71         bool opEquals(ref const Option h) nothrow {
72             return _name == h._name ;
73         }
74     }
75 }