#51 Re: mORMot 1 » IRestOrm - Retrieve Error Information » 2022-11-07 09:29:54

No one else wondering what the last error has been? How do you retrieve it, when using IRestOrm interface?

#53 Re: mORMot 1 » QuickJS und ServiceContainer » 2022-10-21 10:48:50

Well, happens. Would be nice to see it someday :-)

#54 mORMot 1 » QuickJS und ServiceContainer » 2022-10-21 08:57:49

sakura
Replies: 2

Hi!

Is there already a way to grant access to registered factories to QuickJS scripts?

--Daniel

#55 mORMot 1 » IRestOrm - Retrieve Error Information » 2022-10-19 14:29:01

sakura
Replies: 2

Hi,

when using IRestOrm (mORMot2) and running into an error, it would be nice to get access to the error code returned by the sql engine.
Internally it runs TSqlRequest.Step and that raises an ESqlite3Exception, but the user of IRestOrm cannot get any details on the error occured.

Is there a way to access those information for possible internal handling of such situations.

Regards,
Daniel

#56 Re: mORMot 1 » SetPropsFromText and TArray<...> » 2022-09-26 06:36:08

While this part works now, I have noticed another small, Delphi specific glitch around that. From the original sample code, I used

Prop.Value.Name

to get the type.
When using TArray it propagate as

TArray<Unitname.Typename.SubTypeName>

Due to including the unit name, FindType will not recognize the Type. Should prop value name be handled specific in that case?

I uploaded example it would generate

SomeStr: UTF8String;Fail:TArray<Decl.TPpCallSecurityRight>;

<-- note the Decl.

Regards,
Daniel

#57 Re: mORMot 1 » Project opens in full window and cannot resize » 2022-09-26 04:05:30

The question remains, what project are you talking about? All mormot demos work normal, not as described. Simply reset your repo to the one distributed.

#58 Re: mORMot 1 » SetPropsFromText and TArray<...> » 2022-09-23 09:13:49

Digging deeper, you call GetNextFieldProp, which in turn only selects alphanumeric and underscores

  while tcIdentifier in tab[P^] do
    inc(P); // go to end of ['_', '0'..'9', 'a'..'z', 'A'..'Z'] chars

Therefore, the <....> part never becomes part of the typename, therefore failing the test in lns 9000+

Regards,
Daniel

#59 Re: mORMot 1 » SetPropsFromText and TArray<...> » 2022-09-23 09:10:05

Checking into it (ln 7900)
alen = 6
aname = 'TArray'

so, Typename does not contain the expected 'TArray<TPpCallSecurityRight>, but simply TArray.

#60 Re: mORMot 1 » SetPropsFromText and TArray<...> » 2022-09-23 09:06:07

Here is a simple sample, breaking with TArray<...>, working with array of ...

https://pastebin.com/JyzF67hN

Enable/Disable lines 14&17 to see difference.

#61 Re: mORMot 1 » SetPropsFromText and TArray<...> » 2022-09-22 14:58:38

Hm, it crashed on me today, I'll give more details tomorrow. Had just shut down my VM. :-D

Thanks,
Daniel

#62 Re: mORMot 1 » Forum Search future does not work » 2022-09-22 09:55:06

radexpol wrote:

I have to wait 30 second to retry all other variations of my search criteria.

Especially, when signed into the forum as known user, yeah, I read you and feel the same.

#63 mORMot 1 » SetPropsFromText and TArray<...> » 2022-09-22 08:57:11

sakura
Replies: 8

Hi,

in Delphi, there is the possibility to declare arrays using TArray<...> rather than array of ..., which has a few advantages.

However, TRttiCustom.SetPropsFromText only handles array of ..., when parsing a string of properties.

When using code such as

  OrigRtti := Rtti.RegisterClass(aOrmClass);
  for var Prop in OrigRtti.Props.List do
      PropText := PropText + ';' + Prop.Name + ':' + Prop.Value.Name;

Prop.Value.Name will return TArray<...> when declared in that way.

Is there a fair chance of getting TRttiCustom.SetPropsFromText to work with TArray<...>, which from a mORMot pov would be the same, as array of ... ?

