zeoslib  UNKNOWN
 All Files
ZSqLiteAnalyser.pas
Go to the documentation of this file.
1 {*********************************************************}
2 { }
3 { Zeos Database Objects }
4 { SQLite 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 ZSqLiteAnalyser;
53 
54 interface
55 
56 {$I ZParseSql.inc}
57 
58 uses Classes, ZGenericSqlAnalyser;
59 
60 type
61 
62  {** Implements an SQLite statements analyser. }
63  TZSQLiteStatementAnalyser = class (TZGenericStatementAnalyser)
64  public
65  constructor Create;
66  end;
67 
68 implementation
69 
70 const
71  {** The generic constants.}
72  SQLiteSectionNames: array[0..11] of string = (
73  'SELECT', 'UPDATE', 'DELETE', 'INSERT', 'FROM',
74  'WHERE', 'INTO', 'GROUP*BY', 'HAVING', 'ORDER*BY',
75  'OFFSET', 'LIMIT'
76  );
77  SQLiteSelectOptions: array[0..1] of string = (
78  'DISTINCT', 'ALL'
79  );
80  SQLiteFromJoins: array[0..7] of string = (
81  'NATURAL', 'RIGHT', 'LEFT', 'FULL', 'INNER', 'OUTER', 'JOIN', 'CROSS'
82  );
83  SQLiteFromClauses: array[0..1] of string = (
84  'ON', 'USING'
85  );
86 
87 { TZSQLiteStatementAnalyser }
88 
89 {**
90  Creates the object and assignes the main properties.
91 }
92 constructor TZSQLiteStatementAnalyser.Create;
93 begin
94  SectionNames := ArrayToStrings(SQLiteSectionNames);
95  SelectOptions := ArrayToStrings(SQLiteSelectOptions);
96  FromJoins := ArrayToStrings(SQLiteFromJoins);
97  FromClauses := ArrayToStrings(SQLiteFromClauses);
98 end;
99 
100 end.
101