You are not logged in.
Pages: 1
I know, but the interesting thing is why the speed is still low when datasource is set to nil. But when beginupdate is executed, the problem is solved.
I debugged it, closing is slow.
But you are right. I changed my code and sloved I don't khow why!!!!
vwMain.BeginUpdate(); //cxgrid
//DataSource1.DataSet := nil;
Hello and thanks.
The following statements are very slow, for a json that has 300 records. It takes a few seconds:
DataSource1.DataSet := nil;
OrmTableDataSet.Close;
OrmTableDataSet.Free;
OrmTableDataSet := TOrmTableDataSet.CreateFromJson(nil , json);
DataSource1.DataSet := OrmTableDataSet;
Hi AB
many thanks to excellent mormot2 framework.
,what is the wrong with swagger :
(when I use TNullableUtf8Text)
Resolver error at paths./InvoiceService/Insert.post.parameters.0.schema.properties.AInvoice.properties.remarks.$ref
Could not resolve reference: Could not resolve pointer: /definitions/TNullableUtf8Text does not exist in document.
Thank you.
Setter solved the problem. but i have alot of tables (600 tables), with many enum fields. I want to use existing database structure as possible.
procedure TOrmInvoice.SetSize(const Value: RawUtf8);
begin
//xxlarge,xlarge,large,medium,small
if Value = 'xxlarge' then
FSize := '1'
else if Value = 'xlarge' then
FSize := '2'
else if Value = 'large' then
FSize := '3'
else if Value = 'medium' then
FSize := '4'
else if Value = 'small' then
FSize := '5';
end;
publish
Size: RawUtf8;
field data type is enum('xxlarge','xlarge','large','medium','small');
I don't know where this conversion is happen. In orm level or Zeus level.
I have truble in mormot + mysql + enum fields.
Imagine that the data type is enum('large','small') when entering information in the corresponding orm class, it should be written like this (Otherwise, the error "Data truncated for column 'column_name' will be generated):
Rec.size := '1';
That is, we must enter the enum index. While I used the enum text itself in the previous software:
query.fieldbyname('size').asstring := 'large';
The solution that comes to my mind is to find the corresponding index by a function based on the enum text and write like this:
Rec.size := Get_inum_index('large');
Hi.
For reports I have very complex sql,what is the best way for executing this kind of sql?
Is it correct using :
function TReportService.Report: RawJson;
var
MyComplexSql: RawUtf8;
begin
MyComplexSql := 'my sql with left joins and subquery ...';
Result := TRestServerDB(Self.Server).DB.ExecuteJson(MyComplexSql, True);
end;
Hi AB. Thank you for very good mORMot framework.
This code work client side.
var
OrmTable: TOrmTable;
OrmTableDataSet: TOrmTableDataSet;
begin
OrmTable := HttpClient.ExecuteList([],'select * from user limit 10');
ShowMessage(OrmTable.RowCount.ToString);
OrmTableDataSet := TOrmTableDataSet.Create(nil, OrmTable);
DataSource1.DataSet := OrmTableDataSet;
end;
but in server side not working:Result is empty. I can't find why
procedure TUserService.List(var ATable: TOrmTable); //UserService is interface base service
begin
ATable := Self.Server.ExecuteList([],'select * from user');
end;
Hello . I want to check one of the demos related to mormot1 but TCQRSResult is missing in mormot2. What is its equivalent?
Pages: 1