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
Unit Name | Description | |
---|---|---|
mORMot | Common ORM and SOA classes for mORMot | |
mORMotVCL | DB VCL dataset using TSQLTable/TSQLTableJSON data access | |
SynCommons | Common functions used by most Synopse projects |
TClientDataSetMode = ( cdsNew, cdsAppend, cdsReplace );
How ToClientDataSet
/JSONToClientDataSet
functions will fill the TClientDataSet instance
Functions or procedures | Description | |
---|---|---|
JSONToClientDataSet | Convert a JSON result into a new VCL TClientDataSet | |
JSONToClientDataSet | Convert a JSON result into an existing VCL TClientDataSet | |
JSONToClientDataSet | Convert a JSON result into a new VCL TClientDataSet | |
ToClientDataSet | Convert a TSQLTable result into an existing VCL TClientDataSet | |
ToClientDataSet | For GetDBField() convert a TSQLTable result into a new VCL TClientDataSet |
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
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
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
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
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