zeoslib  UNKNOWN
 All Files
ZPostgreSqlAnalyser.pas
Go to the documentation of this file.
1 {*********************************************************}
2 { }
3 { Zeos Database Objects }
4 { SQL Statements Analysing classes }
5 { }
6 { Originally written by Sergey Seroukhov }
7 { }
8 {*********************************************************}
9 
10 {@********************************************************}
11 { Copyright (c) 1999-2012 Zeos Development Group }
12 { }
13 { License Agreement: }
14 { }
15 { This library is distributed in the hope that it will be }
16 { useful, but WITHOUT ANY WARRANTY; without even the }
17 { implied warranty of MERCHANTABILITY or FITNESS FOR }
18 { A PARTICULAR PURPOSE. See the GNU Lesser General }
19 { Public License for more details. }
20 { }
21 { The source code of the ZEOS Libraries and packages are }
22 { distributed under the Library GNU General Public }
23 { License (see the file COPYING / COPYING.ZEOS) }
24 { with the following modification: }
25 { As a special exception, the copyright holders of this }
26 { library give you permission to link this library with }
27 { independent modules to produce an executable, }
28 { regardless of the license terms of these independent }
29 { modules, and to copy and distribute the resulting }
30 { executable under terms of your choice, provided that }
31 { you also meet, for each linked independent module, }
32 { the terms and conditions of the license of that module. }
33 { An independent module is a module which is not derived }
34 { from or based on this library. If you modify this }
35 { library, you may extend this exception to your version }
36 { of the library, but you are not obligated to do so. }
37 { If you do not wish to do so, delete this exception }
38 { statement from your version. }
39 { }
40 { }
41 { The project web site is located on: }
42 { http://zeos.firmos.at (FORUM) }
43 { http://sourceforge.net/p/zeoslib/tickets/ (BUGTRACKER)}
44 { svn://svn.code.sf.net/p/zeoslib/code-0/trunk (SVN) }
45 { }
46 { http://www.sourceforge.net/projects/zeoslib. }
47 { }
48 { }
49 { Zeos Development Group. }
50 {********************************************************@}
51 
52 unit ZPostgreSqlAnalyser;
53 
54 interface
55 
56 {$I ZParseSql.inc}
57 
58 uses Classes, ZGenericSqlAnalyser;
59 
60 type
61 
62  {** Implements an PostgreSQL statements analyser. }
63  TZPostgreSQLStatementAnalyser = class (TZGenericStatementAnalyser)
64  public
65  constructor Create;
66  end;
67 
68 implementation
69 
70 const
71  {** The generic constants.}
72  PostgreSQLSectionNames: array[0..12] of string = (
73  'SELECT', 'UPDATE', 'DELETE', 'INSERT', 'FROM',
74  'WHERE', 'INTO', 'GROUP*BY', 'HAVING', 'ORDER*BY',
75  'FOR*UPDATE', 'LIMIT', 'OFFSET'
76  );
77  PostgreSQLSelectOptions: array[0..1] of string = (
78  'DISTINCT', 'ALL'
79  );
80  PostgreSQLFromJoins: array[0..7] of string = (
81  'NATURAL', 'RIGHT', 'LEFT', 'INNER', 'OUTER', 'JOIN',
82  'FULL', 'CROSS'
83  );
84  PostgreSQLFromClauses: array[0..1] of string = (
85  'ON', 'USING'
86  );
87 
88 { TZPostgreSQLStatementAnalyser }
89 
90 {**
91  Creates the object and assignes the main properties.
92 }
93 constructor TZPostgreSQLStatementAnalyser.Create;
94 begin
95  SectionNames := ArrayToStrings(PostgreSQLSectionNames);
96  SelectOptions := ArrayToStrings(PostgreSQLSelectOptions);
97  FromJoins := ArrayToStrings(PostgreSQLFromJoins);
98  FromClauses := ArrayToStrings(PostgreSQLFromClauses);
99 end;
100 
101 end.
102