Regards,
Daniel

#65 mORMot 1 » ZLib Vulnerability » 2022-09-01 08:55:01

sakura
Replies: 2

Hi Arnaud,

not sure this affects mORMot as well, but here we go
https://nvd.nist.gov/vuln/detail/CVE-2022-37434

Regards,
Daniel

#66 Re: mORMot 1 » Fatal Error (Exception External:?) in Interfaced based Services » 2022-08-26 06:27:21

Service Methods shall never leak Exceptions, rather work with return codes. IIRC that is mentioned in the documentation. Thus allowing the framework to optimize for speed. If exceptions may occur in your service method, you are required to use try...except...end to catch those.

#67 Re: mORMot 1 » Using CopyObject always copies arrays without creating copies elements » 2022-08-11 10:41:30

still wondering what copyobject does, if not copy an objects properties...

#68 Re: mORMot 1 » Using CopyObject always copies arrays without creating copies elements » 2022-08-01 12:06:42

Created a sample, explaining what I'd expect from copy object, and what I actually get...

https://pastebin.com/M4h7sWTb

#69 mORMot 1 » Using CopyObject always copies arrays without creating copies elements » 2022-08-01 06:01:02

sakura
Replies: 3

Hi,

not sure, whether it is as-designed, or a bug.

I have a KDD object with published object arrays (all deriving from TSynAutoCreateFields. When creating a copy, using CopyObject from mormot.core.rtti, all properties get copied.

However, for dynarrays, it creates a copy of the array, but not the elements itself.

Internally, it flows from CopyObject -> cf.Props.CopyProperties(pointer(aTo), pointer(aFrom)) -> Value.ValueCopy(Dest + OffsetSet, Source + OffsetGet) -> fCopy(Dest, Source, fCache.Info) [aka mormot.core.rtti. _DynArrayCopy ] -> DynArrayCopy. There it calls Info^.DynArrayItemType(itemsize) to determine the array element type.

In mormot.core.rtti.delphi.inc, this is defined as

function TRttiInfo.DynArrayItemType(out aDataSize: PtrInt): PRttiInfo;
begin
  with GetTypeData(@self)^ do
  begin
    aDataSize := elSize;
    result := pointer(elType);
    if result <> nil then
      result := PPointer(result)^;
  end;
end;

elType seems to be nil always. Defined in Delphi Rtti only for managed arrays, which those seem not to be. However, using

result := pointer(elType2);

will actually return the expected array element type.

So, my question would be, is CopyObject supposed to create copies of the array elements, or just the array itself. If later, the idea of TSynAutoCreateFields breaks, however.
Using Delphi 11 ;-)

Regards,
Daniel

#70 mORMot 1 » SynDBExplorer and mORMot2 » 2022-07-22 09:18:20

sakura
Replies: 0

Has anyone already tried porting the SynDBExplorer to mORMot2?

Regards,
Daniel

#71 Re: mORMot 1 » High-performance frameworks » 2022-07-21 13:07:50

ab wrote:

Let's see where our little rodent will be.:)

<3

#72 Re: mORMot 1 » Documentation as for mORMot 1... » 2022-07-12 07:33:57

Wonderful, thanks a bunch!

--Daniel

#73 Re: mORMot 1 » HtmlEscapeMarkdown output does not match specification » 2022-07-12 07:31:51

The ones mentioned by tbo are standard of almost all. As a well known one, I'd suggest the github md style:
https://docs.github.com/en/get-started/ … ing-syntax

Regards,
Daniel

#74 mORMot 1 » Documentation as for mORMot 1... » 2022-07-11 13:02:16

sakura
Replies: 2

Hi Arnaud,

are there plans to release a compiled doc, as you have for mORMot 1 on https://synopse.info/files/html/Synopse … 01.18.html ?

It's a wonderful way to get new users started :-)

Regards,
Daniel

#76 Re: mORMot 1 » mORMot 2 Release » 2022-06-08 04:55:18

I am not using it on production yet, simply because our product is way away from alpha release. However, in day to day development use and testing, it's running flawless.

