logo.png
Synopse mORMot Framework API Reference

mORMotMidasVCL.pas unit

Purpose: Fill a VCL TClientDataset from TSQLTable/TSQLTableJSON data
- this unit is a part of the freeware Synopse framework, licensed under a MPL/GPL/LGPL tri-license; version 1.18

1.1. Units used in the mORMotMidasVCL unit

Unit NameDescription
mORMotCommon ORM and SOA classes for mORMot
mORMotVCLDB VCL dataset using TSQLTable/TSQLTableJSON data access
SynCommonsCommon functions used by most Synopse projects

1.2. mORMotMidasVCL class hierarchy

1.3. Types implemented in the mORMotMidasVCL unit

1.3.1. TClientDataSetMode

TClientDataSetMode = ( cdsNew, cdsAppend, cdsReplace );

How ToClientDataSet/JSONToClientDataSet functions will fill the TClientDataSet instance


1.4. Functions or procedures implemented in the mORMotMidasVCL unit

Functions or proceduresDescription
JSONToClientDataSetConvert a JSON result into a new VCL TClientDataSet
JSONToClientDataSetConvert a JSON result into an existing VCL TClientDataSet
JSONToClientDataSetConvert a JSON result into a new VCL TClientDataSet
ToClientDataSetConvert a TSQLTable result into an existing VCL TClientDataSet
ToClientDataSetFor GetDBField() convert a TSQLTable result into a new VCL TClientDataSet

1.4.1. JSONToClientDataSet

function JSONToClientDataSet(aOwner: TComponent; const aJSON: RawUTF8; const Tables: array of TSQLRecordClass; aClient: TSQLRest=nil ; aForceWideString: boolean=false): TClientDataSet; overload;

Convert a JSON result into a new VCL TClientDataSet
- this overloaded method allows to specify the TSQLRecord class types associated with the supplied JSON


1.4.2. JSONToClientDataSet

function JSONToClientDataSet(aDataSet: TClientDataSet; const aJSON: RawUTF8; aClient: TSQLRest=nil; aMode: TClientDataSetMode=cdsReplace; aLogChange: boolean=false ; aForceWideString: boolean=false): boolean; overload;

Convert a JSON result into an existing VCL TClientDataSet
- current implementation will return a TClientDataSet instance, created from the supplied TSQLTable content (a more optimized version may appear later)
- with non-Unicode version of Delphi, you can set aForceWideString to force the use of WideString fields instead of AnsiString, if needed
- with Unicode version of Delphi (2009+), UnicodeString will be used
- for better speed with Delphi older than Delphi 2009 Update 3, it is recommended to use http://andy.jgknet.de/blog/bugfix-units/midas-speed-fix-12


1.4.3. JSONToClientDataSet

function JSONToClientDataSet(aOwner: TComponent; const aJSON: RawUTF8; aClient: TSQLRest=nil ; aForceWideString: boolean=false): TClientDataSet; overload;

Convert a JSON result into a new VCL TClientDataSet
- current implementation will return a TClientDataSet instance, created from the supplied TSQLTable content - see mORMotVCL if you need a more efficient, but read-only version
- with non-Unicode version of Delphi, you can set aForceWideString to force the use of WideString fields instead of AnsiString, if needed
- with Unicode version of Delphi (2009+), UnicodeString will be used
- for better speed with Delphi older than Delphi 2009 Update 3, it is recommended to use http://andy.jgknet.de/blog/bugfix-units/midas-speed-fix-12


1.4.4. ToClientDataSet

function ToClientDataSet(aOwner: TComponent; aTable: TSQLTable; aClient: TSQLRest=nil ; aForceWideString: boolean=false): TClientDataSet; overload;

For GetDBField() convert a TSQLTable result into a new VCL TClientDataSet
- current implementation will return a TClientDataSet instance, created from the supplied TSQLTable content (a more optimized version may appear later)
- with non-Unicode version of Delphi, you can set aForceWideString to force the use of WideString fields instead of AnsiString, if needed
- for better speed with Delphi older than Delphi 2009 Update 3, it is recommended to use http://andy.jgknet.de/blog/bugfix-units/midas-speed-fix-12


1.4.5. ToClientDataSet

function ToClientDataSet(aDataSet: TClientDataSet; aTable: TSQLTable; aClient: TSQLRest=nil; aMode: TClientDataSetMode=cdsReplace; aLogChange: boolean=false ; aForceWideString: boolean=false): boolean; overload;

Convert a TSQLTable result into an existing VCL TClientDataSet
- current implementation will return a TClientDataSet instance, created from the supplied TSQLTable content (a more optimized version may appear later)
- with non-Unicode version of Delphi, you can set aForceWideString to force the use of WideString fields instead of AnsiString, if needed
- for better speed with Delphi older than Delphi 2009 Update 3, it is recommended to use http://andy.jgknet.de/blog/bugfix-units/midas-speed-fix-12