Skip to content

Commit 59e48a2

Browse files
committed
NH-4043 - PostgreSQL dialect with keywords added.
1 parent bf2fd3c commit 59e48a2

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

src/NHibernate/Dialect/PostgreSQLDialect.cs

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,119 @@ public PostgreSQLDialect()
8282

8383
// Register the date function, since when used in LINQ select clauses, NH must know the data type.
8484
RegisterFunction("date", new SQLFunctionTemplate(NHibernateUtil.Date, "cast(?1 as date)"));
85+
86+
RegisterKeywords();
87+
}
88+
89+
#region private static readonly string[] DialectKeywords = { ... }
90+
91+
private static readonly string[] DialectKeywords =
92+
{
93+
"all",
94+
"analyse",
95+
"analyze",
96+
"and",
97+
"any",
98+
"array",
99+
"as",
100+
"asc",
101+
"asymmetric",
102+
"authorization",
103+
"binary",
104+
"both",
105+
"case",
106+
"cast",
107+
"check",
108+
"collate",
109+
"column",
110+
"concurrently",
111+
"constraint",
112+
"create",
113+
"cross",
114+
"current_catalog",
115+
"current_date",
116+
"current_role",
117+
"current_schema",
118+
"current_time",
119+
"current_timestamp",
120+
"current_user",
121+
"default",
122+
"deferrable",
123+
"desc",
124+
"distinct",
125+
"do",
126+
"else",
127+
"end",
128+
"except",
129+
"false",
130+
"fetch",
131+
"for",
132+
"foreign",
133+
"freeze",
134+
"from",
135+
"full",
136+
"grant",
137+
"group",
138+
"having",
139+
"ilike",
140+
"in",
141+
"initially",
142+
"inner",
143+
"intersect",
144+
"into",
145+
"is",
146+
"isnull",
147+
"join",
148+
"leading",
149+
"left",
150+
"like",
151+
"limit",
152+
"localtime",
153+
"localtimestamp",
154+
"natural",
155+
"not",
156+
"notnull",
157+
"null",
158+
"offset",
159+
"on",
160+
"only",
161+
"or",
162+
"order",
163+
"outer",
164+
"over",
165+
"overlaps",
166+
"placing",
167+
"primary",
168+
"references",
169+
"returning",
170+
"right",
171+
"select",
172+
"session_user",
173+
"similar",
174+
"some",
175+
"symmetric",
176+
"table",
177+
"then",
178+
"to",
179+
"trailing",
180+
"true",
181+
"union",
182+
"unique",
183+
"user",
184+
"using",
185+
"variadic",
186+
"verbose",
187+
"when",
188+
"where",
189+
"window",
190+
"with",
191+
};
192+
193+
#endregion
194+
195+
protected virtual void RegisterKeywords()
196+
{
197+
RegisterKeywords(DialectKeywords);
85198
}
86199

87200
public override string AddColumnString

0 commit comments

Comments
 (0)