Re: [sqlite] compressing BLOB

2012-03-02 Thread Stephan Beal
On Fri, Mar 2, 2012 at 12:54 PM, Benoit Mortgat  wrote:

> SQLite does not compress your blob and you will have to do that
> programatically.  However you can define your own with
> sqlite_create_function_v2(): the prototype of your function would be
>

There's an implementation in the fossil source repo:

http://fossil-scm.org/index.html/artifact/41357470cd8b147dcea8c684ed131ebf29643650?ln=53-105

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] compressing BLOB

2012-03-02 Thread Benoit Mortgat
SQLite does not compress your blob and you will have to do that
programatically.  However you can define your own with
sqlite_create_function_v2(): the prototype of your function would be

void compress(sqlite3_context *context, int argc, sqlite3_value **argv)
{
   assert(argc==1);
   void *data = sqlite3_value_blob(argv[0]);
   int nBytes = sqlite3_value_bytes(argv[0]);

   // allocate memory for result
   .
   sqlite3_result_blob(...);
}

On Fri, Mar 2, 2012 at 10:42, Christoph P.U. Kukulies
 wrote:
> Since I'm inserting large files into the DB I'm wondering whether
> Sqlite can do compression on the data BLOB by itself or whether I
> should do that by programming when creating the BLOB?
>
> -- Christoph Kukulies ___
> sqlite-users mailing list sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

-- 
Benoit Mortgat
20, avenue Marcel Paul
69200 VĂ©nissieux, France
+33 6 17 15 41 58
+33 4 27 11 61 23
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users