Re: [sqlite] A memvfs for loading/saving database from buffer

2009-08-02 Thread stephen liu
http://sphivedb.googlecode.com/files/spmemvfs-0.2.src.tar.gz The demo code: typedef struct spmembuffer_t { char * data; int used; int total; } spmembuffer_t; typedef struct spmemvfs_db_t { sqlite3 * handle; spmembuffer_t * mem; } spmemvfs_db_t; void test( spmemvfs_db_t * db

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-05-01 Thread stephen liu
> It also sounds like you are operating in an environment that is almost > entirely reading and with lots of memory. You could still store one Yes. The memvfs requires to entirely reading the database. So this solution is just for something like addressbook application, the data for one user is

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-05-01 Thread stephen liu
http://spserver.googlecode.com/files/spmemvfs-0.1.src.tar.gz Changes: * Modify the save callback, transfer the ownership of the buffer to callback function * Add a buffer map to pass buffer between application and sqlite3 vfs The demo code: static void * load( void * arg, const char * path, int

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 stephen liu wrote: > For addressbook application, it call select_all_address_for_one_user > frequency. > If multipile users' addresses store in one table, the > select_all_address_for_one_user > will cause much I/O operations. If you have an index on

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread stephen liu
> > > > I want to save sqlite database as a entry of the dbm. > > If you really have to store the sqlite databases as blobs, why not store > them in yet another sqlite database as a blob instead of inside dbm? > SQLite has the drawback of not letting you resize a blob (you have to > create a new va

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 stephen liu wrote: > I want to save multipile sqlite database in one file. Generally that is a bad approach and instead you use more tables and normalize your data more. However you know your situation better. > The backup api is not fix for this re

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread stephen liu
I try to implement One SQLite Database Per User. http://stackoverflow.com/questions/128919/extreme-sharding-one-sqlite-database-per-user Extreme Sharding: One SQLite Database Per User 2009/4/29 stephen liu > > I want to save multipile sqlite database in one file. > The backup api is not fix for

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread stephen liu
I want to save multipile sqlite database in one file. The backup api is not fix for this requirement. I want to save sqlite database as a entry of the dbm. For example, the user's addressbook save in a sqlite database, and the buffer of the database may be store in a dbm. 2009/4/29 Roger Binns

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread stephen liu
The mailing list strips out attachments. Please download from: http://spserver.googlecode.com/files/spmemvfs.tar.gz 2009/4/29 Virgilio Alexandre Fornazin > Where we can get the code ? > > ___

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread Virgilio Alexandre Fornazin
Where we can get the code ? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of stephen liu Sent: terça-feira, 28 de abril de 2009 22:24 To: sqlite-users@sqlite.org Subject: [sqlite] A memvfs for loading/saving database from

Re: [sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread Roger Binns
stephen liu wrote: > The attachment is a memvfs implementation for sqlite. The mailing list strips out attachments. > With the memvfs, we can loading/saving sqlite database from buffer. Even simpler, you can use sqlite3_backup API to copy from a disk to :memory: and the reverse direction when yo

[sqlite] A memvfs for loading/saving database from buffer

2009-04-28 Thread stephen liu
Hi, The attachment is a memvfs implementation for sqlite. With the memvfs, we can loading/saving sqlite database from buffer. There also includes a demo to show how to use it. Cheers, Stephen Liu ___ sqlite-users mailing list sqlite-users@sqlite.org