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.postgresql.ast.expr.PGDateField; 17 18 public struct PGDateField { 19 enum PGDateField CENTURY = PGDateField("CENTURY"); 20 enum PGDateField DAY = PGDateField("DAY"); 21 enum PGDateField DECADE = PGDateField("DECADE"); 22 enum PGDateField DOW = PGDateField("DOW"); 23 enum PGDateField DOY = PGDateField("DOY"); 24 enum PGDateField EPOCH = PGDateField("EPOCH"); 25 enum PGDateField HOUR = PGDateField("HOUR"); 26 enum PGDateField ISODOW = PGDateField("ISODOW"); 27 enum PGDateField ISOYEAR = PGDateField("ISOYEAR"); 28 enum PGDateField MICROSECONDS = PGDateField("MICROSECONDS"); 29 enum PGDateField MILLENNIUM = PGDateField("MILLENNIUM"); 30 enum PGDateField MILLISECONDS = PGDateField("MILLISECONDS"); 31 enum PGDateField MINUTE = PGDateField("MINUTE"); 32 enum PGDateField MONTH = PGDateField("MONTH"); 33 enum PGDateField QUARTER = PGDateField("QUARTER"); 34 enum PGDateField SECOND = PGDateField("SECOND"); 35 enum PGDateField TIMEZONE = PGDateField("TIMEZONE"); 36 enum PGDateField TIMEZONE_HOUR = PGDateField("TIMEZONE_HOUR"); 37 enum PGDateField TIMEZONE_MINUTE = PGDateField("TIMEZONE_MINUTE"); 38 enum PGDateField WEEK = PGDateField("WEEK"); 39 enum PGDateField YEAR = PGDateField("YEAR"); 40 41 private string _name; 42 43 this(string name) 44 { 45 _name = name; 46 } 47 48 @property string name() 49 { 50 return _name; 51 } 52 53 54 bool opEquals(const PGDateField h) nothrow { 55 return _name == h._name ; 56 } 57 58 bool opEquals(ref const PGDateField h) nothrow { 59 return _name == h._name ; 60 } 61 }