However, no haevy duty tests yet, no massive connections, etc. So I should not be taken seriously, when I say: go ahead ;-)

--Daniel

#77 mORMot 1 » Value assigned to 'TAlgoCompress.FileUnCompress' never used » 2022-05-23 05:51:18

sakura
Replies: 1

Hi,

in mormot.core.buffers.pas, line 5660, that hint appears.

Possbily change to

if not StreamUnCompress(S, D, Magic, ForceHash32) then
  exit(False);

Regards,
Daniel

#78 Re: mORMot 1 » what happened to ab? » 2022-05-06 15:23:16

He is fine, just "out of network for a week".

#79 Re: mORMot 1 » TDocVariant.names raise AV » 2022-05-06 09:27:41

This is rather a behavior designed as-is in Delphi. If the DCU timestamp is newer than the timestamp of the PAS file with the same name, the DCU is considered to be correct on compile. Only a rebuild will fix that. This saves compile-time and is sufficing in most cases. This is not a fault of mORMot.

#80 Re: mORMot 1 » Forum search for class names » 2022-04-13 12:04:35

And while were are at it, could the "wait before searching again" be turned down for logged in users?

#81 Re: mORMot 1 » How to setup the TLS version for THttpApiServer? » 2022-04-12 04:46:45

What OS are you using?

TLS 1.2 support comes from the OS, for Windows this support was introduces with Windows 8.1.

Regards,
Daniel

#82 Re: mORMot 1 » Error in mormot.core.buffers » 2022-03-07 07:13:50

Bad compiler message, problem is, that Delphi expects reintroduce; before overload;, not thereafter. Lines 2228 and 2230.

#83 Re: mORMot 1 » Stop the war! » 2022-03-02 06:02:18

Hi Pavlo,

i haven't been online since last week - taking a break from work working on other things. This war has been long in coming and is as insane as it gets. I am ashamed of the sub-par response from Europe and the world as to this aggression. Nowadays all you get is a few sanctions, usually hitting the people, rather than the leaders. Which of them cares not being allowed to fly into Europe - but the honest people are blocked from traveling. And it is certainly no help at all to you as Ukrainians. I just hope politicians finally get their asses up and send some real help to you. Putin ain't stoppin' there...

Regards,
Daniel

#84 Re: mORMot 1 » v1.18.4952 is the best? » 2021-12-10 07:17:40

Pretty much everything, we want automated. As sample (sorry for posting directly, but that makes discussing easier:

type
  [PXDomain, PXDomainSubstitute, PXDomainEasyAccess, PXCrudRW, PXDomainHistoryEnable, PXDomainLink(TPpAddress, 1), PXDomainLink(TPpContactPoint, 1)]
  TPpDoc = class(TPpUser)
    ...
  published
    [PXDomainElement] property EFN: UTF8String read FEFN write FEFN;
    [PXDomainElement] property Birthname: TPpPersonName read FBirthname write FBirthname;
  end;

Our Domains, which the client may work with, look something like that - at the start all of them are analyzed and prepared. The meanig for those attributes are:

  • PXDomain - available for client use

  • PXDomainSubstitute - replaces the parent domain (TPpUser) in all services/calls automatically, thus allowing us creating a base server framework that can be reused for other purposes. This server will be for docs, but the same server/client framework will be implemented for support as well, where the TPpUser might be overridden by TPpSupportMember

  • PXDomainEasyAccess - Allow general functions to be used for streaming/searching/creation/etc for that domain, so that the developers do not have to write some vanilla code for every domain (relies heavily on generics)

  • PXCrudRW - client may read/write, but not delete data

  • PXDomainHistoryEnable - automatically versioning for this record

  • PXDomainLink(TPpAddress, 1), PXDomainLink(TPpContactPoint, 1) - link to other domains, and at least one of each is needed for the record to be valid - no need to declare ORM records for the link tables, or anything. This one line does it all.

PXDomainElement marks elements of the domain, which the client may manipulate, we have many more attributes for validators, constraints, etc.
Thus, the developer simply declares, what he needs, all the validation/transformation/historization/etc. is automated

Similar it is for the MVC routines, the ones available are marked with information as to which input/output parameters, the calls can be marked for access rights, thus the call never gets to them, if the current user misses the rights needed to access them. Call can be marked asynchronous, so that the server automatically spawns a new thread, before the actual MVC call is started, automatically taking their results and sending them out over websockets as they are done, or if those are missing, they will be send piggy back with any next client call made.

  [PXModule('Users', 'Benutzerverwaltung', 'core', nil, True, True)]
  TPpUsersApplication = class(TPpMvcApplication)
    [PXCall('number', TPpUser), PXUserRights(purtUserAdministration)]
    procedure User_Get(const aCtxt: TPpSQLRestServerURIContext);
    ...
  end;

Here you see part of the generic user library access. In our main product, though declared using TPpUser, the call will return a TPpDoc (see above), as this one overrides TPpUser, thus allowing the client to show all Data of TPpDoc, not just TPpUser. This needs no changes to the code of the module, there very same code will be used for our support server and the cloud administration server, each and every time returning different record types, based upon which class actually will manage the users of the system. Input is a single number (record id ;-) ), and the caller needs rights to the user administration, in order to access the call. All is part of the "users" module, part of the "core" system.

