Download the PHP package abdulelahragih/querybuilder without Composer
On this page you can find all versions of the php package abdulelahragih/querybuilder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download abdulelahragih/querybuilder
More information about abdulelahragih/querybuilder
Files in abdulelahragih/querybuilder
Package querybuilder
Short Description Fast, lightweight and simple SQL query builder that does not depend on any third-party library besides PDO to execute the queries in a safe way. The syntax is inspired by Laravel Query Builder.
License GPL-3.0-only
Informations about the package querybuilder
QueryBuilder
Fast, lightweight, and simple SQL query builder that does not depend on any third-party library besides PDO to execute the queries in a safe way. The syntax is inspired by Laravel Query Builder.
Important
Do not use it in production as it is still in beta and many public APIs might change.
Features
- Internal bindings manager, so you do not have to worry about binding your values.
- Support adding multiple and nested conditions to the Where and the Join clauses.
- Support Pagination.
Installation
The recommended way to install the QueryBuilder is through Composer.
Basic Usage
To start using it you have to first create an instance of the QueryBuilder:
Select with pagination
You can either use the paginate
method or the simplePaginate
method.
paginate
will return a LengthAwarePaginator
instance which contains the total number of items, the current page, the number of items per page, the total number of pages, and the number of next and previous pages.
simplePaginate
will return a Paginator
instance which contains the current page, the number of items per page, and the number of next and previous pages.
Nested Where
You can add nested conditions to the Where clause by passing a closure to the where
method.
Nested Join
You can add nested conditions to the Join clause by passing a closure to the join
method.
TODOs
- [x]
Support Update, Delete, Insert - [ ] Support Creating Schemas
- [x]
Add pluck method - [ ] Add support for sub-queries inside the Where and Join clauses
- [x]
Implement a Collection class and make it the return type of get() - [ ] Add a
returning
method to the query allowing you to return columns of inserted/updated row(s) - [ ] Add support for different types of databases and refactor code, so it is easy to do so
- [x]
Add support for Transactions
Contribution
Any contribution to make this project better is welcome
All versions of querybuilder with dependencies
ext-pdo Version *