You are not logged in.
Pages: 1
Can RemoteDataCreate be used with TRestServerFullMemory, e.g. TRestServerFullMemory to use Auth tables from a TRestServerDB?
From docs it sounds like this is intended for a TRestServerDB to use tables from another TRestServerDB, but I'm not entirely sure. It does compile with TRestServerFullMemory though...
Offline
Offline
Not sure if I understand the word "export". Is it possible for a TRestServerFullMemory to use the Auth tables of a TRestServerDB instance?
If I try following code:
TPublicServer = class(TRestServerFullMemory)...
TDBServer = class(TRestServerDB)...
function CreateSampleModel: TOrmModel;
begin
result := TOrmModel.Create([TOrmSample, TAuthGroup, TAuthUser,
TOrmNote, TOrmNotebook]);
end;
// create servers
Model := CreateSampleModel;
DBServer := TDBServer.Create(Model,
ChangeFileExt(Executable.ProgramFileName, '.db'));
DBServer.db.Synchronous := smOff;
DBServer.db.LockingMode := lmNormal; //lmExclusive;
DBServer.server.CreateMissingTables;
PublicServer := TPublicServer.CreateWithOwnModel(
[TAuthGroup, TAuthUser], True
);
PublicServer.Server.RemoteDataCreate(TAuthUser, DBServer.OrmInstance);
I get error: Exception class ERestStorage with message 'Duplicated TRestOrmServerFullMemory.RemoteDataCreate(TAuthUser) as TRestStorageInMemory'.
With TRestServerFullMemory, as far as I can tell, there is no way for me to delay creation of external tables until after call to RemoteDataCreate..
Offline
Now I understand.
A TRestServerFullMemory is a ... TRestServer in Full Memory. As its name states.
That is, all its tables are in-memory tables.
You can then assign a redirection via RemoteDataCreate() to any of those tables, which are already internal.
What you can do is define a TRestServerDB, then define some tables as in-memory statics tables, and some other as RemoteDataCreate.
Offline
Pages: 1