92 Commits

Author SHA1 Message Date
Joas Schilling
0aceb8fd11 fix(comments): Check comment object
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-12-11 08:41:14 +01:00
Joas Schilling
3a5bf443e8 fix(logging): Fix query logging with DateTimeImmutable parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-08-05 10:29:12 +00:00
Ferdinand Thiessen
832f79ac93 chore: apply code style
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-30 19:04:59 +02:00
provokateurin
aab30afc25 fix(QueryBuilder): Account for aliases in output columns
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-03 13:49:00 +00:00
Benjamin Gaussorgues
8290de3b93 Merge pull request #48077 from nextcloud/backport/47852/stable30 2024-10-02 10:43:41 +02:00
provokateurin
bbeda126cc fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle limitations
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-26 13:16:02 +00:00
Robin Appelman
914e8f9ce2 fix: misc code fixes around db sharding
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-16 12:19:20 +02:00
Ferdinand Thiessen
a8ae2f9755 fix: Adjust types of IQueryBuilder to properly allow joining with sub-query
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-11 15:20:42 +02:00
Louis Chemineau
140b36fcea fix: Backport to 30
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-08-28 14:54:14 +02:00
Robin Appelman
82d7eaf80a feat: implement distributing partitioned queries over multiple shards
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 14:54:14 +02:00
Robin Appelman
4ec53e723e feat: add option to automatically partition queries by specific tables
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 14:54:14 +02:00
Robin Appelman
8eaddbc038 feat: track expected output columns in query builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 14:54:14 +02:00
Robin Appelman
7fbb981877 feat: add additional logging for database errors
including the stack trace of the current database transaction

Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-24 15:35:07 +02:00
Joas Schilling
e1e4ee4d67 fix(db): Manually track if where() is called when not empty to avoid recursion
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:16 +02:00
Joas Schilling
eeb6ddb176 fix(db): Deprecate IExpressionBuilder::or() and IExpressionBuilder::and() without parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:16 +02:00
Joas Schilling
e45465781f fix(db): Deprecate getState() as per upstream
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:15 +02:00
Joas Schilling
829f2b9bc7 fix(db): Promote the use of getDatabaseProvider to reduce the impage of removed upstream platforms
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:14 +02:00
Joas Schilling
bd383627a7 fix(db): Deprecate using table alias for DELETE and UPDATE
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:13 +02:00
Joas Schilling
f92352eda4 fix(db): Deprecate getQueryPart() and resetQueryPart() methods that will be removed with Doctrine/DBAL 4
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:10 +02:00
Robin Appelman
9de6190ec4 feat: allow running QueryBuilder queries on different connections
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-15 22:41:04 +02:00
Andy Scherzinger
dae7c159f7 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Joas Schilling
90ba7db0fb fix(querybuilder): Remove temporary internal method executeUpdate()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-04-30 15:13:12 +02:00
Côme Chilliet
26c4ca264f fix: Remove bogus code from query builder and fix parameter name
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-30 09:23:58 +02:00
Arthur Schiwon
93505b2cdd fix(workflowengine): use andWhere() not second where()
- 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>
2023-11-13 14:47:47 +01:00
Joas Schilling
15a7aa51c5 fix(dbal): Fix types in query builder methods for parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-18 07:09:08 +02:00
Faraz Samapoor
e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +03:30
Joas Schilling
ecad09b38a Merge pull request #36261 from nextcloud/techdebt/noid/warn-devs-about-potential-bugs
fix(querybuilder): Log a warning if where() is called again on a quer…
2023-01-23 18:47:25 +01:00
Côme Chilliet
f5c361cf44 composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Joas Schilling
7f0a54c558 fix(querybuilder): Log a warning if where() is called again on a query builder object
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-01-20 07:41:19 +01:00
Robin Appelman
9b52663a81 Revert "make expression build return IQueryFunction instead of string"
This reverts commit 813b50ed42.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 12:07:09 +02:00
luz paz
368f83095d Fix typos in lib/private subdirectory
Found via `codespell -q 3 -S l10n -L jus ./lib/private`

Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 -04:00
Robin Appelman
813b50ed42 make expression build return IQueryFunction instead of string
this allows passing the expressions to further expressions without them being escaped as column names

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-02 15:52:08 +02:00
Carl Schwan
9ec0cb0a90 Fix psalm issues related to the user backend
- 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>
2022-05-20 17:14:58 +02:00
Robin Appelman
a4e120c203 tell mysql to ignore the sort index for search queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 13:42:33 +02:00
Côme Chilliet
f1febfe696 Fix log level for exception in QueryBuilder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:28 +01:00
Côme Chilliet
6be7aa112f Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Vitor Mattos
afe5b6dd8a Prevent query error when use subquery
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:37:06 -03:00
Joas Schilling
46ad6fa3c7 Add a test with integer
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 09:15:17 +01:00
Vitor Mattos
7b9fea85b6 Add unit test and orderBy parameter
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-03 12:45:00 -03:00
Joas Schilling
5bb49feef8 Allow NULL as well for limit, not integer only
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-15 18:51:28 +01:00
Christoph Wurst
130ab63ca1 Bump doctrine/dbal from 3.0.0 to 3.1.3
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-10-22 09:03:45 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Christoph Wurst
865661ed75 Rename IQueryBuilder::executeUpdate to IQueryBuilder::executeStatement
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>
2021-05-05 10:31:54 +02:00
Roeland Jago Douma
85e48d796c Merge pull request #25929 from nextcloud/techdept/psalm/25839/redundantcasts
Remove Redundantcasts
2021-03-05 08:42:54 +01:00
Roeland Jago Douma
c3f1eb4f7f Remove Redundantcasts
For #25839

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-04 14:44:04 +01:00
Roeland Jago Douma
76a6328d10 Add executeQuery and executeUpdate
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>
2021-03-04 14:03:31 +01:00
Robin Appelman
47dd8e54b5 allow non string join conditions in query builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-03 10:43:15 +01:00
Arthur Schiwon
f9484d15cb DB: warn on parameter number constraints
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-01-11 13:43:34 +01:00
Christoph Wurst
8b64e92b92 Bump doctrine/dbal from 2.12.0 to 3.0.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-08 11:45:19 +01:00
Christoph Wurst
9ce3ea3368 Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-30 14:07:05 +01:00