aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/Db
Commit message (Collapse)AuthorAgeFilesLines
* chore: apply new CSFixer rulesFerdinand Thiessen2025-07-012-6/+6
| | | | | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> # Conflicts: # apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
* fix: remove typing and return typefix/noid/revert-api-breaking-return-typeAnna Larch2025-01-231-1/+1
| | | | Signed-off-by: Anna Larch <anna@nextcloud.com>
* fix(QBMapper): Fix findEntities() return type to be list<T>fix/qbmapper/find-entities-return-typeprovokateurin2024-11-061-2/+2
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix(entity): Fix mapping of old/sub-types to actually supported database typesfollowup/47329/add-all-types-to-handlingJoas Schilling2024-10-231-0/+22
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix: Adjust Entity typesfeat/add-datetime-qbmapper-supportFerdinand Thiessen2024-10-171-4/+3
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix: Prevent breaking change in IQueryBuilderFerdinand Thiessen2024-10-171-4/+4
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* feat(AppFramework): Add full support for date / time / datetime columnsFerdinand Thiessen2024-10-172-27/+50
| | | | | | | | | | | | | | | | 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>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* Merge pull request #48008 from nextcloud/fix/entity/strict-typesKate2024-09-161-3/+2
|\
| * fix(Entity): Fix magic setter call for custom strong typed settersfix/entity/strict-typesprovokateurin2024-09-151-3/+2
| | | | | | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* | feat(db): switch from settype to castsfeat/switch-from-settype-to-castsAnna Larch2024-09-151-46/+63
|/ | | | Signed-off-by: Anna Larch <anna@nextcloud.com>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-252-3/+3
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* feat: Add yieldEntities wrapper for entity mapping in QBMapperJulius Härtl2024-06-241-0/+21
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* chore: Add SPDX headerAndy Scherzinger2024-05-246-133/+17
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: Apply new coding standard to all filesCôme Chilliet2024-04-022-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Refactors "strpos" calls in lib/public to improve code readability.Faraz Samapoor2023-06-051-4/+4
| | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* enh: Provide atomicRetry method to retry transactions if possibleJulius Härtl2023-05-161-0/+37
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* fix: add workaround for oci and limit queriesDaniel Kesselberg2023-05-021-0/+1
| | | | | | DBAL uses a helper column "doctrine_rownum" for top-n queries Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* fix: Allow to catch `IMapperException` by implementing `Throwable`Ferdinand Thiessen2023-04-171-1/+1
| | | | Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
* Add type hints for mappersjld31032023-04-071-2/+1
| | | | Signed-off-by: jld3103 <jld3103yt@gmail.com>
* composer run cs:fixCôme Chilliet2023-01-204-4/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Improve typing in Entity.phpCôme Chilliet2023-01-201-12/+14
| | | | | | Removing @method in Entity brings even more errors. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Remove long depreated AppFramework/Db/MapperRoeland Jago Douma2022-10-101-370/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix reading blob data as resourceThomas Citharel2022-07-251-0/+3
| | | | | | | | | | | | | | | | PostgreSQL returns data as resource when using IQueryBuilder::PARAM_LOB (which is used for QBMapper). Previously we just converted this resource using settype, which produced things like "Resource id #14" instead of the actual resource data. Now we read the stream correctly if the returned data is a resource See context at #22472 Fixes #22439 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Always free the DB result in QBMapper::findEntitiesChristoph Wurst2022-05-121-9/+8
| | | | | | | Without this patch it only happened if the code ran through without any errors. Now the result is also freed in the case of an error. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add a metadata service to store file metadataCarl Schwan2022-04-132-0/+6
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add Transactional trait for atomic DB operationsChristoph Wurst2022-02-171-0/+70
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Deprecate entity slugsChristoph Wurst2021-12-141-0/+1
| | | | | | | They are only used a single time in the whole Nextcloud Github organization. We can inline the code there and slim down the public API. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-046-8/+4
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Add DB exception throws tag to QBMapper PHPDocAnna Larch2021-05-261-7/+17
| | | | Signed-off-by: Anna Larch <anna@nextcloud.com>
* Merge pull request #26848 from ↵Morris Jobke2021-05-072-3/+12
|\ | | | | | | | | nextcloud/bugfix/noid/add-datetime-support-to-qbmapper Add datetime support to QBMapper
| * Add datetime support to QBMapperJoas Schilling2021-05-012-3/+12
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Rename IQueryBuilder::executeUpdate to IQueryBuilder::executeStatementChristoph Wurst2021-05-051-3/+3
|/ | | | | | | | | 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>
* Fix constraint violation detection in QB MapperJoas Schilling2021-04-161-3/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use executeQuery and executeUpdate in the QBMapperChristoph Wurst2021-03-181-11/+11
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix some redundant castsRoeland Jago Douma2021-03-081-1/+1
| | | | | | Happier psalm Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add template typing to the QBMapperChristoph Wurst2020-10-121-2/+17
| | | | | | | | | | | | | The QBMapper is kind of a generic type, though this concept does not exist in php. Hence you have a lot of type coercion in subtypes (mappers in the individual apps) because you suddenly don't expect an Entity[] but your specific type. Luckily Psalm lets us type those. Then in the subclass you can psalm-implement the mapper with a concrete type and psalm will do all the magic to ensure types are used correctly. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-052-9/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove @suppress SqlInjectionCheckerMorris Jobke2020-09-161-3/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix writing BLOBs to postgres with recent contacts interactionChristoph Wurst2020-08-282-1/+8
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headers for 19Christoph Wurst2020-04-294-0/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-106-45/+34
| | | | | | | | | | | | | | | 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>
* Remove trailing and in between spacesChristoph Wurst2020-04-092-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-095-19/+19
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-093-3/+0
| | | | | | For PSR2 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-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Allow non integer ids in Entity MapperJoas Schilling2020-02-261-2/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update license headersChristoph Wurst2019-12-056-6/+22
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #17948 from nextcloud/enh/check-if-property-is-boolRoeland Jago Douma2019-11-261-6/+18
|\ | | | | Make isXXX available for bool properties only