2
I Use This!
Low Activity

News

Analyzed about 16 hours ago. based on code collected 2 days ago.
Posted over 4 years ago by ab
1. Perhaps there are some limitation. Empty values are handled, but I am not sure for not empty record.2. Class fields are not handled properly in records, for sure.This is not a mORMot problem, but a pascal language limitation. You need to call Free ... [More] manually. Use nested classes for properĀ  class lifetime support.3. You need to sub-class the types for custom serialization.I don't know what you expect and want to do.Trying to push the serializer into its border cases is probably not the right way to do what you expect, unless you understand better how it works.What I am sure is that your root goal (change the default serialization of plain Char/TBytes/DateTime/Time/Date) is weird and not a good idea.Existing code will be broken.Possible better ideas:a) Use a custom serializer for a whole record, not simple types.b) Use an in-between record type for serialization of complex content - to be handled like a DTO. [Less]
Posted over 4 years ago by ab
On some compilers - e.g. FPC - length() is slightly faster than high().
Posted over 4 years ago by liam1983
The same way like the jpg?
Posted over 4 years ago by macfly
Another option is to create a TSQLRestRoutingREST to be used by the service and override the ExecuteSOAByInterface method to handle the error. Using this approach, I can send a custom error and messagem on an interface-based service.However, since you want to validate the type of data, it would be best to use method-based services.
Posted over 4 years ago by edwinsn
Good choices! Thanks ab for all your efforts!
Posted over 4 years ago by Milos
Ah I see, good luck
Posted over 4 years ago by macfly
One option is to create a record to store coordinates.type TCoordinate = packed record d1: Double; d2: Double; end; TGeometry = packed record coordinates: array of TCoordinate; AType: RawUTF8; end; const __TCoordinate = 'd1 double d2 ... [More] double'; __TGeometry = 'coordinates array of TCoordinate AType RawUTF8';Register both: TTextWriter.RegisterCustomJSONSerializerFromText([ TypeInfo(TCoordinate), __TCoordinate, TypeInfo(TGeometry), __TGeometry ]); JSON produced:{"coordinates":[{"d1":13.3568,"d2":52.6183},{"d1":0,"d2":52.5581}],"AType":"test"}' [Less]
Posted over 4 years ago by ab
Yesterday, I already fixed some of the issues (5-7 at least).I will look forward to the other points.Thanks a lot for the feedback!It is a very good sign that you find yourself your way into the new source code base!
Posted over 4 years ago by ab
Use ServerDB.WriteLock/WriteUnLock instead of a transaction: on server side, it will be faster and safer.
Posted over 4 years ago by ab
In the "05 - Report" sample there is a bitmap drawn on the document.