Merge pull request #328 from joaoduarte19/rql_bugfix

Rql bugfix
This commit is contained in:
Daniele Teti 2020-02-22 16:51:29 +01:00 committed by GitHub
commit c919faa1e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 168 additions and 20 deletions

View File

@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{FD44EB2E-3630-4DA7-A18A-D8F572433F4E}</ProjectGuid> <ProjectGuid>{FD44EB2E-3630-4DA7-A18A-D8F572433F4E}</ProjectGuid>
<ProjectVersion>18.7</ProjectVersion> <ProjectVersion>18.8</ProjectVersion>
<FrameworkType>VCL</FrameworkType> <FrameworkType>VCL</FrameworkType>
<MainSource>RQL2SQL.dpr</MainSource> <MainSource>RQL2SQL.dpr</MainSource>
<Base>True</Base> <Base>True</Base>
@ -165,12 +165,20 @@
<RemoteDir>classes</RemoteDir> <RemoteDir>classes</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="AndroidFileProvider"> <DeployClass Name="AndroidFileProvider">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\xml</RemoteDir> <RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="AndroidGDBServer"> <DeployClass Name="AndroidGDBServer">
<Platform Name="Android"> <Platform Name="Android">
@ -183,138 +191,242 @@
<RemoteDir>library\lib\armeabi</RemoteDir> <RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile"> <DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir> <RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="AndroidServiceOutput"> <DeployClass Name="AndroidServiceOutput">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir> <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="AndroidSplashImageDef"> <DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir> <RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="AndroidSplashStyles"> <DeployClass Name="AndroidSplashStyles">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\values</RemoteDir> <RemoteDir>res\values</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="AndroidSplashStylesV21"> <DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir> <RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_Colors"> <DeployClass Name="Android_Colors">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\values</RemoteDir> <RemoteDir>res\values</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_DefaultAppIcon"> <DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir> <RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_LauncherIcon144"> <DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir> <RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_LauncherIcon36"> <DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir> <RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_LauncherIcon48"> <DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir> <RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_LauncherIcon72"> <DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir> <RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_LauncherIcon96"> <DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir> <RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_NotificationIcon24"> <DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir> <RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_NotificationIcon36"> <DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir> <RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_NotificationIcon48"> <DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir> <RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_NotificationIcon72"> <DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir> <RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_NotificationIcon96"> <DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir> <RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_SplashImage426"> <DeployClass Name="Android_SplashImage426">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir> <RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_SplashImage470"> <DeployClass Name="Android_SplashImage470">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir> <RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_SplashImage640"> <DeployClass Name="Android_SplashImage640">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir> <RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_SplashImage960"> <DeployClass Name="Android_SplashImage960">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir> <RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="Android_Strings"> <DeployClass Name="Android_Strings">
<Platform Name="Android"> <Platform Name="Android">
<RemoteDir>res\values</RemoteDir> <RemoteDir>res\values</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="DebugSymbols"> <DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator"> <Platform Name="iOSSimulator">
@ -403,6 +515,9 @@
<Platform Name="Android"> <Platform Name="Android">
<Operation>0</Operation> <Operation>0</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32"> <Platform Name="iOSDevice32">
<Operation>0</Operation> <Operation>0</Operation>
</Platform> </Platform>
@ -736,6 +851,9 @@
<Platform Name="Android"> <Platform Name="Android">
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass> </DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug"> <DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32"> <Platform Name="iOSDevice32">
@ -828,6 +946,10 @@
<RemoteDir>library\lib\armeabi-v7a</RemoteDir> <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32"> <Platform Name="iOSDevice32">
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
@ -852,6 +974,12 @@
<Operation>0</Operation> <Operation>0</Operation>
</Platform> </Platform>
</DeployClass> </DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest"> <DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32"> <Platform Name="Win32">
<Operation>1</Operation> <Operation>1</Operation>
@ -889,6 +1017,7 @@
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment> </Deployment>
<Platforms> <Platforms>
<Platform value="Win32">True</Platform> <Platform value="Win32">True</Platform>

View File

@ -1,3 +1,5 @@
and(eq(nome,"Marca d'água"), contains(nome,"Marca d'água"), in(nome, ["Marca", "D'água"]))
and(eq(nome,"Marca d'água"), contains(nome,"Marca d'água"))
ne(value,null) ne(value,null)
eq(value,null) eq(value,null)
eq(value,false) eq(value,false)

