Releases: co0lc0der/simple-query-builder-php
Releases · co0lc0der/simple-query-builder-php
v0.4.1
v0.4
This is a big update. Added some new features.
- added processing special chars (like
+
,/
etc) for$table
parameter - added
DISTINCT
forselect()
method - added parameter
withValues=true
forgetSql()
method - added methods:
__toString()
union()
andunionSelect()
forUNION
andUNION ALL
inSELECT
queriesexpects()
andexceptSelect()
forEXCEPT
inSELECT
queriesintersect()
andintersectSelect()
forINTERSECT
inSELECT
queriesgetDriver()
- written unit tests for all SQL methods
- README was separated for some files
- added
createView()
method (CREATE VIEW view_name AS SQL_SELECT
) - added
dropView()
method (DROP VIEW view_name
)
v0.3.6
Small refactoring and fixed some bugs
- fix and refactor
pluck()
method - fix and refactor
column()
method - small refactor
query()
method - you can use
like()
andnotLike()
methods with no brackets[]
- added
$printErrors
property and the same parameter for__construct()
(read README for details)
v0.3.5
Refactored and added 2 methods with 2 WHERE
conditions.
isNull($field)
now you can use the method forIS NULL
conditionisNotNull($field)
now you can use the method forIS NOT NULL
condition- added
notNull($field)
method as a synonym ofisNotNull($field)
- you can use those conditions with
where()
andhaving()
also, usagewhere([['phone', "IS NULL"]])
andwhere([['phone', "IS NOT NULL"]])
- change
?
to the corresponding values ingetSql()
method
v0.3.4
Refactored and added some methods.
orderBy()
now you can use multiple fields for sorting (use an array like['field1', 'field2 desc']
)groupBy()
now you can use multiple fields for grouping (use an array like['field1', 'field2']
)where()
andhaving()
now you can omit the operator=
orIN
, usagewhere([['id', 3]])
andwhere([['id', [10, 11, 12]]])
- method
pluck($key_index, $column_index)
returns an array of needed columns - method
exists()
returnstrue
if SQL query result has a row