#1 Re: mORMot 2 » Current Compiler Hints » 2024-05-08 07:42:14

Hi ab,

how is that work coming along?

:-D

#2 mORMot 2 » QuickJS und ServiceContainer » 2024-05-07 13:01:12

sakura
Replies: 4

Hi!

I've asked that before, but in mORMot1 - now, a few years on, I'd like to repeat that question :-D

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

--Daniel

#3 Re: mORMot 2 » woDontStoreVoid and TObjectList » 2024-04-26 06:38:08

Thanks for reconsidering that change. It works perfectly.

#5 mORMot 2 » TDocVariantData.GetValueByPath and Arrays » 2024-04-24 07:52:39

sakura
Replies: 5

GetValueByPath can easily handle a path such as 'Item.0,Name', where the second part is an array index.

However, when starting of an array with, 0.Name would work, if it were not for the check

  if (cardinal(VType) <> DocVariantVType) or
     (not IsObject) then

Changing that to

  if (cardinal(VType) <> DocVariantVType) or
     (not (IsObject or IsArray)) then

it works perfectly.

Regards,
Daniel

#6 Re: mORMot 2 » woDontStoreVoid and TObjectList » 2024-04-24 04:50:50

But it does work perfectly, when woDontStoreVoid is not part of the set. So, why do you write, that it is not possible? Even that part "from JSON". Have used it in other places before - without the woDontStoreVoid Attribute, never had a problem...

P.S.: I use it for places, where I cannot predetermine the type of object, that is going to be encountered. So a T*ObjArray wouldn't work, just a TCollections don't work, as all are tied to a single collection type.

#7 mORMot 2 » woDontStoreVoid and TObjectList » 2024-04-23 10:48:11

sakura
Replies: 4

When streaming an object to Json, using

ObjectToJson(C, [woDontStoreDefault,woRawBlobAsBase64,woDontStoreVoid])

I ran into a problem, when a property is of type TObjectList.

Result: (Contained is published r/w property of type TObjectList:

// [woDontStoreDefault,woRawBlobAsBase64,woDontStoreVoid]
{"One":{"Name":"G"},"ID":42}

// [woDontStoreDefault,woRawBlobAsBase64]
{"One":{"Name":"G"},"ID":42,"Contained":[{"ClassName":"TOne","Name":"W"}]}

As soon as I omit woDontStoreVoid, it'll work just fine.

However, as I am trying to go through TInterfacedObjectFakeRaw.FakeCall -> TInterfacedObjectFake.FakeCallInternalProcess -> TInterfacedObjectFake.FakeCallGetJsonFromStack -> TInterfaceMethodArgument.AddJson (mocking in tests), Icannot control those parameters...

Regards,
Daniel

P.S.: A simple test project for this: https://filetransfer.io/data-package/C20KDkoc#link

#8 mORMot 2 » JsonToNewObject does not set Valid-parameter » 2024-04-15 11:18:52

sakura
Replies: 1

In mormot.core.json we can pass the parameter var Valid: boolean, which is not set upon returning. It should be set as Valid := ctxt.Valid; at the end of the method.

Regards,
Daniel

#9 Re: mORMot 2 » TRttiCustomProp - retrieve Delphi rtti information » 2024-04-15 08:07:02

Sure, but I am needing and using the mormot rtti in that place and simply try to get that attribute list for special cases.

#10 Re: mORMot 2 » TRttiCustomProp - retrieve Delphi rtti information » 2024-04-13 14:20:07

ab wrote:

You have access to the TypeInfo() pointer as in the Value^.Info: PRttiInfo field.

Tried it again, but this gives me the TypeInfo of the property value type.For: Sample writing

Ctxt.GetType(Entry.Value.Info)

for

[MyAttribute]
property XYZ: Integer read FXYZ write FXYZ

it would return the type info for "Integer", which doesn't help. If I would

Ctxt.GetType(Entry.Prop)

, I do get back the correct Delphi Rtti object (of class TRttiInstancePropertyClassic), however, something is off, as I do not get the list of attributes attached to that property.

Strange...
Daniel

#11 Re: mORMot 2 » TRttiCustomProp - retrieve Delphi rtti information » 2024-04-13 10:40:59

That's what I thought, but for some reason I could not get a valid return on my attributes. However, I just had a thought about that - will check tomorrow.

#12 mORMot 2 » TRttiCustomProp - retrieve Delphi rtti information » 2024-04-12 11:51:03

sakura
Replies: 5

When I use mormot.core.rtti and retrieve the properties of a class, each of them is represented by a "TRttiCustomProp" record. Is there a way to access the original Delphi rtti context information?

Reason: I want to check attributes assigned to that specific property. Another way to retrieve them would be appreciated as well ;-)

