You can easily make a custom type to do that:
import xlib
compressed =
SQLCustomType(
type
='text',
native
='text',
encoder =(lambda x: zlib.compress(x or
'')),
decoder = (lambda x: zlib.decompress(x))
)
db.define_table(
'example',
Field('data',
type=compressed)
)
May need some testing. Let us know.
On May 2, 9:12 pm, Plumo <[email protected]> wrote:
> I am storing large amounts of XML in my database and it would be useful to
> have a field type that automatically compresses when saving and decompresses
> when loading.
> Does such a field already exist?