konstantinkuklin/doctrine-compressed-fields

Library provide functional to split data from entity to different property by bit mask.

dev-master 2017-08-30 17:58 UTC

This package is not auto-updated.

Last update: 2024-05-03 22:58:21 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.

Build Status GitHub release Scrutinizer Code Quality Code Coverage Minimum PHP Version License

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