Download the PHP package ridaamirini/phpquerybuilder without Composer
On this page you can find all versions of the php package ridaamirini/phpquerybuilder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ridaamirini/phpquerybuilder
More information about ridaamirini/phpquerybuilder
Files in ridaamirini/phpquerybuilder
Package phpquerybuilder
Short Description An fast, small SQL Builder based on FluentPDO
License MIT
Informations about the package phpquerybuilder
PHPQueryBuilder
An fast, small SQL Builder based on FluentPDO
Features
- Simply create queries step by step
- Smart join builder
- Build SELECT, INSERT, UPDATE & DELETE queries
- Small and fast
- Type hinting with code completion in smart IDEs
- Requires PHP 7.0+
- PHP 5.6+ compatibility coming soon
Install
Composer
Add in your composer.json
:
"require": {
...
"ridaamirini/phpquerybuilder": "^0.1.1"
}
then update your dependencies with composer update
.
OR
For the latest dev version
composer require ridaamirini/phpquerybuilder:dev-master
Start usage
PHPQueryBuilder is easy to use:
output query is:
Smart join builder (how to build queries)
If you want to join table you can use full sql join syntax. For example we would like to show list of articles with author name:
It was not so much smart, was it? ;-) If your database uses convention for primary and foreign key names, you can write only:
Smarter? May be. but best practice how to write joins is not to write any joins ;-)
All three commands create same query:
Simple CRUD Query Examples
SELECT
INSERT
UPDATE
DELETE
CRUD QueryCollection Examples and PHPQueryBuilder CLI
Init config file
$ vendor/bin/phpqb init
Insert your values (phpqb.json)
Run with config file
$ vendor/bin/phpqb dump
OR
$ vendor/bin/phpqb dump --config
Run with path
$ vendor/bin/phpqb dump --collection /path/to/collection.php > collection.sql
OR
$ vendor/bin/phpqb dump -c /path/to/collection.php --filename /path/to/output/output.sql
Example File
TODO
- [ ] Standalone QueryBuilder wihtout FluentPDO
- [ ] PHP 5.6+ compatibility
- [ ] phpqb.json JSON lint
- [X] Command phpqb dump -c ... -f allow directory
- [ ] Add Unit Tests
- [x] First release
Licence
All versions of phpquerybuilder with dependencies
fpdo/fluentpdo Version 1.1.*
symfony/console Version 3.3.8
mockery/mockery Version 0.9.9