Commit Graph

138 Commits (1ef465f80425f3dadd47c05ae2198153723d3eec)

Author SHA1 Message Date
Tobias Kaminsky 6f0537b4e9
Merge pull request #56494 from nextcloud/carl/result-improv
Improve IResult
2025-11-20 15:38:17 +07:00
Carl Schwan 90f4b98424 refactor(IResult): Un-deprecate fetch and fetchAll
But still add a note that the new methods are preferred.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-11-19 10:53:03 +07:00
Carl Schwan 3682dbbf5e feat(result): Update result wrapper with new doctrine methods
- fetch is replaced with fetchAssociative/fetchNumeric/fetchOne with
  better type hinting
- Same with fetchAll
- And add iterateAssociative/iterateNumeric which are nicer to use than
  a `while ($row = $result->fetch()) {}`

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-11-18 17:45:13 +07:00
Joas Schilling 7c870a8f67
fix(db)!: Deprecate JSON fields due to problems with querying and selecting
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-11-18 11:58:33 +07:00
Carl Schwan 336cc3fa35 feat(Db): Use SnowflakeId for previews
Allow to get an id for the storing the preview on disk before inserting
the preview on the DB.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-28 17:50:03 +07:00
Carl Schwan 1dc363581f fix: get all available previews on Oracle
Split the DB requests in chunk of 1000 and use INNER JOIN instead of IN
as this is better supported on all DB.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-23 14:10:15 +07:00
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
Ferdinand Thiessen 5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +07:00
Ferdinand Thiessen db94e10af0
fix: Prevent breaking change in IQueryBuilder
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-17 18:31:44 +07:00
Ferdinand Thiessen ee02e3246d
feat(AppFramework): Add full support for date / time / datetime columns
This adds support for all Doctrine supported types, for the column types only the immutable variants needed to be added.
But especially those types are the important ones, as our **Entity** class works by detecting changes through setters.
Meaning if it is mutable, changes like `$entity->date->modfiy()` can not be detected, so the immutable types make more sense here.

Similar the parameter types needed to be added.

`Enity` and `QBMapper` needed to be adjusted so they support (auto map) those types, required when insert or update an entity.

Also added more tests, especially to make sure the mapper really serializes the values correctly.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-17 18:31:42 +07:00
Robin Appelman b45f2420fe fix: fix share reminder job for oracle
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-09-18 19:24:44 +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 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
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 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
Daniel Kesselberg 3fb0aa40cd
feat(db): add mapping for lock wait timeout
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-05-29 11:10:43 +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
Côme Chilliet 6d291ac260
chore: Add missing parameter to docblock tag psalm-taint-sink
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-22 16:38:08 +07:00
Johannes Merkel 06d076410a
feat(occ): add possibility to edit indices
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
2024-02-27 11:03:08 +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
Joas Schilling c4ed7f9d21
fix(dbal): Doctrine\DBAL\Connection::PARAM_* types are deprecated
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-06 15:29:24 +07:00
Joas Schilling 5a1fcdb272
fix(dbal): Migrate to Doctrine\DBAL\ParameterTypes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-08-23 09:08:08 +07:00
Joas Schilling 00d483585b
fix: Add options to support all used features by core
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:34 +07:00
Joas Schilling bd0a149a4f
feat(dispatcher): Add typed event for "db:add-missing-primary-keys"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:32 +07:00
Joas Schilling 2eded24eff
feat(dispatcher): Add typed event for "db:add-missing-columns"
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-24 14:51:32 +07:00
Julius Härtl 925bcebcb6
feat: Add public event for missing indices
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-07-14 13:11:22 +07:00
Simon L d55a7c619d Fix typos in lib/public subdirectory
Found via `codespell -q 3 -S l10n -L jus ./lib/public`

Signed-off-by: luz paz <luzpaz@github.com>

Update lib/public/Accounts/IAccount.php

Signed-off-by: luz paz <luzpaz@github.com>

Signed-off-by: Simon L <szaimen@e.mail.de>
Co-Authored-By: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2023-05-10 11:56:34 +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
Robin Appelman 6e0123a1d0 Revert "add case statement to sql function builder"
This reverts commit 2a68819a67.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 12:07:13 +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
Robin Appelman 2a68819a67
add case statement to sql function builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-02 15:52:12 +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
Joas Schilling be4faebc47
Adjust docs to the same as the implementation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-05-23 12:56:47 +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
Carl Schwan 7817845538 Add a metadata service to store file metadata
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-04-13 14:06:29 +07:00
Côme Chilliet efebbacca4 Add octetLength and charLength to function builder, and tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 20:35:02 +07:00
Carl Schwan c870bd1968 Do chuncked job deletion
This is helpful in cases where we are deleting tons jobs at the same
time in a gallera cluster. This doesn't happen often but this can create
issues.

Test plan:

1. Use https://github.com/nextcloud/quota_warning/pull/88
2. Change max to 1
3. Enabled/Disable quota_warning app and see jobs getting sucessfully
   added and removed

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-03-17 21:41:58 +07:00
Carl Schwan 5a17415dd8 Add a few more non-extendable interface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-03-05 14:35:34 +07:00
Joas Schilling fccb98c8b6
Merge pull request #30379 from nextcloud/feature/add-comments-reactions
Add comments reactions
2022-01-21 15:08:12 +07:00
Joas Schilling d850dc0220
Remove order from groupConcat as it is not working everywhere
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-21 08:39:39 +07:00
Vitor Mattos f071b4dfbb
Fix groupConcat and ordering on Oracle
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:39:39 +07:00