----- Original Message ----- From: "Roman Fleysher" <roman.fleys...@einstein.yu.edu>
To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
Sent: Wednesday, June 05, 2013 9:26 PM
Subject: Re: [sqlite] Serialize an in-memory database



Read section on URI Filemanes, particularly mode for memory databases:

http://www.sqlite.org/c3ref/open.html

DB Connection in backup API does not have to point to a file, it can point to in-memory database if URIs are enabled.

(I learned it from someone else on the list, i use SQLite for less than a month.)

Roman

________________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Petite Abeille [petite.abei...@gmail.com]
Sent: Wednesday, June 05, 2013 3:15 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Serialize an in-memory database

On Jun 5, 2013, at 9:10 PM, Philip Bennefall <phi...@blastbay.com> wrote:

Yes, I have seen the backup API. But I would like to avoid the disk file entirely and just serialize to and from memory.

Lateral thinking… write your db to tmpfs…

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Hi Roman,

Oh I know that I can copy content from one in-memory database to another. That's trivial with the backup API. My concern is more that I want to copy it to a blob. In short, the contents that would have been fed to the file - I want that in a memory buffer. I also want to be able to feed that back into SqLite at a later time, probably backing it up to a regular in-memory database again. The malloc vfs is the only solution I can come up with, but it seems overkill. I am hoping there is a cleaner way.

Kind regards,

Philip Bennefall
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to