#1 mORMot 2 » Crypto question » 2023-11-29 14:30:32

Replies: 1

I would like to use a SynCrypto.pas function for encrypt data with AES mode CTR.
But I must be sure that other external remote systems can decrypt correctly with a given key.
How is possible to ensure the certainty that encrypt in mormot is decrypted in other systems? There are measures to be adopted to make this process compatible (standardise) over time?
Thanks in advance!

#3 mORMot 2 » TSQLDBPostgresConnectionProperties pooling question » 2023-10-20 10:11:49

Replies: 2

Hi, TSQLDBPostgresConnectionProperties have a pooling management?
(I'm not referring to the management of the HTTPserver with its 32 threads and connection):

#4 Re: mORMot 2 » Fastest way to convert ISQLDBRows data into Myclass » 2023-10-17 09:48:46

The first thing I thought was that there will surely be a direct method avoiding the passage via Json... :-)

#5 mORMot 2 » Fastest way to convert ISQLDBRows data into Myclass » 2023-10-16 16:38:47

Replies: 2

I need to convert ISQLDBRows results data into my "business" classes for perform complex calculation (with master/details) and then export the Json.
What is the fastest (and easy) way for "marshall" ISQLDBRows to a list of MyClass?
Thanks in advance!

#6 Re: mORMot 2 » LDAP Active Directory list users » 2023-09-11 10:46:14

Hi Ab.
Thanks, It works.
Although it took some time to understand that it was the cookie that should return empty :-)
However I take advantage of a small oversight: in .GetUserInfo, .userPrincipalName is always empty in out Info: LdapUser.
Thanks a lot for help :-)

#7 Re: mORMot 2 » LDAP Active Directory list users » 2023-09-06 16:44:32

Ok, Ab.
There is anny little example of a paging ? Thanks in advance!

(I take advantage:  in function TLdapClient.GetUserInfo(const AN, DN, UPN: RawUtf8;
  out Info: TLdapUser; const BaseDN: RawUtf8; WithMemberOf: boolean;
  const CustomAttributes: TRawUtf8DynArray): boolean;

Param UPN Declared but never  used)

Thanks a lot :-)

#8 mORMot 2 » LDAP Active Directory list users » 2023-09-06 15:09:07

Replies: 14

I have used this code for extract a list of users of an Active Directory.
Congratulations, really fast!
But it return only the first 1000 elements, while the users are 16000.
What am I doing wrong? Or is there a preset limit?

Thanks in advance!

with TLdapClient.Create do
      if BindSaslKerberos then
            memo1.Lines.Add(' authenticated via Kerberos');
      //Search(WellKnownObjects.Users, false, '', []);
      tmpBaseDN := 'OU=GroupA1,DC=dmlocaltest,DC=com';
      Search(tmpBaseDN, false, '', []);

#9 mORMot 2 » SynDBremote on Mormot2 » 2023-06-22 11:48:04

Replies: 1

where I can find Mormot 1 SynDbremote in new Mormot2?
Thanks in advance!

#10 Re: mORMot 1 » Error on BatchSend and Postgres with empty dates. » 2022-07-27 08:39:43

Hi Arnoud,
I use mORMot 2.
When I create an ORM object, and assign some fields but I don't assign that date field (TDateTime).
(It seems it have value of 0 (30/12/1899) )
The statement in Postgres have an exception on a empty string value.
The problem is only present on RestServerDb.BatchSend(tmpBatch) with multirecords updates.
Thanks in advance

#11 mORMot 1 » Error on BatchSend and Postgres with empty dates. » 2022-07-26 11:08:23

Replies: 2

I have a DB error on PostgreSQL using RestServerDb.BatchSend(tmpBatch) on inserts or updates.
The problem occurs when I add or update almost 2 records and a date field is empty.
Infact BatchSend send an empty string to a Db date field, generating the error.
It seems that the batch routine on multi updates fails to assign the empty date sending an empty string.
It's true or am I doing something wrong?
Thanks in advance!

#12 Re: mORMot 1 » TORM: Problem... too many fields... » 2022-05-27 14:15:37

Ok, I will try.
I'm only missing a "Map" function for change "text" into  "json" when field is variant on a table creation. Or a way for "force" it. Please tell me a direction.
Embedding some big tables, big only on number of fields, included within a master record, can be a better solution with "destructured" data forms, but I need to change "TEXT" to Json, so we are sure to use SQL also on embedded json.
Thank you so much for your patience!

#13 Re: mORMot 1 » TORM: Problem... too many fields... » 2022-05-27 11:22:40

