dal is data abstraction library written in PHP. It's lightweight (half a dozen classes) and fast. It is inspired by Doctrine
//example
$q = \hatwebtech\dal\DAL::query()
->select('u.id, u.name')
->from('User u')
->where('u.id =?', 7)
;
dal works with PHP 5.3 or later.
The recommended way to install HATwebtech DAL is through Composer. Just create a composer.json
file and run the php composer.phar install
command to install it:
{
"require": {
"hatwebtech/dal": "dev-master"
}
}
$dsn = 'pgsql:dbname=example_db;host=127.0.0.1';
$dbh = new PDO($dsn', 'postgres', 'pass123');
\hatwebtech\dal\DAL::setDbh($dbh);
\hatwebtech\dal\DAL::setTablePath(APPPATH . 'tables/');
\hatwebtech\dal\DAL::setTableNamespace('\\dal_test\\tables\\');
coming soon...
If you discover any bugs, feel free to create an issue on GitHub fork and send us a pull request.
- only Postgres DB is supported for now, MySQL coming soon
- implement groupBy() in Hat Dal Query class.
- implement having() in Hat Dal Query class.
- implement innerJoin() in Hat Dal Query class.
- implement validators (date, string leingth...).
- reduce memory footprint
- Panajotis Zamos (https://github.com/panos-zamos)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Apache 2.0