#51 Re: mORMot 1 » JSON serialization array of array of double » 2021-01-06 21:44:41

macfly wrote:

If you cannot modify the json structure, then you will have another problem with the "type" property, which is a reserved word.

Excuse me if I misunderstood smth. Wouldn't &type work then?

#52 Re: mORMot 1 » Can I use mORMot as a Rest Client Library? » 2020-12-31 23:19:12

I would recommend taking a look at SynCrtSock unit, there are several client classes. I'm using mostly TWinHTTP-based classes for many third-party REST services with different rather complex schemas. But probably the fastest and easiest way might be TSimpleHttpClient.
JSON parsing to object: https://synopse.info/files/html/api-1.1 … ONTOOBJECT

#53 Re: mORMot 1 » mORMot 2 proposal: rename RawUTF8 type to Utf8 ? » 2020-12-31 10:51:24

Eugene Ilyin wrote:

Maybe Kotlin (successor of all Android dev) balance is the best approach?

When using an acronym as part of a declaration name, capitalize it if it consists of two letters (IOStream); capitalize only the first letter if it is longer (XmlFormatter, HttpInputStream).

It is a very nice, solid, and simple rule, I'll definitely take it as basic at least for myself. Thanks for this link/quote smile

#54 Re: mORMot 1 » mORMot 2 proposal: rename RawUTF8 type to Utf8 ? » 2020-12-31 00:18:39

Chaa wrote:

I think that UTF8String is better than UTF8.

I like this suggestion, it seems clearer for understanding for mORMot-newbies from my pov. Although I'm not sure if it will be ok for compatibility (with other libraries including), I would not call myself proficient in this question.

Eugene Ilyin wrote:

I'm very allergic to ab's CamelCase notation to almost all abbreviations, all these...