Not JsonB, but standard Json "textual". I have changed fieldtype from "TEXT" to "JSON" into table, after createmissingtables, and it seems works on write and on read. JsonB is the best (for index and optimization)  but in the meantime, plain Json can be managed for now.
So, if I can force  map "json" instead "text" on table creation, I think that can use mormot and also DB direct Json features.

Instead, For the external table, how can I map several TOrm classes to the same external PostgreSQL table? There is a MapTable function?
Thanks a lot!

#14 Re: mORMot 1 » TORM: Problem... too many fields... » 2022-05-27 10:31:17

Ok, AB,
we have no choice. :-) Thanks.
But I need those fields to be filterable or searchable on the database anyway. So I thought that using the json functions it is possible to query and extract the data contained in the variant in the "where" clause of the fillprepare or .Execute.
But the variant fields are created as "text", while instead, to be managed directly through Db they must be of type Json. I'm talking about PostgreSql.
Is it possible to force the creation of "Json" fields type instead of "Text" ones for the variant fields of "TOrm"?
Thank you so much!

#15 Re: mORMot 1 » TORM: Problem... too many fields... » 2022-05-26 17:43:55

Uhm... thanks AB.
But, alternatively, if I want to manage a big class with 400 fields IN MEMORY (derived from Torm or another mormot) is possible in some way?
If I use a big Delphi class (in memory) it works without problem (collecting data from multiple tables), but  I would prefer a class derived from mormot to exploit its potential.
Thanks a lot

#16 mORMot 1 » TORM: Problem... too many fields... » 2022-05-26 17:07:01

Replies: 9

Hi All

I have a big problem now on a TORM class: it have 400 fields, so I have a "too many fields" error on create. 256 is the max number.
But italian tax forms have a big number of "simple" fields (not tables) to manage for every Torm.
Any hint for avoid "sharding" of the table in "sub-tables "? This would increase the complexity of managing simple tables but with many fields...
Thanks in advance!

#18 Re: mORMot 1 » TORM: Hhow to exclude a field from generated SQL ? » 2022-05-26 16:50:35


>>  You can try to change TMyOrmClass.OrmProps.SimpleFieldsBits[ooInsert]  and  [ooUpdate].

It seems that it works, from my few tests

Thanks a lot

#19 Re: mORMot 1 » TORM: Hhow to exclude a field from generated SQL ? » 2022-05-19 08:01:29

I don't use client/server but only server (http).
I will try if  "TMyOrmClass.OrmProps.SimpleFieldsBits[ooInsert]  and  [ooUpdate]" works or not.

Thanks a lot!

#20 Re: mORMot 1 » TORM: Hhow to exclude a field from generated SQL ? » 2022-05-18 16:12:10

Hi AB,

thank you;

I have solved with

tmpBits := tmpObj.OrmProps.FieldBitsFromExcludingCsv('field01, field02');

ServerMormot.RestServerDb.Add(tmpObj, tmpBits, true, true);

Thanks a lot;

Question: there is a way for set those TFieldBits "permanently" at ORM level   (for select, insert, update) ?

Thanks in advance!

#21 mORMot 1 » TORM: Hhow to exclude a field from generated SQL ? » 2022-05-17 16:29:53

Replies: 8

Hi All,

I need to exclude an autoinc field from generate SQL that is automatically generate from a DB sequence;
I need to read it in Torm fill but I don't want that is present in insert SQL, because DB generate an error if that fields is already in SQL command.
There is way/directive for exclude a field from INSERT/UPDATE  command, but that is retrieved on query?

Thanks in advance!


#22 mORMot 1 » Mormot 2 - How to return a binary from Torm? » 2022-04-26 17:20:22

Replies: 1

I need to standardize the results from mormot, both when using queries via SQL and when using the ORM with its connection.
With queries via SQL I use an approach similar to the following to return a compact binary format to import to the client as a read-only dataset.
I use TSQLDBConnectionProperties and Sql strings.
function GetBin(AConnection: TSQLDBConnectionProperties; ASql: string): string;
stream: TStream;
stream:  :=  TStringStream.Create;

AConnection.Execute(ASql, []).FetchAllToBinary(tmpStream);
stream.Seek(0, soBeginning);
result := stream.DataString;

Well, it works!

How can I obtain the same result  when using TOrm with TRestServerDB as connection?

Thanks in advance!!!

#24 Re: mORMot 1 » Mormot2 - ID from Postgres Autoinc » 2022-03-03 18:00:14

Hi Ab,
I have read your text, but I don't find EngineAddForcedID in documentation.

I will try to find some information in code.

Thanks a lot

#25 Re: mORMot 1 » Mormot2 - ID from Postgres Autoinc » 2022-03-03 16:52:54

