konstantinkuklin / doctrine-compressed-fields
Library provide functional to split data from entity to different property by bit mask.
Requires
- php: >=7.0
- doctrine/orm: ~2.4.0|~2.5.0
Requires (Dev)
- phpunit/phpunit: ^5.3|^6.0
This package is not auto-updated.
Last update: 2024-12-28 01:57:13 UTC
README
Doctrine Compressed Fields is a library which is allow to store data from different Entity properties in one column by using bits mask.
DO NOT USE IN PRODUCTION! Developing still in progress.
Motivation
Sometimes we need to store simple boolean value like true or false and we use for it tinyint(1)
which cost is 1 byte(bits).
So we lose 7 bits
on every such value if a column! Just imagine we lose 7k bits(700b = 0.68kb) on each 1k rows with 1 bool
element stored in tinyint(1)
.
Here you can find the solution, how to store data without losing memory and hdd free space.
Installation using composer
Execute in console:
composer require konstantinkuklin/doctrine-compressed-fields
Documentation
- in progress
Running tests
To run the tests, you need the sqlite extension for php. On Unix-like systems, install:
php5-sqlite
On Windows, enable the extension by uncommenting the following lines in php.ini
extension = php_pdo_sqlite.dll
extension = php_sqlite3.dll
extension_dir = ext
Running the tests from the project root:
./vendor/bin/phpunit
On Windows run phpunit from the full path
phpunit