Carl Schwan
1eff9e5c90
feat(querybuilder): Remove deprecated IQueryBuilder::execute
...
This won't work when we update to doctrine DBAL 4 and all usages in
server were ported away.
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-13 17:02:04 +07:00
Varun Patil
5ecd3c4b49
feat(database): Add option to test for mariadb
...
There are some behavioral differences that apps may need to check for.
See discussion on #51175 for more info.
This preserves the existing behavior of getDatabaseProvider()
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
2025-08-08 07:50:51 +07:00
Joas Schilling
c722f8c88b
fix(logging): Fix query logging with DateTimeImmutable parameters
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-08-04 08:47:55 +07:00
Andy Scherzinger
48d69c727a
fix(lint): correct comment identation
...
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-02-25 22:35:50 +07:00
S1m
da090c7a7a
Update doc comment for prefixTableName
...
Signed-off-by: S1m <31284753+p1gp1g@users.noreply.github.com>
2025-02-11 17:44:39 +07:00
provokateurin
e445be1202
fix(QueryBuilder): Account for aliases in output columns
...
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-02 11:55:27 +07:00
provokateurin
35dfc639b3
fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle limitations
...
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-26 08:57:06 +07:00
John Molakvoæ
ff0cab5956
Merge pull request #47852 from nextcloud/sharding-code-fixes
2024-09-16 11:39:58 +07:00
Ferdinand Thiessen
027fc052e7
fix: Adjust types of IQueryBuilder to properly allow joining with sub-query
...
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-10 17:51:27 +07:00
Robin Appelman
da59fd4389
fix: misc code fixes around db sharding
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-09 16:59:59 +07:00
Robin Appelman
b21a399d1a
fix: implement sharding compatible cleanup for various bits
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 10:27:14 +07:00
Robin Appelman
62f8b6517f
feat: implement distributing partitioned queries over multiple shards
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 10:21:19 +07:00
Robin Appelman
f5b3486744
feat: add option to automatically partition queries by specific tables
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 10:18:53 +07:00
Robin Appelman
c09ec95255
feat: track expected output columns in query builder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-28 10:18:52 +07:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
...
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Robin Appelman
658d2f7ea1
feat: expose escapeLikeParameter trough query builder
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-23 15:12:10 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
...
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Vitor Mattos
afe5b6dd8a
Prevent query error when use subquery
...
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:37:06 +07:00
Joas Schilling
46ad6fa3c7
Add a test with integer
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 09:15:17 +07:00
Vitor Mattos
7b9fea85b6
Add unit test and orderBy parameter
...
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-03 12:45:00 +07: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 +07: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 +07:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07: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 +07:00
Roeland Jago Douma
85e48d796c
Merge pull request #25929 from nextcloud/techdept/psalm/25839/redundantcasts
...
Remove Redundantcasts
2021-03-05 08:42:54 +07:00
Roeland Jago Douma
c3f1eb4f7f
Remove Redundantcasts
...
For #25839
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-04 14:44:04 +07: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 +07:00