Regards,
Daniel

#13 Re: mORMot 2 » Commit bf116a0 leads to IPO in Delphi 12 » 2024-03-28 08:02:18

Sorry, couldn't check earlier, but it works as before again. Thanks.

#15 mORMot 2 » Commit bf116a0 leads to IPO in Delphi 12 » 2024-03-26 07:56:03

sakura
Replies: 5

Hi,

this change leads to an IPO in Delphi 12:
https://github.com/synopse/mORMot2/comm … e4356bc106

If I followed correctly, this leads Delphi to release the same memory twice.

I assign the text generated by GetAsText to a specific entry of a string array, and when that array is freed later on, I get the following error:

    "EInvalidPointer": {
      "ClassName": "EInvalidPointer",
      "Address": "7f0972d0",
      "Message": "Invalid pointer operation"
    }

Reverting that code into the previous version, everything works fine.

Regards,
Daniel

#16 mORMot 2 » Current Compiler Hints » 2024-03-18 09:24:19

sakura
Replies: 3

Good morning,

just pulled the latest changes, and found a little group of compiler hints.

[dcc32 Hint] mormot.net.async.pas(4727): H2077 Value assigned to 'forced' never used
[dcc32 Hint] mormot.net.async.pas(4730): H2077 Value assigned to 'forced' never used
[dcc32 Hint] mormot.net.async.pas(4733): H2077 Value assigned to 'ignored' never used
[dcc32 Hint] mormot.net.async.pas(4736): H2077 Value assigned to 'ignored' never used
[dcc32 Hint] mormot.net.async.pas(4724): H2077 Value assigned to 'ignored' never used
[dcc32 Hint] mormot.net.async.pas(4723): H2077 Value assigned to 'forced' never used

And the hints are correct ;-)

Regards,
Daniel

#17 Re: mORMot 2 » RFC 9239 Update » 2024-03-01 11:42:40

Thanks, you've been quick :-)

#18 mORMot 2 » RFC 9239 Update » 2024-03-01 10:25:02

sakura
Replies: 1

Hi arnaud,

I have created a pull request for RFC 9239 changes to e considered.

https://github.com/synopse/mORMot2/pull/242

Two changes according to RFC 9239

  • "text/javascript" as mime content type for JS-files, "application/javascript" is defined as obsolete

  • MJS-filetype to be handled like JS-filetype

https://datatracker.ietf.org/doc/html/rfc9239
https://www.rfc-editor.org/rfc/rfc9239

Regards,
Daniel

#19 Re: mORMot 2 » ObjArrayAdd mormot.core.base vs mormot.core.os » 2024-02-23 10:19:27

I've checked through, there are not to many instances. I could create a pull request of the relevant places I've found, however, more may exist.

#20 mORMot 2 » ObjArrayAdd mormot.core.base vs mormot.core.os » 2024-02-23 10:13:26

sakura
Replies: 1

Hi,

in mormot.core.os is a method ObjArrayAdd with different params, than in mormot.core.base.
When both units are referenced, Delphi cannot find the correct version to call.
For example in mormot.core.unicode and mormot.core.rtti the compiler stops, only when prefixing them with mormot.core.base the compiler will find the correct one.
I am sure more instances would occur, when I look further.

Regards,
Daniel

PS: Current commit on github

#22 mORMot 2 » Changes in TJsonSaveContext » 2023-11-24 07:25:03

sakura
Replies: 2

Hi Arnaud,

it's been a while that I had a chance to update my local mORMot2 rep, as another project attacked my (not so) well laid out time table.

