in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Compression of data

Last post 06-21-2007 8:43 AM by Robert Simpson. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-07-2007 5:40 AM

    Compression of data

    I have a 4mb database that I am using on a Pocket PC Application using SQL lite and VS Studio 2005. Does SQLite contain any ability to compress its data? This 4MB file could easily compress down to about 1MB, and for a pocket pc app, space is always at a premium.

    Does SQLite support compression? Is there a way to reduce the file size?



  • 06-19-2007 9:38 AM In reply to

    Re: Compression of data

    For compressing columns like that I recommend a user-defined function.  You could easily implement  INFLATE() and DEFLATE() functions which could call SharpZipLib or something.

    SQLite 3.4.0 also introduced the concept of streaming blobs, which will make this even cooler as soon as I get it incorporated into the .NET library.

    Robert

     

  • 06-21-2007 5:22 AM In reply to

    Re: Compression of data

    Thank you for your answer, I assumed as much. I guess I want the best of both worlds, the ability to search into a column and have it be compressed :-)

    Is it possible to use user-defined funciton with SQLite and .NET? I did not know this was possible.If so, where can I look to learn more?
  • 06-21-2007 8:43 AM In reply to

    Re: Compression of data

    Download the source distribution and look in the Test project.  Inside TestCases.cs are several user-defined functions and you can see they are quite simple.

    More examples (found by searching the forums):

    http://sqlite.phxsoftware.com/forums/post/418.aspx

    http://sqlite.phxsoftware.com/forums/post/1457.aspx

    http://sqlite.phxsoftware.com/forums/thread/2447.aspx

    http://sqlite.phxsoftware.com/forums/post/2657.aspx

     

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems