#1 2015-01-25 08:49:19

toolater
Member
Registered: 2015-01-25
Posts: 7

Sqlite engine local mode.

Hi,
I need a easy sqlite engine for my delphi little project.
So I search google  and found your mOrMot+ sqlite components
It contain some examples ,very powerful ,far more then I expect. but most of them are in server-client mode.
except  01 - In Memory ORM.
I love it , because I can using it without sql grammar
I  have some questions about using mOrMot sqlite component , not in server-client mode.


1. TSQLRestStorageInMemory always in memory mode, so it can not load large data.
2.How to search mutil-items ,
   example Rec := TSQLSampleRecord.Create(Database,'Name=?',[StringToUTF8(NameEdit.Text)]);
   only return one item;
3.How to update and delete item.
4.Many tables in one database;

Can you provide more examples?
thank you very much.

Last edited by toolater (2015-01-25 08:51:32)

Offline

#2 2015-01-25 12:12:47

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

Re: Sqlite engine local mode.

1. This class was designed for fast in-memory storage, with file persistence, of not large data. But I guess 1,000,000 rows of simple data would be handled without any issue.
If you create an index on a property, a search by value will use hashing so will be very fast.

2. You have to use CreateAndFillPrepare().
Please see the doc - http://synopse.info/files/html/Synopse% … l#TITLE_58

3. TSQLRest.Add / TSQLRest.Update

4. Use a TSQLModel.
All this is documented in http://synopse.info/files/html/Synopse% … tml#TITL_3

For a local application, just use TSQLRestServerDB as TSQLRest class, or TSQLRestClientDB, which allows to change later on easily into a client-server.
The TSQLRest classes would have a very small overhead, and would in fact in some cases achieve better performance than row SQL, e.g. in BATCH mode.

Offline

#3 2015-01-26 02:55:10

toolater
Member
Registered: 2015-01-25
Posts: 7

Re: Sqlite engine local mode.

1. If in memory storage  ,can I write data on harddisc during the processing? the example write data on disc after  closed the application.

Offline

#4 2015-01-26 03:09:14

toolater
Member
Registered: 2015-01-25
Posts: 7

Re: Sqlite engine local mode.

toolater wrote:

1. If in memory storage  ,can I write data on harddisc during the processing? the example write data on disc after  closed the application.

Forget it , I decide to try TSQLRestServerDB or TSQLRestClientDB.

Offline

#5 2015-01-26 04:28:08

toolater
Member
Registered: 2015-01-25
Posts: 7

Re: Sqlite engine local mode.

I download http://synopse.info/files/mORMotNightlyBuild.zip

and open example Samples\04 - HTTP Client-Server
compile  Project04Server ,

execute the code  'DB.CreateMissingTables;' ,  I got the error  . 'accesss violation at 0x00406x96.'

I have delphi xe5 installed ,and sqlite.dll  win32-x86-3080801 version under the exe folder.

Last edited by toolater (2015-01-26 04:30:31)

Offline

#6 2015-01-26 09:39:02

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

Re: Sqlite engine local mode.

The dll is not needed for Win32 (only for Win64).
You should use the latest .obj files for static linking.

I just tried sample Project04Server with XE7, and it works as expected here.

Are you sure you downloaded the latest .obj as explained by http://synopse.info/files/html/Synopse% … l#TITL_113

If you want to run it for win64, ensure you downloaded the 64 bit SQlite3 library as stated by our doc.
The dll supplied on sqlite3.org is for Win32 only.

Offline

#7 2015-01-26 12:14:06

toolater
Member
Registered: 2015-01-25
Posts: 7

Re: Sqlite engine local mode.

It works ,thank you.

Offline

Board footer

Powered by FluxBB