php-crud-api
php-crud-api copied to clipboard
Create a record with compressed values
Hi, I used COMPRESS function of MySQL to store compressed strings in mysql db. Is it possible to post a string with "POST /records/posts" command and store some field compressed with MySQL COMPRESS command?
Hi,
Thank you for creating this issue. Unfortunately there is no support for reading/writing compressed strings in the software.
A workaround: Reading and writing binary data is supported (using base64 strings). The MySQL COMPRESS function uses zlib, so you could compress/decompress outside the API. You could for instance try to write middleware that reads/writes zlib data to specific fields. If you put enough effort in it, this should be possible.
Kind regards, Maurits
Thanks Maurits, your middleware idea is great! I'll try this. Thanks again!
Regards, coolbq