#1 mORMot 2 » Record serialization of static arrays (Delphi7, no rtti-infos) » 2024-03-07 08:17:02

tfopc
Replies: 1

Hi,
is it possible to serialize a record like this with definition RegisterFromText and without changing the record type (TTest) definition?

type TEnum = (eTagUnknown,eTagOne,eTagTwo)

     TTest = record
              id: cardinal;
              test: string;
              prices: array[1..3] of double;
              tags[eTagOne..eTagTwo] of integer;
             end;
const __TTest = 'id:cardinal;test:string;prices: array of double;tags: array of integer';

I have tried registriation with:

Rtti.RegisterTypes([TypeInfo(TEnum)]);
Rtti.RegisterFromText(TypeInfo(TTestRecord),__TTest);

but i get the error/exception on RegisterFromText:

Rtti.RegisterFromText(TTestRecord): text definition  covers 16 bytes, but RTTI defined 40

#2 mORMot 2 » TOrmMany/TSQLMany - ManyAdd result » 2024-01-21 13:16:13

tfopc
Replies: 0

Hi,

if i want to update the pivot-table with new entries i call "PivotTable.ManyAdd" with NoDuplicates=true. But the result is false if the record allready exists.

So the is no difference between ignore insert and a false result because of the false result from Client.Add or UseBatch.Add.

Maybe set the result to true if InternalIDFromSourceDest<>0 is better?

  if NoDuplicates and
     (InternalIDFromSourceDest(aClient, aSourceID, aDestID) <> 0) then
    begin
    result := true;
    exit; // this TRecordReference pair already exists
    end;

best regards,
Tobias

#3 mORMot 2 » Authentication in WinHTTP / WinHttpSetCredentials » 2024-01-08 16:24:08

tfopc
Replies: 1

Hi,

are there any plans to support authentification for reqests and proxy-authentication via WinHttpSetCredentials like descriped at:

https://learn.microsoft.com/en-us/windo … in-winhttp

Best regards
Tobias

Board footer

Powered by FluxBB