#1 2018-07-19 21:28:44

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 210

TSQLRestStorage needs a TSQLModel?

The constructor only needs a TSQLRecordClass, which is weird because it then tries to find a model from either TSQLRestServer or generated RTTI, the problem is this can break code if both don't exist. Example is

SQLite3\Samples\01 - In Memory ORM

if you do not create a sample model, as in comment out

///Model := CreateSampleModel;

, when you try to add a record it will throw an exception.

Offline

#2 2018-07-19 21:54:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,203
Website

Re: TSQLRestStorage needs a TSQLModel?

TSQLRestStorage classes are not to be used stand-alone, apart from very simpliest use cases like in sample 01.
And even in this case, you need a TSQLModel, for internal use.

In practice, you need to have a proper TSQLRestServer, therefore a TSQLModel instance, for any serious work.
Even if it has a single table.

Offline

#3 2018-07-20 05:43:56

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 210

Re: TSQLRestStorage needs a TSQLModel?

thx ab, I will swap to TSQLRestServerFullMemory.

Last edited by pvn0 (2018-07-20 06:30:32)

Offline

Board footer

Powered by FluxBB