And so on, attributes basically allow us to automate almost all mundane tasks of development and we concentrate solely on the business logic. The client (web client completely done in TypeScript) gets all those information from the server and will be able to render the UI based on the rights of the user, modules started, etc. The framework will take about 1 1/2 years t develop, but afterwards we hope to reuse it for many internal projects.

#85 Re: mORMot 1 » v1.18.4952 is the best? » 2021-12-09 20:54:24

edwinsn wrote:

Is the use of [Attributes] a new feature in mORMot 2? That sounds good, ...

Just part of Delphi, the creation and use of them is part of our internal development team.

#86 Re: mORMot 1 » v1.18.4952 is the best? » 2021-12-09 16:09:24

@edwin - I would think it should be possible, depending on the size, it might take a while, but it will be worth it.

However, I have used mORMot1 in my old company, at my current place I've started right out with mORMot2 and have to recreate things from scratch. It is different, but similar that it is, usually, easy enough to adapt my knowledge. We use Delphi, not FPC, because of the [Attributes] which gives me an amazing power to extend mORMot easily even further - and I love it :-) Many things in our new app will be working by simply marking things using attributes, up to replacing whole classes in services with more refined versions.

#87 Re: mORMot 1 » v1.18.4952 is the best? » 2021-12-09 10:57:26

And yes, if you start new projects, go straight to mORMot2, most things are working, and very likely, before you launch new projects with it, it'll have everything you would find in version 1.
We started our new project(s) on mORMot2 and they are coming along wonderfully. (Running Delphi, Windows only)

#88 Re: mORMot 1 » Any estimated release date for Delphi 11 ? » 2021-11-25 20:57:50

william234 wrote:

I read it is up to Delphi 10.3 Rio here:
https://github.com/synopse/mORMot

I use mORMot2, but as mORMot1 is updated regularly too, I believe that is simply an oversight in documentation - I - today - compiled an old project with mORMot1 in Delphi 11 today and it worked just fine.

Give it a run, but look at mORMot2 for future projects wink

#89 Re: mORMot 1 » Any estimated release date for Delphi 11 ? » 2021-11-24 07:26:11

What do you mean - it's out already since quite a few weeks and Patch 1 is out as well.

And mORMot2 can be used with it too.

So what is your question?

#90 mORMot 1 » mORMot2 - Compiler Errors » 2021-11-22 05:25:22

sakura
Replies: 1

Hi,

in mormot.crypt.ecc, the three EccToDer methods use

SetString(result, @der, len);

- using @AnsiChar where PChar is expected resulting in [dcc32 Error] mormot.crypt.ecc.pas(1735): E2008 Incompatible types

Regards,
Daniel

#91 Re: mORMot 1 » Warning in commit 522b564 » 2021-11-04 05:54:47

ab wrote:

Should be fixed now.

Nope, but a simple

const
  DateFileTimeDelta = UInt64(94353120000000000); // from year 1601 to 1899

