summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/QueryBuilder/QueryBuilder.php
Commit message (Collapse)AuthorAgeFilesLines
* fix: Remove bogus code from query builder and fix parameter nameCôme Chilliet2024-04-301-6/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(workflowengine): use andWhere() not second where()Arthur Schiwon2023-11-131-1/+1
| | | | | | | - an unconditional where() condition is added right before - fixes also wrongly named methods in the Exception message Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* fix(dbal): Fix types in query builder methods for parametersJoas Schilling2023-10-181-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-1/+1
| | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* Merge pull request #36261 from ↵Joas Schilling2023-01-231-0/+6
|\ | | | | | | | | nextcloud/techdebt/noid/warn-devs-about-potential-bugs fix(querybuilder): Log a warning if where() is called again on a quer…
| * fix(querybuilder): Log a warning if where() is called again on a query ↵Joas Schilling2023-01-201-0/+6
| | | | | | | | | | | | builder object Signed-off-by: Joas Schilling <coding@schilljs.com>
* | composer run cs:fixCôme Chilliet2023-01-201-1/+0
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Revert "make expression build return IQueryFunction instead of string"Robin Appelman2022-08-161-8/+4
| | | | | | This reverts commit 813b50ed428a8bc36817d19c84444e96dbe3b668. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix typos in lib/private subdirectoryluz paz2022-07-271-1/+1
| | | | | | Found via `codespell -q 3 -S l10n -L jus ./lib/private` Signed-off-by: luz paz <luzpaz@github.com>
* make expression build return IQueryFunction instead of stringRobin Appelman2022-06-021-4/+8
| | | | | | this allows passing the expressions to further expressions without them being escaped as column names Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix psalm issues related to the user backendCarl Schwan2022-05-201-1/+1
| | | | | | | | | | | | | - Reflect the actual return value returned by the implementation in the the interface. E.g. IUser|bool -> IUser|false - Remove $hasLoggedIn parameter from private countUser implementation. Replace the two call with the equivalent countSeenUser - getBackend is nuallable, add this to the interface - Use backend interface to make psalm happy about call to undefined methods. Also helps with getting rid at some point of the old implementActions Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* tell mysql to ignore the sort index for search queriesRobin Appelman2022-04-221-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix log level for exception in QueryBuilderCôme Chilliet2022-03-241-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate from ILogger to LoggerInterface in lib/privateCôme Chilliet2022-03-241-16/+10
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Prevent query error when use subqueryVitor Mattos2022-01-211-2/+2
| | | | Signed-off-by: Vitor Mattos <vitor@php.rio>
* Add a test with integerJoas Schilling2022-01-041-4/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add unit test and orderBy parameterVitor Mattos2022-01-031-4/+4
| | | | Signed-off-by: Vitor Mattos <vitor@php.rio>
* Allow NULL as well for limit, not integer onlyJoas Schilling2021-11-151-4/+8
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Bump doctrine/dbal from 3.0.0 to 3.1.3Christoph Wurst2021-10-221-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Rename IQueryBuilder::executeUpdate to IQueryBuilder::executeStatementChristoph Wurst2021-05-051-2/+17
| | | | | | | | | Because executeUpdate wasn't a great name. And in DBAL they also use executeStatement more consistently now. Ref https://github.com/doctrine/dbal/issues/4607 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #25929 from nextcloud/techdept/psalm/25839/redundantcastsRoeland Jago Douma2021-03-051-2/+2
|\ | | | | Remove Redundantcasts
| * Remove RedundantcastsRoeland Jago Douma2021-03-041-2/+2
| | | | | | | | | | | | For #25839 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Add executeQuery and executeUpdateRoeland Jago Douma2021-03-041-0/+37
|/ | | | | | | | | | | Names shamelessly copied from Doctrine itself. Internally it is still using the same flow. But I added some checks around it. This should make static analysis a bit more happy. Which in turn makes me more happy. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* allow non string join conditions in query builderRobin Appelman2021-03-031-5/+6
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* DB: warn on parameter number constraintsArthur Schiwon2021-01-111-0/+30
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-081-21/+32
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2020-12-301-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #22916 from J0WI/unifiy-links-to-php.netRoeland Jago Douma2020-12-221-1/+1
|\ | | | | Unify links to php.net
| * Unify links to php.netJ0WI2020-09-171-1/+1
| | | | | | | | | | | | Update all links to https://www.php.net/ Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-0/+1
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Prevent * and other things in the same query for OracleJoas Schilling2020-12-141-0/+21
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Prevent log_query to mess up regular execution flowVincent Petry2020-12-021-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | When the "log_query" debug config parameter is set, SQL queries are logged. However, if an error occurs when converting the values to string, it will abort the request. This fix catches the error and continues instead. Also added handler for DateTime value which is already known to cause aborts here. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* | allow selecting multiple columns with SELECT DISTINCTRobin Appelman2020-11-161-1/+7
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Psalm fixesRoeland Jago Douma2020-10-301-1/+1
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Add explicit typecast for $value.Daniel Kesselberg2020-10-031-2/+2
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Update signature for setDaniel Kesselberg2020-10-021-1/+2
|/ | | | | | also ILiteral and IQueryFunction are valid. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update documentation for QueryBuilder::setDaniel Kesselberg2020-08-141-1/+1
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-2/+0
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-5/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-221-1/+1
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* return from QueryBuilder instead of IQueryBuilderRobin Appelman2019-11-131-31/+31
| | | | | | this make the type hints work properly with querybuilder subclasses Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow to use Subqueries in fromJoas Schilling2019-04-161-0/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix Array to String conversion in QueryBuilderRoeland Jago Douma2018-04-051-1/+1
| | | | | | Fixes #9080 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Made orHaving varadicRoeland Jago Douma2018-03-131-3/+3
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Made addHaving varadicRoeland Jago Douma2018-03-131-3/+3
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>