Hi Thanks,
I need this:
ID should not be passed into the sql of the db when making an insert, letting the db assign it autonomously in the rows. Then I get it when I run a query (retrieve, etc) for updates. In practice I ask if it is possible an option not to assign the ID in the add, without querying the db to retrieve the last ID before making insertion (for avoiding conflict on multiapp inserts). Pratically  I'm looking for a way for don't assign ID in SQL insert.

Any help is welcome!
Thanks in advance

#26 mORMot 1 » Mormot2 - ID from Postgres Autoinc » 2022-03-02 18:16:40

Replies: 6

Good evening to all,
I need to  assign the ID value directly in DB from an autoincremental value (ProstgreSQL). Database is shared with other applications.
There is a way for manage correctly the ORM Id so it can be assigned into DB and not as ( Select max id...) into TOrm class?

Thanks in advance!

#28 Re: mORMot 1 » Mormot 2 - RetrieveListJson "compact" features » 2022-01-31 16:45:30

It seems that only  aForceAjax=false by default don't works.
Instead with TRestServer.NoAjaxJson := true it works well. Thanks a lot!

A different serialization:
There is a way for obtain a direct serialization for a  JSON with "[DontStoreVoid]" option for a
IRestOrm.RetrieveDocVariantArray() (or other Retrieve...)? I don't find this capability natively.
Naturally the fastest way possible...

Thanks in advance!

#29 mORMot 1 » Mormot 2 - RetrieveListJson "compact" features » 2022-01-31 10:37:51

Replies: 4

in MOrmot 2, it's possibile to add some options to RetrieveListJson() for "compact" Json result?
I intend similar to the [ToNonExpandedJson] for a packed "CSV" format and [DontStoreVoid] for smaller Json result (alternative of course).
I want obtain best performance possible without convert Json result in TDocVariant with performance penalty, and for response with a compact Json result, where possible.
Thanks a lot!!

#30 mORMot 1 » mORMotMidasVCL for mORMot 2.0 » 2021-10-15 09:36:41

Replies: 4

Hello, is there anyone who has updated mORMotMidasVCL  for Mormot 2.0? It works?
If possible please tell me where I can download updated mORMotMidasVCL.pas for  mORMot 2.0.
Thanks in advance!!

Another: In the old release (1.8) there is an error when SynDbdataset creates string fields, ignoring the default length of the field and setting it to the length of the longest string found. Question: Is the length of the string fields indicated in the header of binary data? If yes, it is not assigned when creating FieldDefs.
Thanks for this spectacular library!

#32 Re: mORMot 1 » SynDBDataset at runtime and Clientdataset at designe time » 2021-05-14 11:05:39

TSynDBdataset (on client) with SynDBRemote is the best and fastest  way to "remotize" SQL. I'm curious to know how many concurrent accesses it could handle, with the direct provider to PostgresQL.
Without touching the ORM world.
Is SynDB not yet available in mormot 2?
The performances are outstanding.

#33 Re: mORMot 1 » SynDBDataset at runtime and Clientdataset at designe time » 2021-05-11 08:08:32

Hi Ab,
but TSynDBDataset have ApplyUpdate method, and works!
SynDBMidasVCL is not part of the framework?
Thanks a lot.

#34 mORMot 1 » SynDBDataset at runtime and Clientdataset at designe time » 2021-05-10 15:07:16

Replies: 6

In a big project I have a lot of  Clientdatasets with a lot of fields linked to editors on forms (complex forms in classic RAD way).
But I like a lot performances of SynDBDataset with remote connections,  and I'm looking for a way for "link"  SynDbDataset created on-fly with the Clientdataset already on forms.
So I can have persistent fields in clientdataset with better remote performances.
Best if I can after post update with a SynDBDataset(clientdataset1).Applyupdates(0).
It's possibile to link RAD world with SyndbDataset performances?
Thanks in advance

#36 Re: mORMot 1 » Contribution: TSynRestDataset » 2017-04-18 16:57:23

Hi Esteban,
I don't understand your answer :-)
I would like to known if TSynRestdataset is multiplatform about Android and Ios (osx), not linux....
Anyway, TsynRestdataset with mormot is almost 2,5 time faster than standard rest client + RestResponseDatasetAdapter + Fdmemtable (with the same mormot server, MongoDb, 100,000 little records fetched in a grid).


#37 Re: mORMot 1 » Contribution: TSynRestDataset » 2017-04-13 14:04:43

Hi Esteban,
is TSynRestdataset multiplatform? I have no tried on Android or iOS...
(I still am still looking for a solution about a strange  "invalid parameter" error on Applyupdates on some pc clients)

