You are not logged in.
Hi, I'm using delphi xe3 mormot to Version 1.18.
I can not find the method
TSQLTableToDataSet (Self, SQLTable, form1.client);
in the unit mORmotVCL that I have seen in the examples of the forum.
In which unit can I find this method?
Thank you sincerely.
Offline
It seems that there is no such thing as TSQLTableToDataSet in offcial mORMot:
Administrator@WIN-E1EVP9UU0HK /cygdrive/c/DEV/_Delphi_Lib_/mORMot
$ find ./ -name '*.pas' -print0 | xargs -0 grep -i --color=always -n TSQLTableToDataSet
Administrator@WIN-E1EVP9UU0HK /cygdrive/c/DEV/_Delphi_Lib_/mORMot
$
Offline
I took this method from this link on the forum.
http://synopse.info/forum/viewtopic.php?pid=7452
However, there is a method that can do this?
Offline
This is all explained in the documentation of the mORMotVCL.pas.
Just use TSynSQLTableDataSet.Create() constructor:
/// initialize the virtual TDataSet from a TSQLTable
// - WARNING: the supplied TSQLTable instance shall remain available
// all the time the returned TSynSQLTableDataSet instance is used, unless
// the TableShouldBeFreed property is set to true or CreateOwnedTable()
// constructor is used instead
// - with non-Unicode version of Delphi, you can set aForceWideString to
// force the use of WideString fields instead of AnsiString, if needed
// - the TDataSet will be opened once created
constructor Create(Owner: TComponent; Table: TSQLTable
{$ifndef UNICODE}; ForceWideString: boolean=false{$endif}); reintroduce;
/// initialize the virtual TDataSet owning a TSQLTable
// - this constructor will set TableShouldBeFreed to TRUE
// - with non-Unicode version of Delphi, you can set aForceWideString to
// force the use of WideString fields instead of AnsiString, if needed
// - the TDataSet will be opened once created
constructor CreateOwnedTable(Owner: TComponent; Table: TSQLTable
Offline
OK thanks
Offline
Hi, there is a way for obtain a partial fetching of data to show in grids? Like devexpress "server mode" or Firedac fetchmode = fmOnDemand?
I need to show a lot of records to scroll... What's the best way for optimize memory and quering backend (i'm using firebird)?
Thanks in advance!
Offline
No, there is no such "partial" mode at grid level.
We better rely on the filtering pattern (just like Google) instead of the paging one, which may be quite expensive, especially when the request is opened on the server, then fetch little by little on the client. Sometimes, it is really a true bad idea.
Try to change the mind, even in UI design, from a RAD/BDE pattern into a MVC/NoSQL scheme.
But you can use the LIMIT clause at request level (in the ORM method, use the WHERE clause for this).
Offline
Hi, thank you...
Sorry, I'm new to mormot. Well, ok, I understand you words... :-) I need to re-think the UI "asking" first...
Another question:there is a like "cached update" for retain multirows data change to commit all-in-one system in mormot (or like ApplyUpdate in Firedac) ?
Thank you!
Offline
There is no "briefcase" model in mORMot yet.
In fact, you have the BATCH feature at hand, not from the UI level, but from the code / ORM level.
It would induce a MVC UI, i.e. bind your UI to objects, then let mORMot persist your objects.
But there is no such direct feature yet, since the TDataSet generated by mORMot are very fast, but still read-only.
Offline