aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/Db
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * Make isXXX available for bool properties onlyDaniel Kesselberg2019-11-161-6/+18
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Some php-cs fixesRoeland Jago Douma2019-11-223-4/+0
|/ | | | | | | | | | | * 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>
* Add isXXX getter to EntityChristoph Wurst2019-10-221-9/+12
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* [#11236] Set parameter type in QBMapperMarius David Wieschollek2019-03-241-3/+35
| | | | Signed-off-by: Marius David Wieschollek <git.public@mdns.eu>
* Access id property without getter.Daniel Kesselberg2018-12-241-1/+1
| | | | | | Some implementations typehint getId to integer but default is null. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Fetch lastInsertId only when id nullDaniel Kesselberg2018-12-241-1/+3
| | | | | | | | When id column has no autoincrement flag query for lastInsertId fails on postgres because no value has been generated. Call lastInsertId only if id is null. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Add IMapperExceptionRoeland Jago Douma2018-12-063-2/+34
| | | | | | | This way code using the DB mappers can have try catch blocks on this type of exceptions if they do not care if there was non or to many. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Document possibly thrown excption of QBMapper::insertOrUpdateChristoph Wurst2018-10-021-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add QBMapper::insertOrUpdate()Christoph Wurst2018-10-021-1/+18
| | | | | | | | This allows elegant upserts where the entity ID is provided (e.g. by an external system) and when that data is fed into our database multiple times. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* The column is not user input so suppress the phan warningRoeland Jago Douma2018-05-141-0/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add a QueryBuilder MapperRoeland Jago Douma2018-05-102-1/+284
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove unused variablesMorris Jobke2017-11-061-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove IDb interface which was deprecated for 3 years alreadyJoas Schilling2016-12-141-15/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix othersJoas Schilling2016-07-214-5/+9
|
* Update license headersLukas Reschke2016-05-261-1/+1
|