would fix it - or did you forget to publish your commit?

Regards,
Daniel

#92 Re: mORMot 1 » Delphi 11 - Float to JSON broken » 2021-10-26 20:17:09

I mean, when you define enough digits. Like the one in the sample, 0.434797083333224 - that is precise enough to create the problem, however, 0.43479708 will work just fine.

#93 mORMot 1 » Delphi 11 - Float to JSON broken » 2021-10-26 11:38:24

sakura
Replies: 2

Hi Arnaud,

I believe, that this is a compiler problem, but want to check with you first.

Paste: https://pastebin.com/dzhFBtLv

When running with Delphi 10.4, I get the expected result:

{"Float":0.434797083333224}

When running with Delphi 11, I get invalid JSON:

{"Float":0.4347970833332◄0}

"◄" is Char #11

When changing the method DoubleToJson in mormot.core.text, so that FloatToJsonNan is not called, and simple set

Result := @tmp;

the result is as expected.

Regards,
Daniel

P.S.: It happens only with values, that have larger precision.

#94 Re: mORMot 1 » Json Float handling not easy to understand » 2021-10-26 11:06:20

ab wrote:

Did you search the forum and the documentation?

Both, but did not find it.

The forum search options are sometimes too limited, to find what you are looking for, without having the right keywords. And after five minutes I gave up - mostly due to the 60 second wait time between the searches. That is too long for logged in users ;-)

And the doc is so darn expansive, thanks for that, that sometimes it's just hard to find it.

But yes, I do always try both places BEFORE posting.

Regards,
Daniel

#95 mORMot 1 » Json Float handling not easy to understand » 2021-10-26 10:02:43

sakura
Replies: 9

Paste: https://pastebin.com/SfP4GSJQ

I have a simple object with two extended values.

One, I fill with "Pi", the other with "3.1415".
Next, I convert the object to json, using "ObjectToJson"
The resulting Json, is, as expected:

{"FloatLong":3.14159265358979,"FloatShort":3.1415}

Adding a value to that DocVaraint, named "Pi" with Delphis Pi as content and calling ToJson I get:

{"FloatLong":"3.14159265358979","FloatShort":3.1415,"Pi":3.14159265358979}

I am wondering, why if FloatLong now quoted as string?
FloatShort is output as expected.
Pi is output as expected.

Regards,
Daniel

P.S.: mORMot1 and mORMot2 behave the same.

#98 Re: mORMot 1 » TOrmPropInfoList.IndexByName is broken » 2021-10-22 11:52:49

Hi,

i have simplified the sample, down to three fields:  https://pastebin.com/PZdaCyYC

First line showing field at index 0 (named A)
Second line showing index of field "A" showing -1, expected 0

Regards,
Daniel

P.S.: I believe the problem here results from field "A" having the same start as "AB" and when it first checks for "AB" being in the middle of the ordered list, it does not check for other fields. If I rename the fields for A, B, C, everything works just fine.

#99 mORMot 1 » TOrmPropInfoList.IndexByName is broken » 2021-10-22 11:29:48

sakura
Replies: 3

Hi Arnaud,

with one of your latest commits, the method TOrmPropInfoList.IndexByName is broken, not correctly retrieving the field index.

Sample, which worked perfectly fine three days ago.
I believe the commit "refined TOrmPropInfoList property search" from two days ago broke it.

Sample showing problem: https://pastebin.com/i38U0Y0a
First line showing field at index 0 (named Login)
Second line showing index of field "Login" showing -1, expected 0

Regards,
Daniel

#100 mORMot 1 » Implicit string cast from 'Variant' to 'UTF8String' » 2021-10-21 12:57:15

sakura
Replies: 3

Hi Arnaud,

small thing: [dcc32 Warning] mormot.soa.codegen.pas(1131): W1057 Implicit string cast from 'Variant' to 'UTF8String'
Method: TWrapperContext.AddUnit
Snippet:

  if addAsProperty <> nil then
    _ObjAddPropU('unitName', >>>>> unitName <<<<<, addAsProperty^);

Regards,
Daniel

Board footer

Powered by FluxBB