#1 2018-07-10 13:20:01

xiwuping
Member
Registered: 2018-02-11
Posts: 32

TSQLRestStorageInMemory, and RestServer

TSQLRestStorageInMemory.Create(
                                                  TSQLSampleRecord,
                                                  nil,
                                                 ChangeFileExt(ExeVersion.ProgramFileName,'.db')
                                             )

The second parameter of the constructor is "nil" -  could someone help me understand - in what cases it should NOT be nil,  and in what cases it should be nil?

Thanks

Offline

#2 2018-07-10 21:13:45

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

Re: TSQLRestStorageInMemory, and RestServer

I suppose you shouldn't use this TSQLRestStorageInMemory stand-alone.

Offline

#3 2018-07-11 01:39:01

xiwuping
Member
Registered: 2018-02-11
Posts: 32

Re: TSQLRestStorageInMemory, and RestServer

but project01 in the samples uses it standalone? the above line of code was taken from the sample code directly

What is the correct way of using it?

Offline

#4 2018-07-11 07:11:49

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

Re: TSQLRestStorageInMemory, and RestServer

This is the server instance using it as storage for a given table.

It is always a good idea to search the documentation before asking here.
https://synopse.info/files/html/Synopse … l#NDX_1535

Offline

#5 2018-07-11 12:43:10

xiwuping
Member
Registered: 2018-02-11
Posts: 32

Re: TSQLRestStorageInMemory, and RestServer

i did, and got lost by the document. It is not beginner friendly.

the PROJECT01 used it standalone, is it the right way to have a fast in memory single table db? What you said made me more confused

Offline

#6 2018-07-11 15:02:04

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

Re: TSQLRestStorageInMemory, and RestServer

Yes, TSQLRestServerFullMemory is the way to create a simple in-memory database.
Even with one table, it is a good idea to inherit from TSQLRestServer not the TSQLRestStorage table-specific class.

Offline

Board footer

Powered by FluxBB