Repository navigation
Trysil 2.1.0 is a minor release on top of 2.0.0.
Install it with the setup program
Download Trysil.Setup.exe and run it with Delphi closed. It finds the Delphi versions installed (10.3 to 13), downloads this release, builds the packages and the IDE Expert, and sets the Trysil variable and the library path of each IDE. It updates and uninstalls Trysil from the installed apps of Windows. The setup is not signed: the first time, SmartScreen asks you to click More info, then Run anyway. Its source is in Trysil.Setup. See the setup guide.
GetIt, Boss and the manual build keep working as before: see the installation guide.
What's new
- OpenAPI: the new
Trysil.OpenAPIpackage generates the OpenAPI 3.1 document of aTTHttpServer<C>and serves it on/openapi.json, schemas and validation constraints included. - Registered entity events:
TTEntityEvents<T>andTTEventRegistrationkeep the business rules out of the entity unit, so a model regenerated by the Expert no longer takes them with it. - Generic CRUD over HTTP:
TTHttpEntityReader<T>andTTHttpEntityWriter<T>carry the standard operations for any entity; your controllers declare the routes and delegate. - HTTP server:
AddBindAddressto choose the listening addresses,Routes,RegisterControllerClass,[TNotSqid], and with Sqids on the HTTP filter reads ids as sqids. - ORM: entities are read through a forward-only dataset, about a third less memory on large reads; eager relations load also when the entity has a read-only
ID;TTLazyList<T>.AddEntityis public;TTFilter.AddWhere, constructors forTTFireDACConnectionParameters, read-only values on the validation attributes,OldEntitynil in the events of an insert. - JSON: four named presets on
TTJSonSerializerConfig; an eager relation goes through JSON and OpenAPI like aTTLazy<T>, key and nested object. - Expert: the entity model wizard writes the rules units too; folders and unit names of rules and controllers are settings.
Before you upgrade
A few changes need attention, each marked Breaking in the changelog:
- the packages are named without the Delphi version:
requires Trysil, Trysil.JSon;instead ofrequires Trysil370, Trysil.JSon370;(the.bplkeeps its name,Trysil370.bpl); - an event class with a constructor of its own takes the operation as third parameter;
- a class derived from
TLengthAttributethat calls theLengthfunction writesSystem.Length; - a routed method whose parameters cannot serve its route is refused at registration;
- the demo translation units are split by package.