00001 {*********************************************************}
00002 { }
00003 { Zeos Database Objects }
00004 { SQL Statements Analysing classes }
00005 { }
00006 { Originally written by Sergey Seroukhov }
00007 { }
00008 {*********************************************************}
00009
00010 {@********************************************************}
00011 { Copyright (c) 1999-2006 Zeos Development Group }
00012 { }
00013 { License Agreement: }
00014 { }
00015 { This library is distributed in the hope that it will be }
00016 { useful, but WITHOUT ANY WARRANTY; without even the }
00017 { implied warranty of MERCHANTABILITY or FITNESS FOR }
00018 { A PARTICULAR PURPOSE. See the GNU Lesser General }
00019 { Public License for more details. }
00020 { }
00021 { The source code of the ZEOS Libraries and packages are }
00022 { distributed under the Library GNU General Public }
00023 { License (see the file COPYING / COPYING.ZEOS) }
00024 { with the following modification: }
00025 { As a special exception, the copyright holders of this }
00026 { library give you permission to link this library with }
00027 { independent modules to produce an executable, }
00028 { regardless of the license terms of these independent }
00029 { modules, and to copy and distribute the resulting }
00030 { executable under terms of your choice, provided that }
00031 { you also meet, for each linked independent module, }
00032 { the terms and conditions of the license of that module. }
00033 { An independent module is a module which is not derived }
00034 { from or based on this library. If you modify this }
00035 { library, you may extend this exception to your version }
00036 { of the library, but you are not obligated to do so. }
00037 { If you do not wish to do so, delete this exception }
00038 { statement from your version. }
00039 { }
00040 { }
00041 { The project web site is located on: }
00042 { http:
00043 { http:
00044 { svn:
00045 { }
00046 { http:
00047 { http:
00048 { }
00049 { }
00050 { }
00051 { Zeos Development Group. }
00052 {********************************************************@}
00053
00054 unit ZPostgreSqlAnalyser;
00055
00056 interface
00057
00058 {$I ZParseSql.inc}
00059
00060 uses Classes, ZGenericSqlAnalyser;
00061
00062 type
00063
00064 {** Implements an PostgreSQL statements analyser. }
00065 TZPostgreSQLStatementAnalyser = class (TZGenericStatementAnalyser)
00066 public
00067 constructor Create;
00068 end;
00069
00070 implementation
00071
00072 const
00073 {** The generic constants.}
00074 PostgreSQLSectionNames: array[0..12] of string = (
00075 'SELECT', 'UPDATE', 'DELETE', 'INSERT', 'FROM',
00076 'WHERE', 'INTO', 'GROUP*BY', 'HAVING', 'ORDER*BY',
00077 'FOR*UPDATE', 'LIMIT', 'OFFSET'
00078 );
00079 PostgreSQLSelectOptions: array[0..1] of string = (
00080 'DISTINCT', 'ALL'
00081 );
00082 PostgreSQLFromJoins: array[0..7] of string = (
00083 'NATURAL', 'RIGHT', 'LEFT', 'INNER', 'OUTER', 'JOIN',
00084 'FULL', 'CROSS'
00085 );
00086 PostgreSQLFromClauses: array[0..1] of string = (
00087 'ON', 'USING'
00088 );
00089
00090 { TZPostgreSQLStatementAnalyser }
00091
00092 {**
00093 Creates the object and assignes the main properties.
00094 }
00095 constructor TZPostgreSQLStatementAnalyser.Create;
00096 begin
00097 SectionNames := ArrayToStrings(PostgreSQLSectionNames);
00098 SelectOptions := ArrayToStrings(PostgreSQLSelectOptions);
00099 FromJoins := ArrayToStrings(PostgreSQLFromJoins);
00100 FromClauses := ArrayToStrings(PostgreSQLFromClauses);
00101 end;
00102
00103 end.
00104