Anyway, one change, that grabbed my be surprise, is the use of records with methods, rather than the previous object approach. In mormot.core.json defines the TJsonSaveContext. In our project, I have created my own version of the (previously) object, and could, through a helper object, easily access the fields

    W: TJsonWriter;
    Options: TTextWriterWriteObjectOptions;
    Info: TRttiCustom;
    Prop: PRttiCustomProp;

to implement very specific sub cases. I do propose making those fields public, please :-)

Regards,
Daniel

#23 Re: mORMot 2 » Away From Keyboard for 2 Weeks » 2023-05-30 04:38:36

Well deserved. Enjoy and relax and refill!

#24 Re: mORMot 2 » Delphi 11.2 problem with debugger in win64 with mormot2 » 2023-02-14 07:20:16

I can't reproduce that problem either, do it almost daily with "just the normal problems" of the Delphi debugger.

#25 Re: mORMot 2 » EAccessViolation at TUriTreeNode.RewriteUri » 2023-02-09 10:12:33

Just checked, definitely not and I have not used the TUriRouter either.

Regards,
Daniel

#26 Re: mORMot 2 » EAccessViolation at TUriTreeNode.RewriteUri » 2023-02-09 09:50:58

Hi,

only came once at this point, at startup. No calls to the server at this point. And sadly, I cannot reproduce it al atm.

Regards,
Daniel

#27 mORMot 2 » EAccessViolation at TUriTreeNode.RewriteUri » 2023-02-09 05:16:21

sakura
Replies: 4

Today I got the following AV:

20230209 05111254 00000000AD4F394E  & EXCOS EAccessViolation (c0000005) [] at cc2926 
  mORMot.Net.Server.pas TUriTreeNode.RewriteUri (1729)  
  mormot.core.os.windows.inc GetModuleHandle (394) 
  mormot.core.os.windows.inc GetModuleHandle (394) 
  System.pas TMonitor.RemoveWaiter (20266) 
  System.Classes.pas ResetSyncEvent (15692) 
  System.pas @InitResStringImports (24792)

It happened only once with yesterdays mORMot2 sources. I cannot reproduce or give any hints as to when or why that happend. I simply started a mORMot-server and the AV happened. Restarting the server was without any problems.

I'll keep my eyes peeled, but wanted to put it out here in case anyone sees somethings similar or has any idea.

Sorry for being vague, but I can't tell more at this time :-(

Regards,
Daniel

#29 mORMot 2 » Please add TSynAutoCreateFieldsClass definition » 2023-02-06 10:55:48

sakura
Replies: 1

It would help in many cases to have the simple declaration of

TSynAutoCreateFieldsClass = class of TSynAutoCreateFields

in mormot.core.json, thus freeing us from declaring it elsewhere :-)

Thanks,
Daniel

#31 Re: mORMot 2 » delphi compilation error after xxxxxxxxxxxxx » 2023-01-26 12:33:57

I have the same error message, you mark value as Pointer, but SortFind expects TOrmCacheEntryValueDynArray, which value is already.

#33 mORMot 2 » Unknown Identifier: rkGetIntegerPropTypes » 2023-01-18 10:04:03

sakura
Replies: 1

Hi,

in the current drop in mormot.core.data -> IniToObject
at line 4421 you reference rkGetIntegerPropTypes

Delphi 11 does not know this one.

Regards,
Daniel

#34 Re: mORMot 2 » mORMot 2 Release Candidate » 2023-01-12 14:39:21

Hi Arnaud,

in mormot.db.core, you define _ENDCLAUSE (line 2410) with different options, suche as left, right, ..., how about adding WHERE itself? Would make it easier, when we build a where clause, that could be used in different contexts.

Regards,
Daniel

#36 Re: mORMot 1 » High-performance frameworks » 2022-12-16 05:54:01

Leads to a compiler error atm.

When using {$ifdef USE_WINIOCP}, in mormot.core.thread, line 3216 you call fSafe.Init, which is not defined for USE_WINIOCP.

#38 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?

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

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

#41 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

#42 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

#43 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

#44 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.

#45 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

#46 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.

#47 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.

#48 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

#49 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.

#50 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

Board footer

Powered by FluxBB