Hi Martin,
   Thanks for your reply.
    
   You mean to say that I need to modify sqlite3 code to choose which pages 
that need to be copied and copy them myself? Or is there some other API that I 
can use for this purpose? My main problem is I will have huge influx of real 
time data which I want to write first to my memory (because of computation 
efficiency) and later on, back up to the file-db in the background. Also I 
don't have too much memory to spend. So I want to erase the data from in-memory 
as soon as I backup, but I want my data in file-db to be existent. 

   I don't know how ATTACH is going to help my cause. Am I missing something 
here?

Thanks
Raghu


-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Martin.Engelschalk
Sent: Tuesday, December 15, 2009 12:17 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] BACK API Questions

Hello Raghu,

it seems to mee that you misunderstand the backup api. This api does not 
"know" or care for your schema and tables, but backups the database 
block for block. In this sense, the api does not know "old" contents and 
can not add "new" content.
The backup api can not help you in your need. You will have to open both 
the in-memory db and the file dm and copy the data you need to back uop 
yourself before deleting it in the in-memory db.
See the attach-command: http://www.sqlite.org/lang_attach.html

Martin

Raghavendra Thodime schrieb:
> Hi,
>     I am using in-memory db where I will execute only inserts. Periodically, 
> I am trying to backup my in-memory db to file based db. But as soon as I 
> backup, I want to clear up the in-memory db so that I will have enough memory 
> for subsequent inserts. So next time when I back up I want to back up only 
> the newly written records. Is there a simple way to accomplish it? Right now, 
> I can't execute delete on in-memory because it will reflect on file db when I 
> back up which is what I don't want.
>
>   What I tried was, as soon as I back up, I close the current in-memory db 
> and open a new one for the subsequent inserts. But next time when I tried to 
> back up to the same old file db, backup operation is overwriting all the its 
> old contents. Is there a way to append to old DB instead of overwriting?
>
> Help will be appreciated...
>
>  Thank You
> Raghu
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to