View File

@ -128,7 +128,7 @@ begin
end; end;
tkContains: tkContains:
begin begin
Result := Format('(%s containing ''%s'')', [lDBFieldName, lValue.DeQuotedString.ToLower]) Result := Format('(%s containing %s)', [lDBFieldName, lValue.ToLower])
end; end;
tkIn: tkIn:
begin begin
@ -141,8 +141,8 @@ begin
end; end;
vtStringArray: vtStringArray:
begin begin
Result := Format('(%s IN (''%s''))', [ Result := Format('(%s IN (%s))', [
lDBFieldName, string.Join(''',''', aRQLFIlter.OpRightArray) lDBFieldName, string.Join(',', QuoteStringArray(aRQLFIlter.OpRightArray))
]); ]);
end; end;
else else

View File

@ -89,7 +89,7 @@ function TRQLMSSQLCompiler.RQLFilterToSQL(const aRQLFIlter: TRQLFilter): string;
var var
lValue, lDBFieldName: string; lValue, lDBFieldName: string;
begin begin
if aRQLFIlter.RightValueType = vtString then if (aRQLFIlter.RightValueType = vtString) and (aRQLFIlter.Token <> tkContains) then
lValue := aRQLFIlter.OpRight.QuotedString('''') lValue := aRQLFIlter.OpRight.QuotedString('''')
else if aRQLFIlter.RightValueType = vtBoolean then else if aRQLFIlter.RightValueType = vtBoolean then
begin begin
@ -136,7 +136,8 @@ begin
end; end;
tkContains: tkContains:
begin begin
Result := Format('(LOWER(%s) LIKE ''%%%s%%'')', [lDBFieldName, lValue.DeQuotedString.ToLower]) lValue := Format('%%%s%%', [lValue]).QuotedString('''');
Result := Format('(LOWER(%s) LIKE %s)', [lDBFieldName, lValue.ToLower])
end; end;
tkIn: tkIn:
begin begin
@ -149,8 +150,8 @@ begin
end; end;
vtStringArray: vtStringArray:
begin begin
Result := Format('(%s IN (''%s''))', [ Result := Format('(%s IN (%s))', [
lDBFieldName, string.Join(''',''', aRQLFIlter.OpRightArray) lDBFieldName, string.Join(',', QuoteStringArray(aRQLFIlter.OpRightArray))
]); ]);
end; end;
else else

View File

@ -80,7 +80,7 @@ function TRQLMySQLCompiler.RQLFilterToSQL(const aRQLFIlter: TRQLFilter): string;
var var
lValue, lDBFieldName: string; lValue, lDBFieldName: string;
begin begin
if aRQLFIlter.RightValueType = vtString then if (aRQLFIlter.RightValueType = vtString) and (aRQLFIlter.Token <> tkContains) then
lValue := aRQLFIlter.OpRight.QuotedString('''') lValue := aRQLFIlter.OpRight.QuotedString('''')
else if aRQLFIlter.RightValueType = vtBoolean then else if aRQLFIlter.RightValueType = vtBoolean then
begin begin
@ -127,7 +127,8 @@ begin
end; end;
tkContains: tkContains:
begin begin
Result := Format('(LOWER(%s) LIKE ''%%%s%%'')', [lDBFieldName, lValue.DeQuotedString.ToLower]) lValue := Format('%%%s%%', [lValue]).QuotedString('''');
Result := Format('(LOWER(%s) LIKE %s)', [lDBFieldName, lValue.ToLower])
end; end;
tkIn: tkIn:
begin begin
@ -140,8 +141,8 @@ begin
end; end;
vtStringArray: vtStringArray:
begin begin
Result := Format('(%s IN (''%s''))', [ Result := Format('(%s IN (%s))', [
lDBFieldName, string.Join(''',''', aRQLFIlter.OpRightArray) lDBFieldName, string.Join(',', QuoteStringArray(aRQLFIlter.OpRightArray))
]); ]);
end; end;
else else

View File

@ -81,7 +81,7 @@ function TRQLPostgreSQLCompiler.RQLFilterToSQL(const aRQLFIlter: TRQLFilter): st
var var
lValue, lDBFieldName: string; lValue, lDBFieldName: string;
begin begin
if aRQLFIlter.RightValueType = vtString then if (aRQLFIlter.RightValueType = vtString) and (aRQLFIlter.Token <> tkContains) then
lValue := aRQLFIlter.OpRight.QuotedString('''') lValue := aRQLFIlter.OpRight.QuotedString('''')
else else
lValue := aRQLFIlter.OpRight; lValue := aRQLFIlter.OpRight;
@ -121,7 +121,8 @@ begin
end; end;
tkContains: tkContains:
begin begin
Result := Format('(%s ILIKE ''%%%s%%'')', [lDBFieldName, lValue.DeQuotedString.ToLower]) lValue := Format('%%%s%%', [lValue]).QuotedString('''');
Result := Format('(%s ILIKE %s)', [lDBFieldName, lValue.ToLower])
end; end;
tkIn: tkIn:
begin begin
@ -134,8 +135,8 @@ begin
end; end;
vtStringArray: vtStringArray:
begin begin
Result := Format('(%s IN (''%s''))', [ Result := Format('(%s IN (%s))', [
lDBFieldName, string.Join(''',''', aRQLFIlter.OpRightArray) lDBFieldName, string.Join(',', QuoteStringArray(aRQLFIlter.OpRightArray))
]); ]);
end; end;
else else

View File

@ -82,7 +82,7 @@ function TRQLSQLiteCompiler.RQLFilterToSQL(const aRQLFIlter: TRQLFilter): string
var var
lValue, lDBFieldName: string; lValue, lDBFieldName: string;
begin begin
if aRQLFIlter.RightValueType = vtString then if (aRQLFIlter.RightValueType = vtString) and (aRQLFIlter.Token <> tkContains) then
lValue := aRQLFIlter.OpRight.QuotedString('''') lValue := aRQLFIlter.OpRight.QuotedString('''')
else else
lValue := aRQLFIlter.OpRight; lValue := aRQLFIlter.OpRight;
@ -122,7 +122,8 @@ begin
end; end;
tkContains: tkContains:
begin begin
Result := Format('(%s LIKE ''%%%s%%'')', [lDBFieldName, lValue.DeQuotedString.ToLower]) lValue := Format('%%%s%%', [lValue]).QuotedString('''');
Result := Format('(%s LIKE %s)', [lDBFieldName, lValue.ToLower])
end; end;
tkIn: tkIn:
begin begin
@ -135,8 +136,8 @@ begin
end; end;
vtStringArray: vtStringArray:
begin begin
Result := Format('(%s IN (''%s''))', [ Result := Format('(%s IN (%s))', [
lDBFieldName, string.Join(''',''', aRQLFIlter.OpRightArray) lDBFieldName, string.Join(',', QuoteStringArray(aRQLFIlter.OpRightArray))
]); ]);
end; end;
else else

View File

@ -93,6 +93,7 @@ type
fMapping: TMVCFieldsMapping; fMapping: TMVCFieldsMapping;
protected protected
function GetDatabaseFieldName(const RQLPropertyName: string): string; function GetDatabaseFieldName(const RQLPropertyName: string): string;
function QuoteStringArray(const aStringArray: TArray<string>): TArray<string>;
public public
constructor Create(const Mapping: TMVCFieldsMapping); virtual; constructor Create(const Mapping: TMVCFieldsMapping); virtual;
procedure AST2SQL(const aRQLAST: TRQLAbstractSyntaxTree; out aSQL: string); virtual; abstract; procedure AST2SQL(const aRQLAST: TRQLAbstractSyntaxTree; out aSQL: string); virtual; abstract;
@ -1152,6 +1153,18 @@ begin
[RQLPropertyName]); [RQLPropertyName]);
end; end;
function TRQLCompiler.QuoteStringArray(const aStringArray: TArray<string>): TArray<string>;
var
lValue: string;
begin
SetLength(Result, 0);
for lValue in aStringArray do
begin
SetLength(Result, Length(Result) + 1);
Result[High(Result)] := lValue.QuotedString('''');
end;
end;
{ TRQLAbstractSyntaxTree } { TRQLAbstractSyntaxTree }
constructor TRQLAbstractSyntaxTree.Create; constructor TRQLAbstractSyntaxTree.Create;