#38 Re: mORMot 1 » Contribution: TSynRestDataset » 2017-04-07 14:21:45

Ok, Esteban.
With latest release works.
But I have a "invalid parameter" error on Applyupdates on some pc clients... (other works well...)
What I do wrong? :-)
Thanks in advance;
(wonderful component, the best is if it can be visual in IDE for assign fields to Db components, especially on forms with a lot of editors...)

#39 Re: mORMot 1 » Contribution: TSynRestDataset » 2017-04-06 17:33:30

Ok Esteban,
where I can find latest release? (Maybe I have an old installation...)

#40 Re: mORMot 1 » Contribution: TSynRestDataset » 2017-04-06 17:06:50

Hi Esteban,
SynRestDataset don't works with Mongo at backend?
( I have 404 resource not found....)


#41 mORMot 1 » Fields not persistent in TSQLrecord » 2016-12-30 12:34:37

Replies: 1

there is a way for manage fields that I don't want persist in DB?
I intend some fields present in Tsqlrecord that must not persisted in DB tables, but that can be used in Json serialize and Http trasport;
Simply, a field that is not mapped to DB;
So I can use them for "transport" calculation, additional data in SOA without having those fields into Database.
(.fieldmap('') ??)
Thanks in advance!
(Mormot is a is a real gem, I am discovering it day by day)


#42 mORMot 1 » Custom header on CallBackPut() request ... » 2016-11-29 16:17:42

Replies: 1

how I can add custom headers in a Fclient.CallbackPut ?
I intend to send upload file and chunk information into request header, with (binary and compressed) data into body;
Thanks in advance!

#43 Re: mORMot 1 » HTTP or C/S file server » 2016-11-21 18:46:54

Hi Mpv :-)
Thanks a lot...
I have solved my onDownload/onProgress need; In effect using http.sys server is the best... My need is to use chunks for a very intensive file server, and only with chunks I can manage a lot of request without out of memory, or out of resources;
But... how I can use also chunks in file uploads from Delphi clients?
Thanks in advance!

#44 Re: mORMot 1 » HTTP or C/S file server » 2016-11-17 17:47:45

Hi Thanks,
but how to use ondownload features (or onprogress)  for show a progressbar on client, if I use TSQLRestClient and a remote GETfile service?
How use the  TWinHttpAPI events using TSQLRestClient ?
(I am new to mormot, a fantastic product)
Thanks in advance!

#45 mORMot 1 » HTTP or C/S file server » 2016-11-16 18:47:44

Replies: 4

what's the best and fast way for use mORMot as a remote HTTP File server and C/S file server?
Users must upload/dowload PDF files, using Delphi clients;
I like Restful approach, but I need to use chunks (and compression)...

Any example?

Thanks in advance!

#46 Re: mORMot 1 » ORM and ApplyUpdates » 2016-10-31 13:00:36

I will looking for Adapter properties and methods.
Thanks :-)

#47 Re: mORMot 1 » ORM and ApplyUpdates » 2016-10-31 09:47:36

In few words,
there is a (native) way for known if a TsqlRecord is inserted, modified (or deleted) in an Objectlist (ORM &+ grid in live binding), before using a loop for manage all variation in db with Client.Add(Rec,true), or Client.Update(Rec,true), etc... ?
User must press "Save All" or "Cancel All"...
Thanks a lot,

#48 Re: mORMot 1 » ORM and ApplyUpdates » 2016-10-29 09:45:12

I use Firedac with Firebird as backend... but now I ask about only ORM (TSQLRecord) approach.
I need to Known if there is a way for acquire the client DELTA operations on a Objectlist of Tsqlrecord, so I can apply updates into backend  with batch operation (I like a lot your Mongodb direct implementation).
I want adopt Mormot for all new applications (very powerful and perfect for my needs) and I need to migrate to Tsqlrecord concept, so I can obtain the same result but only with ORM (also on the client) and without datasets, locally or remote (REST).
Thanks in advance for help!

#49 mORMot 1 » ORM and ApplyUpdates » 2016-10-28 19:17:37

Replies: 5

I'm new to mORMot, and I will try the porting of entire dataset solution in a new that use only ORM.
So I use Tobjectlist and live binding for UI.
I want to use your Batch operations on "Save All" operation, but I need a list of objects that are involved in the Applyupdate process. I need New, Updated and Deleted objects to insert in the Batch cycle.
How I can obtain those lists? There is a way with the TSqlRecord  or I must write my own lists?
Thanks in advance!
Sorry for my english... :-)


Board footer

Powered by FluxBB