You are not logged in.
The are some procedure to do this into mormot2?????
I have created a interface and class REST/SOAPClient to wrapper THttpClientSocket. then by default i use json contenttype, but some part of code need pass xml to content type.
I need replace the header item.
set some defaults to http
http.HeaderAdd(cREST_HEADER_CONTENTTYPE, cREST_CONTENTTYPE_JSON);
http.HeaderAdd(cREST_HEADER_SOAPACTION, cREST_SOAPACTION_ADD);
in other moment
http.HeaderAdd(cREST_HEADER_CONTENTTYPE, cREST_CONTENTTYPE_XML);
HEADERS:
Content-Type: application/json
SOAPAction: "add"
Content-Type: application/xml
I whould like replace content-type item
I have studied Python, FastAPI, pyDantic
It is a combination very simple, fast and I think that many things could by bring to mormot.
pyDantic valid DTO on server when receive request and generate exception if some field is invalid automaticaly.
U just have register the trules on DTO
from fastapi import FastAPI
from typing import List
from pydantic import BaseModel, Field
-----------------
app = FastAPI()
class Student(BaseModel):
id: int
name :str = Field(None, title="name of student", max_length=10)
subjects: List[str] = []
@app.post("/students/")
async def student_data(s1: Student):
return s1
----------------
just this to have a Api online....
U can use RegularExpression, required, etc on field´s method
FastAPI gegnerate all documentation too. no needs external tools.
Just ideas. not is a mormot critc! I love Mormot, I love u Arnould! ![]()
I download last night master again. now works!
tnks
I have deleted all dcu of my computer. then I open mormot2tests in my ide Delphi7
i have all update packs
when try compile i got erro:
I have update my mormot to last version.
when compiling i get:
procedure TJsonWriter.AddJsonEscapeW(P: PWord; Len: PtrUInt);
...
else
inc(B, Utf16HiCharToUtf8(B + 1, c, P)); // handle UTF-16 surrogates
if P >= PWord(Len) then <<<<<<<
break;
until false;
end;[Error] mormot.core.json.pas(7149): Operator not applicable to this operand type
[Error] mormot.core.json.pas(7169): Operator not applicable to this operand type
all works again, ty
Rest Interfaces.
I put .AcceptMethods([mGet,mPUT,mPost,mDelete]) in my registerservice. and now works.
I dont know if is the better place, but works. was hours of debug and looking mormot code! I look at documentation but i cannot found nothing about!
I have update my sources, it is very old!
Now my application dont accept PUT and DELETE. just Get and POST
I create a class:
TRestServerAuthenticationJWT = class(TRestServerAuthenticationHttpBasic)
class function TRestServerAuthenticationJWT.GetUserPassFromCtx(pCtxt: TRestServerUriContext): RawUtf8;
var
vAuthBasic, vUserName, vPassWord: RawUtf8;
begin
GetUserPassFromInHead(pCtxt, vAuthBasic, vUserName, vPassWord);
Result := TAuthUser.ComputeHashedPassword(vPassWord);
end;
but TRestServerAuthenticationHttpBasic.GetUserPassFromInHead not exist more.
What should I do?
{..., "IdExterno": 0, ...} if put other value i get same error
sample
{..., "IdExterno": 15, ...}
sorry. To field:
FIdExterno: TNullableInteger;
TUsuario = class(TAuthUser)
private
FTipo: TTipoUsuario;
FEmpresaID: TID;
FIdExterno: TNullableInteger;
published
property Tipo: TTipoUsuario read FTipo write FTipo;
property EmpresaID: TID read FEmpresaID write FEmpresaID;
property IdExterno: TNullableInteger read FIdExterno write FIdExterno;
end;
TDTOUsuario = packed record
ID: Int64;
IdExterno: TNullableInteger;
Email: RawUtf8;
Nome: RawUtf8;
Cpf: RawUtf8;
end;
function InitMap_Usuario: TRttiMap;
begin
Result.Init(TUsuario, TypeInfo(TDTOUsuario)).AutoMap
.Map([
'DisplayName', 'Nome',
'LogonName', 'Email'
]);
end;
procedure ToObject(const pDTOUsuario: TDTOUsuario; pObj: TUsuario);
begin
InitMap_Usuario.ToA(pObj, @pDTOUsuario);
end;
function ToObject(const pDTOUsuario: TDTOUsuario): TUsuario;
begin
Result := nil;
InitMap_Usuario.ToA(Result, @pDTOUsuario); <<<< invalid variant type when
end;
function ToDTO(pUsuario: TUsuario): TDTOUsuario;
begin
InitMap_Usuario.ToB(pUsuario, @Result);
end;
...
procedure RegisterDTOs;
const
...
cRegDTOUsuario = 'ID Int64 IdExterno variant Email,Nome,Cpf RawUtf8';
begin
TJsonSerializer.RegisterCustomJSONSerializerFromText(TypeInfo(TDTOUsuario), cRegDTOUsuario);
end;
initialization
RegisterDTOs;debugging we see that erro happen in "procedure TRttiMap.ToA(A, B: pointer);"
...
if pa^ <> nil then
begin
writeln('ToA: '+pa^.Name);
Flush(Output);
pb^.CopyValue(A, B, pa^); // invalid variant type on linux here when (pa^.Name = 'IdExterno') (windows works)
writeln('After ToA: '+pa^.Name);
Flush(Output);
end;Very good explain. for more doccumentation so!
Congratulations
It´s more easy parse the message error to show more understandable messages to the end use that verify all locations that my pk is fk! This is my opinion!
Neither all programmer will have the caution that we have! And problems can happen.
function TRestStorageExternal.ExecuteDirect(const SqlFormat: RawUtf8;
const Args, Params: array of const; ExpectResults: boolean): ISqlDBRows;
var
stmt: ISqlDBStatement;
begin
...
try
stmt := fProperties.NewThreadSafeStatementPrepared(
SqlFormat, Args, ExpectResults, {except=}true); <<<< when some exception happens here....
...
except
<<<<<<<<<<<< FLastDBErro dont is filled
stmt := nil;
HandleClearPoolOnConnectionIssue; // leave result=nil to notify error
end;
end;then if i try get erro with GetDbError i receive a empty string.
my sugestion
except
on E: Exception do
begin
SetDbError(E.Message);
stmt := nil;
HandleClearPoolOnConnectionIssue; // leave result=nil to notify error
end;
end;linux without certificate installed, resolved problem!
Hi guys,
All works in windows 10 but dont work on linux unbuntu 21 with same configurations.
What i should have on linux to sendmail works with ou without TLS?
Database: Postgress
Ok, on database, mormot create all fields in lowercase, how change this to create conform the ORM class?
property DataCriacao. i dont want on database like "datacriacao"
I would Like Json com property "DataCriacao".
If I make retrieve with collumns defined, json is generated "DataCriacao", but if i want retrieve all columns, mormot retrieve "datacriacao"
This are generating problems on frontend plataform because to it DataCriacao <> datacriacao
I have this TOrm and DTO:
TMPOrm = class(TOrm)
private
FDataCriacao: TDateTime;
FUltimaAlteracao: TDateTime;
FEmpresaID: TID;
published
property DataCriacao: TDateTime read FDataCriacao write FDataCriacao;
property UltimaAlteracao: TDateTime read FUltimaAlteracao write FUltimaAlteracao;
property EmpresaID: TID read FEmpresaID write FEmpresaID;
end;
TPosto = class(TMPOrm)
private
FNome: RawUtf8;
FIdExterno: Int64;
published
property Nome: RawUTF8 index 100 read FNome write FNome;
property IdExterno: Int64 read FIdExterno write FIdExterno;
end;
TDTOPosto = packed record
Nome: RawUtf8;
ID: Int64;
IDExterno: Int64;
end;when using CreatingMissingTables all fields names are translated to loweercase.
when retrieve information of database i get this json:
{
"ID": 1,
"datacriacao": "2024-10-09T16:19:11",
"ultimaalteracao": "2025-01-14T10:02:45",
"empresaid": 1,
"nome": "Posto G",
"idexterno": 32
}How json property follow the same name case of DTO or ORM?
TSqlDBStatement.FetchAllToJson return "rackid":null
'{"id":32,"datacriacao":"2025-01-13T09:58:46","ultimaalteracao":"2025-01-13T09:58:46","empresaid":1,"numero":"0101","solicitacaoid":12,"exames":"PC, FOS","dataetiqueta":"2022-09-03T10:12:34","rackid":null,"linha":0,"coluna":0,"coletado":0,"cancelada":0,"postoatualid":1}'
function TRestOrm.RetrieveDocVariantArray(Table: TOrmClass;
const ObjectName: RawUtf8; const FormatSqlWhere: RawUtf8;
const BoundsSqlWhere: array of const; const FieldsCsv: RawUtf8;
FirstRecordID, LastRecordID: PID): variant;
...
T := MultiFieldValues(Table, FieldsCsv, FormatSqlWhere, BoundsSqlWhere);
if T <> nil then
try
T.ToDocVariant(v, {readonly=}false); <<<<<<<<<<<< this part change "rackid":null of database to "rackid":0 (ZERO)
v = > '[{"ID":32,...,"rackid":0,...},...}]'
if FirstRecordID <> nil then
FirstRecordID^ := T.GetID(1);
...in my database my records are with RackId field filled with null
my class TAmostra has property RackID: TNullableInteger read FRackID write FRackID;
var
vListaAmostras: IDocList;
vAmostra: IDocObject;
vTempAmostra: TAmostra;
begin
vTempAmostra := TAmostra.Create;
try
vListaAmostras := DocListFrom(FRestOrm.Orm.RetrieveDocVariantArray(TAmostra, '', '(SolicitacaoID=?)', [pSolicitacaoExistenteId], '*'));
for vAmostra in vListaAmostras do
begin
vTempAmostra.FillFrom(Variant(vAmostra.Value^));
if (Pos(vTempAmostra.Numero, pAmostras) <> 0)
or not NullableIntegerIsEmptyOrNull(vTempAmostra.RackID) then
Continue;
...NullableIntegerIsEmptyOrNull(vTempAmostra.RackID) return false when shoul be return true.
debugging i see that vListaAmostras[0] return
'{"ID":26,"datacriacao":"2025-01-07T11:32:17","ultimaalteracao":"2025-01-07T11:42:47","empresaid":1,"numero":"0101","solicitacaoid":12,"exames":"PC, FOS","dataetiqueta":"2022-09-03T10:12:34","rackid":0,"linha":0,"coluna":0,"coletado":false,"cancelada":true,"postoatualid":1}'
should be "rackid": null????? because in database is null
I have some Rest Interfaced based.
On server, how can a service/controller be called from another rest method?
I see something about resolve of interfaces but I dont understand how use it!
How I can do this, I see a some time ago that we can use UpdateResource of windows to change resources, but i dunno if will be multiplatarform.
Mormot have something to make this multiplataform way? where i can find instrutions about it?
Could TSynValidates classes have something method that we could override to change this messages?
I look on regression tests, on blog in on source.
I need change the default error message of TSynValidate. for sample:
function TSynValidateEmail.Process(aFieldIndex: integer; const value: RawUtf8;
var ErrorMsg: string): boolean;
...
ErrorMsg := Format(sInvalidEmailAddress, [Utf8ToString(value)]); <<<<<<< i need change this message for my language
result := false;
end;I dont see no parameter to change this.
I put property as TNullableInteger on record too and works, tnks!
Where I found documentation or sample to translate Tsynvalidate messages?
There are in mormot some class to make validate in DTOs records?
I need make some simple validates on service before call my repositories passing DTOs. what u think about this?
Other question. Where I found documentation or sample to translate Tsynvalidate messages?
Arnold,
How make record to object using rttimap understand object properties TNullableXXXX?
I have a propery TNullableInteger but when sending a record property to object it write 0.
What I can do?
Are u completly correct. Thanks AB
The usecase of TRttiMap is to easily copy field values by names.
What you are supposed to do is:
- use TRttiMap to copy field values by name
- leave the dest field name as '' to ignore a field
- add your own custom code for those ignored fields, which may need additional processThis "custom code" would be easy and nice, with no RTTI involved.
Using a MethodToA() function sounds clearly over-complicated to me.
MyConvertMethod is to specific cases, where we cant convert A to B, o B to A directly
a new function in TRttimap
function TRttiMap.CustomMap(MyConvertMethod): PRttiMap;
Sample of use:
TDTOClient.Date is String;
TOrmClient.DateFinal is TDateTime;
map.Init(TypeInfo(TDTOClient), TOrmClient)
.AutoMap
.Map([
'FatherName', '', // ignore in A
'', 'MatherName' // ignore in B
])
.Map('Date', 'DateFinal')
.CustomMap(MyConvertMethod);
procedure TMyService.MyConvertMethod(map: TRttimap; AToB: Boolean; propertyName: String; A, B: pointer)
begin
if AToB and (propertyName = 'Date') then then
map.SetValue(B, propertyName, ConvertIsoString2DateTime(map.GetValue(A, propertyName)))
else
map.SetValue(A, propertyName, ConvertDateTime2IsoString(map.GetValue(B, propertyName)));
end;The documentation is part of the source comments of TRttiMap.
See also test.core.base.pas line 2456 and following.
Thanks i read all.
1) There are some list to register many TRttiMap like RegisterFromText?
2) What u think that pass some method to be called during ToA or ToB where I can make copyvalue or no!?
ex: m.ToA(@MeuRecord, @MyConvertMethodToA)
function MyConvertMethodToA(A, B: pointer; PropName: String; pA, pB: PPRttiCustomProp): Boolean;
var
v: TVarData;
begin
if PropnameB = 'Name' then
begin
v := 'Sr. ' + GetValueVariant(A, v) <<< i think that don't work this way, just to explain the idea
// here i can change the value to be put in A property "Name".
pA^.SetValueVariant(A, v); <<< something like this
Result := True
end else
Result := False;
end;procedure TRttiMap.ToA(A, B, MethodToA: pointer);
var
...
handled: boolean;
begin
...
repeat
if MethodToA <> Nil then
handled := MethodToA(A, B, PropName, pA, pB) <<< I dont know if will need all this params
if not handled and (pa^ <>) nil then
pb^.CopyValue(A, B, pa^); // copy this mapped property value
...
until n = 0;
end;What u think?
There are some way to mapping property with names diferents between record and object. i.e:
TDTOAPerson TClient
Name ----> ClientName
BirthDay ----> BirthDay
I see something about TMapRTTI on last version of mormot, but i dont see on forum, blog or documentation nothing about this.
thanks man!
"The ORM does not support any such complex "Where" clause with an inner join"
But it bring the records with fields passed.
I whould like understand why It take "EmpresaID=?". I have others properties TID on TAmostra, but orm put just EmpresaID.
I can use FConfigDB to make my complex queries and use ORM to insert, update, delete? what impact about this? I´m using postgress (TSqlDBPostgresConnectionProperties). All samples that I see, use or somefile.db or SQLITE_MEMORY_DATABASE_NAME.
I´m using frontend made in nocode plataform (testing yet) then all this code is on server application.
I have the following scenario below and I don't understand why the ORM is not taking into account the parameterized query I am making, creating another completely different query.
TAmostra = class(TOrm)
private
FNumero: RawUTF8;
FSolicitacaoID: TID;
FExames: RawUTF8;
FDataEtiqueta: TDateTime;
FRackID: TNullableInteger;
FPostoAtual: TID;
FColetado: Boolean;
FCancelada: Boolean;
FPostoAtualID: TID;
FEmpresaID: TID;
published
property EmpresaID: TID read FEmpresaID write FEmpresaID;
property Numero: RawUTF8 index 40 read FNumero write FNumero;
property SolicitacaoID: TID read FSolicitacaoID write FSolicitacaoID;
property Exames: RawUTF8 index 500 read FExames write FExames;
property DataEtiqueta: TDateTime read FDataEtiqueta write FDataEtiqueta;
property RackID: TNullableInteger read FRackID write FRackID;
property Coletado: Boolean read FColetado write FColetado;
property PostoAtualID: TID read FPostoAtualID write FPostoAtualID;
end;When I do:
FRestOrm.Orm.RetrieveDocVariantArray(TAmostra, '',
' inner join Solicitacao s on (s.RowID = Amostra.solicitacaoID) where (amostra.empresaID = ?) and (s.numero = ?) order by s.numero, Amostra.numero '
[1, "4"],
'Amostra.RowID, Amostra.*, s.numero numerosolicitacao, s.paciente, s.datasolicitacao');
Why does this prepare a sql like this:
select DataCriacao,UltimaAlteracao,EmpresaID,Numero,SolicitacaoID,Exames,DataEtiqueta,RackID,Linha,Coluna,Coletado,Cancelada,PostoAtualID,ID
from public.Amostra where EmpresaID=?From what I debugged, it executes the above sql throwing all CompanyID objects = 1 into a cache. I need all TAmostra where EmpresaID=1 and Number="4".
In a previous post AB informed me that RetrieveDocVariantArray works anyway, so why the "FormatSqlWhere" and "BoundsSqlWhere" parameters if this method doesn't respect it?
I looked in the documentation and on the forum how to disable the cache but I didn't find it or it didn't work.
function TRepository.ConnectionClass(pDBConnection: TSqlDBConnectionPropertiesClass): IRepository;
begin
Result := Self;
FConfigDB := pDBConnection.Create(FHost, FDatabase, FUser, FPassword);
FConfigDB.ConnectionTimeOutMinutes := 2;
VirtualTableExternalRegisterAll(FOrmModel, FConfigDB);
FRestOrm := TRestServerDB.Create(FOrmModel, SQLITE_MEMORY_DATABASE_NAME);
FRestOrm.AcquireExecutionMode[execOrmGet] := amBackgroundOrmSharedThread;
FRestOrm.AcquireExecutionMode[execOrmWrite] := amBackgroundOrmSharedThread;
FRestOrm.DB.UseCache := False; <<<<<< dont disable the cache
FRestOrm.DB.Synchronous := smOff;
FRestOrm.DB.LockingMode := lmExclusive;
FRestOrm.Server.CreateMissingTables;
CreateIndexes;
FRestOrm.Server.TrackChanges([TEmpresa, TUsuario, TAmostra,
TRack, TEvento], TMyHistory, 100, 10, 65536);
end;I've forced an exception by putting a misnamed field in my SQL. During "RetrieveDocVariantArray" for sample, I get the SQL error, but after that, I can't catch the error message.
I tried:
GetLastError is 0
LastDBErrorID is 0
HasDBError is False
What I can use to capture this exception that i see on log?
"ESqlite3Exception {Message:"Error SQLITE_ERROR (1) [SELECT xSample.RowID, Sample.*, s.numbernumberrequest, s.patient, s.datarequest FROM Sample inner join Request s on (s.RowID = Sample.requestID) where (sample.companyID = ?) and (s.numero = ?) order by s.numero, Sample.numero ] using 3.44.2 - no such column: xSample.RowID", ErrorCode:1, SQLite3ErrorCode:"secERROR"} [TAppRestHttpSrv 8081v1 THttpSrv] at 8ed37c"
debugging i see that some part of caching clearDBError.
Good morning Arnold, I have read and re-read the documentation several times but as there are several ways to connect to the database, several ways to extract the data and also to store it, this leaves any beginner in the framework very confused. Could you tell me which path I should follow to achieve this?
1) I have complex master detail queries and
I need to deoil this in the json format with objects and subobjects. I was trying to use RetrieveDocVariantArray but this method does not meet the criteria passed to prepare and execute the query.
2) I need to use REST/SOA and work with DTO. When the dto arrives I need to transform it into TORM to save it in the database (or fill automaticaly params of some sql inser/delete/update). If I access the database directly instead of using orm, I would have a huge job of assembling each insert/update/delete, things that orm already does. Furthermore, there is the issue of batch update and transactions.
3) if it is possible to mix ORM with direct access to the bank, what precautions should I take when doing this.
Please, I need more detailed answers. even if it's notes to documentation locations or test routines or examples where I will find a solution to these doubts.
Sorry Arnold if I'm bothering you. I see mormot as a viable solution for my system and I don't want to stop using it because I don't know how to use it properly. what is the best way to work. I use a SQL database and do not intend to work with NoSQL databases. I think this is the big reality for most Delphi/Lazarus programmers.
I can also share my code with you to tell me how I should proceed in order to obtain the best possible performance when using mormot to meet my needs.
I execute have this function:
function TSelect.Retrieve: Variant;
begin
Result := FRestOrm.Orm.RetrieveDocVariantArray(TAmostra, '',
FWhere,
TDocVariantData(FWhereParamValues).ToArrayOfConst,
FCustomFieldsCsv)
...
end;
FWhere = 'inner join Solicitacao s on (s.RowID = Amostra.solicitacaoID) where (amostra.empresaID = ?) and (s.numero = ?)'
FWhereParams = [1, '4']On first call this RetrieveDocVariantArray make many selects on database. why? look the log
it show a where clause that i dont put: "where EmpresaID=?"
00000000102FB745 DB mormot.db.sql.postgres.TSqlDBPostgresConnection(03575620) Connected to 191.101.78.31:5001 DB_SOROTRACK using...
000000001037BA78 DB mormot.db.sql.postgres.TSqlDBPostgresStatement(0352bea0) Prepare t=1.85s c=00 q=select DataCriacao,UltimaAlteracao,EmpresaID,Numero,SolicitacaoID,Exames,DataEtiqueta,RackID,Linha,Coluna,Coletado,Cancelada,ID from public.Amostra where EmpresaID=? <<<<< this not is my sql
00000000103BBE57 SQL mormot.db.sql.postgres.TSqlDBPostgresStatement(0352bea0) Execute t=2.11s c=00 r=25 q=select DataCriacao,UltimaAlteracao,EmpresaID,Numero,SolicitacaoID,Exames,DataEtiqueta,RackID,Linha,Coluna,Coletado,Cancelada,ID from public.Amostra where EmpresaID=1 <<<< neither this
00000000103BD6F4 SQL mormot.orm.sql.TOrmVirtualTableCursorExternal(03e3b1b0) Search select DataCriacao,UltimaAlteracao,EmpresaID,Numero,SolicitacaoID,Exames,DataEtiqueta,RackID,Linha,Coluna,Coletado,Cancelada,ID from public.Amostra where EmpresaID=?
000000001043C4A4 DB mormot.db.sql.postgres.TSqlDBPostgresStatement(03529e20) Prepare t=516.47ms c=01 q=select DataCriacao,UltimaAlteracao,EmpresaID,Numero,DataSolicitacao,Paciente,PostoID,AtendenteID,ID from public.Solicitacao where Numero=? and ID=?
000000001047C973 SQL mormot.db.sql.postgres.TSqlDBPostgresStatement(03529e20) Execute t=774.69ms c=01 r=0 q=select DataCriacao,UltimaAlteracao,EmpresaID,Numero,DataSolicitacao,Paciente,PostoID,AtendenteID,ID from public.Solicitacao where Numero='4' and ID=11
00000000104BBB97 SQL mormot.db.sql.postgres.TSqlDBPostgresStatement(03529e20) Execute t=256.64ms c=01 r=0 q=select DataCriacao,UltimaAlteracao,EmpresaID,Numero,DataSolicitacao,Paciente,PostoID,AtendenteID,ID from public.Solicitacao where Numero='4' and ID=12
0000000014BCD30A SQL mormot.orm.sql.TOrmVirtualTableCursorExternal(03e3b170) Search select DataCriacao,UltimaAlteracao,EmpresaID,Numero,DataSolicitacao,Paciente,PostoID,AtendenteID,ID from public.Solicitacao where Numero=? and ID=?
0000000015AC76CC SQL mormot.db.sql.postgres.TSqlDBPostgresStatement(03529e20) Execute t=256.49ms c=01 r=1 q=select DataCriacao,UltimaAlteracao,EmpresaID,Numero,DataSolicitacao,Paciente,PostoID,AtendenteID,ID from public.Solicitacao where Numero='4' and ID=10
0000000015AC7F3C SQL mormot.orm.sql.TOrmVirtualTableCursorExternal(03e3b170) Search select ...and many other lines like above. with where clause that i dont send to retrieve.
then finally my return
0000000018F01559 res mormot.db.raw.sqlite3.TSqlDatabase(035750a0) [{"rowid":1,"DataCriacao":"2024-10-10T14:21:43","UltimaAlteracao":"2024-10-24T10:04:18","EmpresaID":1,"Numero":"123","SolicitacaoID":10,"Exames":"he","DataEtiqueta":"2024-10-
...
10T18:20:00","RackID":1,"Linha":1,"Coluna":2,"Coletado":1,"Cancelada":0,"numerosolicitacao":"4","Paciente":"ana","DataSolicitacao":"2024-10-10T08:39:00"},
{"ID":9,"DataCriacao":"2024-10-10T14:21:43","Ultim... (truncated) length=7692then I call my service again...and now it get from cache. showing that correct where "where (amostra.empresaID = :(1):) and (s.numero =
'4'):)"
0000000018F35FCB - 99.053.647
0000000019A38E4D + mormot.rest.memserver.TRestServerFullMemory(0349b260).URI POST v1/amostraService/buscar in=232 B
0000000019C92853 SQL mormot.db.raw.sqlite3.TSqlDatabase(035750a0) from cache SELECT Amostra.RowID, Amostra.*, s.numero numerosolicitacao, s.paciente, s.datasolicitacao FROM Amostra inner join Solicitacao s on (s.RowID = Amostra.solicitacaoID) where (amostra.empresaID = :(1):) and (s.numero = :('4'):)
0000000019F70618 ret Infra.Authentication.JWT.TRestServerURIContext_JWT(036e9b40) [{"ID":1,"DataCriacao":"2024-10-10T14:21:43","UltimaAlteracao":"2024-10-24T10:04:18","EmpresaID":1,"Numero":"123","SolicitacaoID":10,"Exames":"he","DataEtiqueta":"2024-10-10T18:20:00","RackID":1,"Linha":1,"Coluna":2,"Coletado":true,"Cancelada":false,"numerosolicitacao":"4","Paciente":"ana","DataSolicitacao":"2024-10-10T08:39:00"},{"ID":5,"DataCriacao":"2024-10-10T14:21:43","UltimaAlteracao":"2024-10-24T10:06:58","EmpresaID":1,"Numero":"125","SolicitacaoID":10,"Exames":"ad","DataEtiqueta":"2024-10-10T18:20:33","RackID":1,"Linha":1,"Coluna":1,"Coletado":true,"Cancelada":false,"numerosolicitacao":"4","Paciente":"ana","DataSolicitacao":"2024-10-10T08:39:00"},...
{"ID":8,"DataCriacao":"2024-10-10T14:21:43","UltimaAlteracao":"2024-10-31T08:18:58","EmpresaID":1,"Numero":"128","SolicitacaoID":10,"Exames":"ijiji","DataEtiqueta":"2024-10-10T18:20:00","RackID":0,"Linha":0,"Coluna":0,"Coletado":true,"Cancelada":false,"numerosolicitacao":"4","Paciente":"ana","DataSolicitacao":"2024-10-10T08:39:00"},{"ID":9,"DataCriacao":"2024-10-10T14:21:43","Ultim... (truncated) length=7692
0000000019F71039 - 05.472.748Thanks now works. Can u explain about this change? Or by default sendmail should be ignore certificate?
Does have the smtp server a valid X.509 certificate, known by the client host?
How I can verify this?
There are some other way to api server send email without this?
I i found this certificate how i configure it into mormot sendmail?
I fell me a newbie!
Are u brazilian too? We can meet to talk about mormot and delphi and lazarus
We are using FPCDeluxe to crosscompile.
What version of lazarus and of fpc we should be choose?
To compile linux and windows from windows machine!
I think you don't understand what is being proposed in this thread. The proposal is for mormot to prevent a record from being removed from the database if the record is being used by some property of another object that references this table. this will to avoid inconsistency in the database or the table that references the deleted record being set to ZERO as mormot does today.
The issue of creating the FK is just something additional to prevent the programmer from using a delete outside the ORM from also leaving the database inconsistent.
Kabiri, I undesrstand you but FKs is a great way to protect yout database against inconsistence. If mormot could grant this integrity will be great. this will remove of programmer many responsability. We know that are programmers and programmers.
Some answer to this topic Arnold?
WAW!!!!!!!!!!!!!!!!!!!!!
Very very very thanks Arnold. This is a Great Feature to MORMOT. 10 points Gain
Arnold have u some method similar to copy values from RecordToObject and ObjectToRecord?
Tnks AB