For me it is completely different - I like this way of abbreviating use in naming smile Maybe it is a matter of taste (I'm just sharing mine), but when I get occasionally the situation with several abbreviations in one name - it is very hard for me to use uppercase only. Something like TJWTRS256 or TUTF8XMLCDATA or whatever else - there are so many abbreviations today. So TSqlRecord (or Orm) seems for me much more convenient than TSQLRecord (or ORM).

#55 Re: mORMot 1 » mORMot 2 proposal: rename RawUTF8 type to Utf8 ? » 2020-12-29 21:22:01

If it is just an opinion collection, I'd vote for Arnaud's proposal. I'm using RawUTF8 widely, therefore from my personal experience:
- RawUTF8 in my code is often confusing for others, who don't know much or know nothing about mORMot (particularly the 'Raw' part, as far as I understand).
- a shorter name is faster to type wink
It is all not critical for sure, but I won't be against such renaming.

#56 Re: mORMot 1 » JWT with RS256, RS384 and RS512 » 2020-12-28 22:11:49

JOSE JWT lib can be also used with TJWTAbstract subclass as an alternative: https://github.com/paolo-rossi/delphi-jose-jwt

#57 Re: mORMot 1 » Batch update based on ID » 2020-12-11 22:04:51

Probably this is the answer to your question:

    // - if not all fields are specified, will reset the cache entry associated
    // with this value, unless ForceCacheUpdate is TRUE
    function Update(Value: TSQLRecord; const CustomFields: TSQLFieldBits=[];
      DoNotAutoComputeFields: boolean=false; ForceCacheUpdate: boolean=false): integer; overload; virtual;

#58 Re: mORMot 1 » Batch update based on ID » 2020-12-11 19:22:32

If I understood it correctly, I guess, you can try smth like (not tested)

LBatch := TSQLRestBatch.Create(YourRestDB, nil, 1000);
LRecord := TSQLYourRecordClass.Create;
LRecord.FieldToUpdate := NewValue;
for i := 0 to IDsCount - 1 do
begin
LRecord.IDValue := IDs[i];
LBatch.Update(LRecord, 'FieldToUpdate');
end;
FreeAndNil(LRecord);
YourRestDB.BatchSend(LBatch);
FreeAndNil(LBatch);

But if it is possible, I would use a direct sql statement for such case, although sometimes it is not the best decision of course.

#59 Re: mORMot 1 » Record too small » 2020-11-30 10:44:21

I guess, the problem was that your first record didn't contain any managed type field: https://synopse.info/forum/viewtopic.ph … 223#p31223

#60 Re: mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-24 22:00:44

macfly wrote:

So I can't imagine a good use of packages - specifically speaking for mormot.

I would not be so strict about packages and mORMot wink 'Classic' ways of using mORMot - probably, but imho it all depends on particular desires.
Sometimes I have to rewrite some parts of mORMot for complex projects. Just the last week we had to create our own TSynAutoCreateFields for supporting generic lists (VMT Autotable cache is a brilliant idea, btw smile thanks Arnaud!). And in the same project we have many other things rebuilt but based on similar technics and mORMot base classes and functions.
If we would imagine that someday I'll want to put those base mORMot only used stuff in packages, and ours in others - why would it be a bad idea? I'm asking not because I'm trying to prove smth - I really would like to understand the danger.

#61 Re: mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-24 19:47:00

I don't know so far smile we haven't seen so far what @Javierus is doing.
As a raw thought: probably it might be useful in the case of having many similar packages (some plugin/module-based project for instance), which are using only a part/parts of mORMot (2.0 is separated properly, as I heard). Now, I'm putting all mORMot in one bpl, if I need so. Having an easy ability to choose specific small packages might be useful, I think. For sure they will not cross with each other in main packages. The problem of updating packages in production (unload-update-load) also might have more options for solving with such an approach.

But I'm speaking from myself. It easily can be that I completely misunderstood @Javierus idea wink Anyway, I always like to see new (for me) approaches and experiences, it expands the freedom of my future choices and brings more ideas.

#62 Re: mORMot 1 » mORMot2: anyone interested on runtime packages? » 2020-11-23 21:49:40

Nice, it is always useful to have such an option to switch to packages

#63 Re: mORMot 1 » Renewal of JWT Token » 2020-09-23 17:47:31

Completely joining all recent remarks. Ideally, it is always better to handle all errors and make it ready for any kind of situation.

#64 Re: mORMot 1 » Renewal of JWT Token » 2020-09-23 14:54:06

fabiovip2019 wrote:

Hi Vitaly, thanks for the reply, I understand your suggestion, but my client is not a TSQLHttpClient but an Asp.net client. How do you think this token renewal policy would work in this scenario?

Sorry, I'm not proficient in Asp.net, can't help much. I would check the client for JWT/OAuth support, some clients might have automatic abilities for token renewal.
So far, in basic, I see only two ways of handling JWT expiration:
1. JWT Issuer/User (your client here) checks the JWT expiration time before request and renews it if needed (generates a new one or requests a new one in case of standalone auth-service).
2. Like @macfly suggested, renewal can happen in case of a token-expiration response from the server. But you'll have to know the error-response structure then, parse/analyze it, and have an ability to retry the same request with another auth-JWT header after renewal.
I prefer the first way - it seems for me faster and clearer.
Probably, somebody else here can suggest another way or/and help you with asp.net client implementation.

#65 Re: mORMot 1 » Renewal of JWT Token » 2020-09-23 13:34:27

ab wrote:

You store the JWT token on the client side, so you can store the expiration date/time too.

Well, it is pretty much the same as I wrote before.

ab wrote:

For setting the JWT, rather use the TSQLRestClientURI.SessionHttpHeader property.

I missed that property. It is useful for customizing headers and perfectly fine for JWT-auth header, thanks! smile
But since we need to use custom URL parameters for that implementation, I think I'll continue using OnEncryptBody for now.

macfly wrote:

Is it safe to renew the token automatically?
In the APIs that I use and implement, the renewal of the Token is the client responsibility.

I'm confused a bit, what can be the need for receiver (server, for instance) to renew the token? Moreover, the validating endpoint might have only public key for validation, so it will not be able to generate new JWT in that case (even if it would be needed). I assumed that the initial question was concerning the JWT issuer, was I wrong?

#66 Re: mORMot 1 » Renewal of JWT Token » 2020-09-23 11:27:19

Yes, but wouldn't it be slightly slower?

And one more question concerning the client-side, if you don't mind.
I had to use TSQLHttpClient.OnEncryptBody event for forming custom headers (incl. bearer JWT) and URL parameters for Every request, but the meaning of OnEncryptBody is a bit another as far as I understand. Is there any better way to do that?

#67 Re: mORMot 1 » Renewal of JWT Token » 2020-09-22 21:33:19

Probably I misunderstood the trouble. Anyway, maybe it will help you.
We have TJWTAbstract-based JWT generating (RS256) for one of TSQLHttpClient-based clients. Time-expiration is stored in a separate variable and before each request it makes a check and renews JWT if needed (TJWTAbstract.Compute) with saving new time-expiration, of course.

#68 Re: mORMot 1 » Connect to Firebird » 2020-08-21 01:13:00

using Zeos trunk 6758, now - no problem with FB 2.5.9 (+ USE_SYNCOMMONS)

#69 Re: mORMot 1 » How do I load a file into the body of a http-request » 2020-08-12 13:59:17

I've looked into thread several times already, but so far I didn't understand the problem you have. I guess others have the same confusion.

Could you specify a particular place, where you have the problem? Reading pdf file, converting to base64, forming 'body', something else?

#70 Re: mORMot 1 » About thread-safety about using TSQLRestBatch with TSQLRestServerDB » 2020-08-10 15:52:46

Vitaly wrote:

upd: just in case - settings we're using (although with other settings it seems working the same): USE_SYNCOMMONS, hard_commit, default tmThreadPool

Sorry for the misleading information. We've found in code that there was tmMainConnection ThreadingMode set.
We need to check it more, but so far with tmThreadPool all seems to work fine. My bad sad

#71 Re: mORMot 1 » About thread-safety about using TSQLRestBatch with TSQLRestServerDB » 2020-08-08 19:33:41

A clarifying question:
Should it work the same thread-safe with BatchSend and parallel CRUD operations (at the same time from other threads) with the same TSQLRestServerDB?
So far it seems that we're getting problems particularly in such situation (Zeos, FB 2.5.9):

20200808 19261957  +            uNextDB.TNextDB(03eed790).EngineBatchSend  inlen=585
20200808 19261957  +                    SynDBZeos.TSQLDBZEOSConnection(020f6610).StartTransaction
20200808 19261957 SQL           SynDBZeos.TSQLDBZEOSStatement(020b76d0) ExecutePrepared 104us select AVTALETEKSTID as ID,AVTALETEKST as AptText from AVTALETEKST where AVTALETEKSTID=55
20200808 19261957 DB            SynDBZeos.TSQLDBZEOSStatement(020b6e10) Prepare 35us select SMSID as ID,SMSId,TLF as PhoneNumber,SMSText,DATO as SMSDate,TID as SMSTime,TimeID from SMSOUTBOX where TimeID=?
20200808 19261957 EXCOS         EExternalException (e06d7363) [TNextHttpSvr 8210/THttpApiSvr] at 7fff427a3e49
20200808 19261957  -                    00.007.439

It highly depends on the load. But if we change everything from TSQLRestBatch.Add/Update/...  to using TSQLRestServerDB.Add/Update/... all goes fine.
Does it mean that we should always choose between using Batches and "direct" CRUD methods to make it safe, or have a separate TSQLRestServerDB instance for working with Batches for example?

upd: just in case - settings we're using (although with other settings it seems working the same): USE_SYNCOMMONS, hard_commit, default tmThreadPool

#73 Re: mORMot 1 » ObjectToJSON and void objects » 2020-06-23 20:23:28

Ok, I made a quick and simple project (please, don't judge strictly), where I could reproduce the same AV: https://pastebin.com/Grkhbmff
It turned out that AV appears with such conditions (at least it seems to me so):
- the variant field is in a nested object;
- the object was formed through JSONToObject;
- initial JSON didn't contain this nested object.

btw, we've got rid of using variant fields already, therefore it shouldn't be a problem anymore for us - just trying to be responsible, because I reported about this AV problem here.

#74 Re: mORMot 1 » ObjectToJSON and void objects » 2020-06-23 18:37:56

ab wrote:

So I tried to not serialize void class instances if woDontStore0 is set.
Please check https://synopse.info/fossil/info/02fd4270fa

Probably we got one problem with the new IsObjectDefaultOrVoid function.
We have several temporary fields (type variant), which are rather complex by the standard - we'll deal with them a bit later.
Anyway, if this variant field was not assigned, I get an AV in ObjectToJSON with woDontStore0:

Project NextFhirParserDemo.exe raised exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'.

AV raises at TPropInfo.IsDefaultOrVoid function:

...
  tkVariant: begin
    p := GetFieldAddr(Instance);
    result := (p<>nil) and VarDataIsEmptyOrNull(p^);             <------ here
  end;
...

Am I missing something? Maybe we shouldn't use a variant type for temporarily handling some complex substructures.

#75 Re: mORMot 1 » ObjectToJSON and void objects » 2020-06-23 08:54:47

Oh, that's really nice, I tested it with a few complex objects only and so far it is working great!
Many thanks, Arnaud! smile

#76 Re: mORMot 1 » ObjectToJSON and void objects » 2020-06-23 06:14:24

Yes, you're right. I'd like to minimize custom serializers (we'll have enough of them in that huge structure of all resources). Besides this avoiding empty objects in resulting JSON will be applied to all resource objects, so a universal decision seems to me preferable.

I followed your suggestion with OnWriteObject event. The only correction (I understand that it was just a typo in your message): to avoid standard object processing it should return True result.
Anyway, it worked! smile

I decided to make some speed comparison tests, here are the results on my PC for the same object: https://pastebin.com/zfm5CxRR
Of course, it all highly depends on the object and class and current PC state (time values are very small), still, OnWriteObject implementation works several times faster than JsonRemoveVoidObjectsAndArrays!
Thank you very much! smile

#77 mORMot 1 » ObjectToJSON and void objects » 2020-06-22 15:17:48

Vitaly
Replies: 10

While making the implementation of FHIR we decided to create a big and rather complex structure of resources with classes, based on TSynAutoCreateFields.
Far not all fields of some resource are filled in practice, therefore ObjectToJSON with just [woHumanReadable] (for better display here) for example might result: https://pastebin.com/LTdPjXDm
Such JSON is rather big and mostly contains useless/empty data. So, I added several more options [woDontStore0, woDontStoreEmptyString, woDontStoreDefault], which allowed to get such a result: https://pastebin.com/DRFM6RFj
It became much shorter, but it still contains void objects. To make it fully shortened I had to create an additional function https://pastebin.com/H5eBs4ys, which allowed me to reach the goal: https://pastebin.com/HcAh8V5D

I tried to find some option (smth like woDontStoreVoidObject) but unfortunately failed. Probably I missed smth and just reinvented the wheel. And I afraid this JsonRemoveVoidObjectsAndArrays might be not so optimized...
Anyway, I'd appreciate it if anyone could share his better way of getting a super-compact ObjectToJSON result.

#78 Re: mORMot 1 » Unserialise array » 2020-06-19 22:54:46

Probably I misunderstand something, but why not use TKonfiguracja directly as a parameter in your service method? I think it will be transmitted as JSON object without any additional action.

#80 Re: mORMot 1 » Error updating TDateTime field in Postgresql database » 2020-06-12 09:22:01

As far as I understood, you have already the needed value in Dokument.data_wystawienia. Then, I guess, if you have Dokument.IDValue set correctly, you can simply do:

ServerDB.Update(Dokument, 'data_wystawienia');

But even with your code, I think, it could work if you used DateToSQL/DateTimeToSQL functions, like:

ServerDB.UpdateField(TDokumentClass(TDokument),TID(ID),'data_wystawienia',DateTimeToSQL(Dokument.data_wystawienia));

#81 Re: mORMot 1 » 10.4 sydney issues » 2020-06-10 08:26:35

I guess, it is not updated, yet. I have the same warning.

#83 mORMot 1 » TDocVariant Add(integer) seems stopped working for Delphi » 2020-06-04 19:11:56

Vitaly
Replies: 2

After recent commit TDocVariant.DoFunction doesn't get to 'Add' Name if the argument is integer. It gets into

if VariantToInteger(variant(Arguments[0]),ndx) then

and then just leaves further else...if... combination. Therefore:

... raised exception class EVariantDispatchError with message 'Variant method calls not supported'.

Maybe it is better to move this if to the end of it?

[Delphi 10.4, Win64]

#85 Re: mORMot 1 » TNullableDateTime field in TSQLRecord » 2020-06-02 13:50:36

ok, will it slow down significantly (or brake smth), if in SynCommons.GetVariantFromJSON procedure instead of

  with TVarData(Value) do begin
    // found no numerical value -> return a string in the expected format
    VType := varString;
    VString := nil; // avoid GPF below when assigning a string variable to VAny
    FastSetString(RawUTF8(VString),JSON,StrLen(JSON));
  end;

will be smth like

  with TVarData(Value) do
    if IsIso8601(JSON, StrLen(JSON)) then begin
      VType := varDate;
      VDate := Iso8601ToDateTimePUTF8Char(JSON, StrLen(JSON));
    end else begin
      // found no numerical value -> return a string in the expected format
      VType := varString;
      VString := nil; // avoid GPF below when assigning a string variable to VAny
      FastSetString(RawUTF8(VString),JSON,StrLen(JSON));
    end;

NullableDateTimeToValue works good then, even with null value.

Maybe my suggestion is not optimized or/and wrongly formatted, but I at least tried...

#86 mORMot 1 » TNullableDateTime field in TSQLRecord » 2020-06-01 16:53:56

Vitaly
Replies: 3

I have the TNullableDateTime field in a TSQLRecord, which is mapped to the TIMESTAMP FB field.
After retrieving a record from DB (FillPrepare and FillOne) I see ISO8601 datetime value from the debugger.
Direct assigning

LLastUpdate := LSQLParty.LastUpdate;

causes runtime conversion error, and

LLastUpdate := NullableDateTimeToValue(LSQLParty.LastUpdate);

also doesn't work, because VType = 256.
Therefore I have to handle it like this

if not NullableDateTimeIsEmptyOrNull(LSQLParty.LastUpdate) then
LLastUpdate := Iso8601ToDateTime(LSQLParty.LastUpdate);

Is this done so by design, or I have misunderstood smth?

[Delphi 10.4, Win64, Zeos r6580, FB 2.5.9]

#88 Re: mORMot 1 » a trouble with TSQLRecord.FillOne/FillRow and FB TIME field » 2020-05-29 17:06:26

Hi Michael! Yes, with [r6577] almost all works fine. Thank you! smile

Could you only make a couple of additional tiny fixes (or it won't compile):

ZDbcMySqlResultSet.pas, line 508. Missing closing bracket. Fixed line:

JSONWriter.AddNoJSONEscape(PUTF8Char(FByteBuffer),9+(4*Ord(jcoMilliseconds in JSONComposeOptions)));

ZDbcOracleResultSet.pas, line 500. Excess closing bracket. Fixed line:

JSONWriter.AddNoJSONEscape(PUTF8Char(fByteBuffer),9);

#89 Re: mORMot 1 » a trouble with TSQLRecord.FillOne/FillRow and FB TIME field » 2020-05-29 11:24:58

ok, probably, I've found the typo in ZDbcFirebirdInterbase.pas (latest Zeos git-master commit, line 1678, TZAbstractInterbaseFirebirdResultSet.ColumnsToJSON procedure):

JSONWriter.AddNoJSONEscape(@FTinyBuffer[0],8+(4*Ord(jcoMilliseconds in JSONComposeOptions))); 

I assume there should be 9 instead of 8: THH:MM:SS.
If I change it to

JSONWriter.AddNoJSONEscape(@FTinyBuffer[0],9+(4*Ord(jcoMilliseconds in JSONComposeOptions))); 

it works fine with USE_SYNCOMMONS

#90 Re: mORMot 1 » a trouble with TSQLRecord.FillOne/FillRow and FB TIME field » 2020-05-29 09:42:42

well, I continued the investigation, and when I got to SynDBZeos.TSQLDBZEOSStatement.ColumnsToJSON procedure, I noticed there

  {$if defined(ZEOS73UP) and defined(USE_SYNCOMMONS)}
  fResultSet.ColumnsToJSON(WR,fJSONComposeOptions);
  {$else}
  ...

And since I have USE_SYNCOMMONS definition in all mORMot+Zeos projects according to @EgonHugeist recommendation, this code is running.
I tried to rebuild the project without USE_SYNCOMMONS, and all worked as intended.
That's why I couldn't find the particular change in mORMot and Zeos repos smile
So, I guess, the problem is somewhere in fResultSet.ColumnsToJSON, which launches with USE_SYNCOMMONS. Does it help somehow, or I should go deeper?

#91 mORMot 1 » a trouble with TSQLRecord.FillOne/FillRow and FB TIME field » 2020-05-29 06:48:57

Vitaly
Replies: 7

[Delphi 10.4/10.3.3, Win64 target, Zeos, FB 2.5.9]

Currently, I have a trouble with one of my old projects, using legacy FB DB and TIME field in a table (TDateTime in TSQLRecord). All worked fine before, but suddenly I noticed, that TSQLRecord.FillOne fills this field with value 0 - always.

I tried to find the commit, where the change has happened in mORMot and Zeos repos, but failed.
Then I tried to debug and found that TSQLPropInfoRTTIDateTime.SetValue retrieves a shortened value, like 'T08:00:0' (without last digit). Therefore it seemed to me that Iso8601ToDateTimePUTF8CharVar counts the result incorrectly (due to highly incorrect SS value).

Is there some bug, or is it something wrong with my code?

#92 Re: mORMot 1 » Serialize record to json ignore field » 2020-05-27 16:21:55

maybe it is not the best way, but if I need to edit json (in a quick-coded way), I usually use TDocVariant. Smth like this:

var
  LRecord: TMyRecord;
  LDocVar: TDocVariantData;
begin
  LRecord.id := '1';
  LRecord.name := '22';
  LRecord.last_name := '333';
  LDocVar.InitFromTypeInfo(LRecord, TypeInfo(TMyRecord), False, []);
  LDocVar.Delete('id');
  Memo1.Text := UTF8ToString(LDocVar.ToJSON);
  ...
{"name":"22","last_name":"333"}

btw, the record is better to be packed, I guess:

In practice, the record types should be defined as packed record, so that low-level access will be easier to manage by the serializers.

#93 Re: mORMot 1 » Disable Quickedit Mode in the command-line Windows 10 / Server 2019 » 2020-05-15 17:33:22

In fact, this feature is useful for me smile I use it sometimes while debugging some long-term operations when I see something happened and want to pause it and read the log immediately.

#94 Re: mORMot 1 » Freeing Record created by CreateCopy w/ TRawUTF8List property cause AV » 2020-05-14 19:18:00

a bit embarrassing but I have to tell that I was avoiding TDocVariant almost always. Just rarely used it for fast getting some value from some JSON.
And now I tried it with several different structures and I must admit that it is useful and rather simple! Of course, so far I'm not sure that I'm using it the best way, but I will get it after some more experience.
I will use it in many places of my projects, thank you for your hints, guys! smile and sorry, @edwinsn, for a kind of offtopic

#96 Re: mORMot 1 » Freeing Record created by CreateCopy w/ TRawUTF8List property cause AV » 2020-05-14 07:24:41

edwinsn wrote:

But when stored in the db, a field of type TRawUTF8DynArray is not in JSON format? Persisting in JSON format is required in my use case.

About a week ago expected the same JSON format of TRawUTF8DynArray field value, but unfortunately didn't get such a result sad Therefore I had to make a quick workaround with the calculated field.

#97 Re: mORMot 1 » Fast MM5 » 2020-05-06 02:04:02

urhen wrote:
Vitaly wrote:

While choosing words like 'bullshit', please, don't forget that in the context you're talking about somebody's job, life business, or hobby.

rofl, that was the biggest trap you could fall in!

what trap? calling somebody's choice (you don't know the real people's situation) 'bullshit' is funny for you? ok, for me it is just an insult and I'm not expecting seeing this here in anybody's direction.
just reminding one rule of this forum:
5. No trolling, advertising, spamming, fundraising, illegal activity, flaming or other personal attacks, be they acrimonious or veiled in humor.

urhen wrote:

Hopefully all people worked/working on/for Delphi are still paid from your Delphi 7 license. *faceplam* Just read point 3 again from johnnysynop.
It just shows the bad mentality of you guys, still using Delphi 7 (= nothing paid for 20 years) and then also demand to use the free mORMot but making money with the product build with it. Typical business mo******** - take everything for free but never give anything back.

what are you talking about at all? Weren't you able to read that I'm using Delphi 10.3? paid Professional version if you worried so much...

urhen wrote:

You should give ab all the money you saved the last 20 years + 1.000.000€ because he is such a fantastic guy who is a real plus for the FPC/Delphi community.

I'm donating to opensource projects when I have such an ability, Synopse is also in this list. If you want free advice: stop "counting" people's money and telling them, how they should work, and how they should spend their money. In all cases, you don't know their life situation and current needs and most likely you'll always be wrong in your suspicions. They are grownups and they can deal with it by themselves. In other cases, you just show your disrespect to them (hope, it is not your purpose, anyway).
I thought Arnaud explained possible situations and his decision for supporting Delphi 7 clearly here. Or you haven't read his reply thoroughly? Then do it, please.

I didn't get the explanation, why having Delphi 7 support in mORMot particularly bothers you so much. Nothing, even tiny technical detail...
Just understand, please. It is not for you, Arnaud decided to make it for others, they are also good people (in spite of any offensive unproved thing you can tell about them). And they are fully-right members of this community. Which, I assume, Arnaud created not for your 'bullshit' and 'mo********' (whatever is hidden there, I don't think that it is pleasant), but for sharing, contribution and supporting each other. I hope, Arnaud will correct me if I'm wrong.

#98 Re: mORMot 1 » Fast MM5 » 2020-05-05 17:56:40

I wonder, why some people here are so obsessed about giving up Delphi 7 support?
I'm using 10.3 and I have no problem with Delphi 7 support in mORMot. Arnaud asked everybody about versions, which they need to be supported in 2.0. He made a decision according to the results of the survey. Does he make you doing something to make it happen? Then what does bother you so much?

While choosing words like 'bullshit', please, don't forget that in the context you're talking about somebody's job, life business, or hobby.

#99 Re: mORMot 1 » AV at BatchSend with Zeos/FB » 2020-03-31 20:41:34

EgonHugeist wrote:

Btw. keep the USE_SYNCOMMONS define. That make the ColumnsToJSON process faster.

Got it, will use it in all projects with mORMot and Zeos.

EgonHugeist wrote:

Just commited a small performance improvement for your situation: https://sourceforge.net/p/zeoslib/code-0/6393/ Hope it helps a bit wink

Already downloaded and tested 6398, all seems fine smile

Many thanks for advising and everything you've done!! smile I think I already can't imagine any of my Delphi/FPC project without mORMot and Zeos big_smile

And sorry for my late messages sometimes in this discussion, all that pre-quarantine troubles...

#100 Re: mORMot 1 » AV at BatchSend with Zeos/FB » 2020-03-31 08:43:27

EgonHugeist wrote:

Why is it possible that users inserting data which your database is NOT able to store.

Strictly saying, this particular service is not for users. It loads (and updates) a huge amount of data from different national services. Most of these services provide UTF8 data. And some of this data (names, mostly) sometimes contains non-ISO8859_1 characters. So, anyway, I have to make a transliteration before posting it to DB. The reason why I'm not doing that: I tested Zeos codepage setting and it worked as needed automatically.

EgonHugeist wrote:

Avoiding this exception by using ISO8859_1 instead of UTF-8 means silent charcter loss. Means all unicode characters which can not be converted silently turn to '?'-questeion-marks. Is that what you want and the user who sends the data expects?

I made a separate test to find how it works (as I did earlier, much time ago). Here is the result:
'ČOAVVÁ ÁDO' name received from the person registry as UTF8. It contains Č, which is not a part of ISO8859_1 encoding. Then mORMot->Zeos->FB and in DB (with ISO8859_1) we have 'COAVVÁ ÁDO', which seems rather good for use in another software, where users work. No question marks or another significant loss.
I do not consider myself as anyhow expert in encodings and stuff. So, any correction from your side is very welcome.

EgonHugeist wrote:

That's neither fast nor a good design.

I understand, that it is slower than with UTF8 only. Probably it is not the best design with such a restriction of using ISO8859_1 FB DB. I'd appreciate any hint for better design, but without converting DB to UTF8. We can't do that, so far at least.

EgonHugeist wrote:

However i strongly recommend not using  ISO8859_1 for your if you can't guarantee all characters are cyrillic encoded

Sorry, this part I couldn't understand even after reading it several times. Could you explain it to me a bit more, please? Why it should be cyrillic encoded? Maybe I'm wrong, but I think that ISO8859_1 (or Latin-1) doesn't support cyrillic characters, and it doesn't make sense in fact: NO_NO collation is for Norwegian language. I'm a bit confused here...

Board footer

Powered by FluxBB