Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Build Status Scrutinizer Code Quality

This library aims to reduce the number of method calls and promote a fast way of building query using Doctrine DBAL wrapper class, without breaking any DBAL implementation. It was inspired by NotORM.

Instalation

The recommended way to install is through Composer:

composer require abdala/reduce-database

Usage

Only set Reduce\Db\Connection as wrapperClass and that's it, you can start use it.

$db = Doctrine\DBAL\DriverManager::getConnection([
    'driver'       => 'pdo_sqlite',
    'global'       => array('memory' => true),
    'wrapperClass' => 'Reduce\Db\Connection'
]);

Select

$db->tableName(); //SELECT * FROM tableName

Where

$db->tableName[3]; //SELECT * FROM tableName WHERE id = ?
$db->tableName('name', 'Jose'); //SELECT * FROM tableName WHERE name = ?
$db->tableName('id > ?', 3); //SELECT * FROM tableName WHERE id > ?
$db->tableName([
    'name' => 'Jose', 
    'id > ?' => 3
]); //SELECT * FROM tableName WHERE name = ? AND id > ?

Tests

To run the test suite, you need Composer and PHPUnit:

./vendor/bin/phpunit

Contributing

Contributions are always welcome, please have a look at our issues to see if there's something you could help with.

License

Reduce Database is licensed under MIT license.

About

Doctrine DBAL Connection Wrapper

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.