summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/Connection.php
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #43297 from nextcloud/fix/db/dirty-read-cool-offChristoph Wurst2024-02-191-3/+20
|\ | | | | fix(db): Let dirty writes cool off
| * fix(db): Let dirty writes cool offChristoph Wurst2024-02-191-3/+20
| | | | | | | | | | | | | | We can assume that after a few seconds a read will be clean again. This is helpful for false warnings in long running processes. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | fix(db): Give dirty read exception a messageChristoph Wurst2024-02-151-1/+1
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | fix(db): Unify long transaction log/exception messageChristoph Wurst2024-02-131-1/+1
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix(db): Execute dirty reads on the primary nodeChristoph Wurst2024-01-301-0/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* feat(db): Make dirty query logging available in productionChristoph Wurst2024-01-301-1/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #42929 from nextcloud/fix/db/transacted-read-not-dirtyChristoph Wurst2024-01-231-2/+5
|\ | | | | fix(db): Do not log transacted reads as dirty read
| * fix(db): Do not log transacted reads as dirty readChristoph Wurst2024-01-181-2/+5
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | fix(db): Remove very verbose dirty query logsChristoph Wurst2024-01-181-11/+0
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix: Add reconnect check in case of timeouts on the db sideJulius Härtl2024-01-121-0/+27
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* feat: First attempt to track dirty tables after writes and switch back to ↵Julius Härtl2024-01-121-0/+27
| | | | | | | | | | replicas if reads go to other tables Signed-off-by: Julius Härtl <jus@bitgrid.net> debug: error log Signed-off-by: Julius Härtl <jus@bitgrid.net>
* feat: Add logging for transaction timeJulius Härtl2024-01-121-0/+34
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* enh: Implement PrimaryReadReplicaConnectionJulius Härtl2023-12-161-2/+17
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-2/+2
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* fix(mysql): Remove custom MySQL workaround from 2015Joas Schilling2023-10-061-2/+0
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(postgres): Remove old Postgres 9.4 workaroundJoas Schilling2023-10-061-3/+0
| | | | | | | | Postgres 10 is the minimum in the meantime and doctrine/dbal fixed this in 2.6.0 already ref https://github.com/doctrine/dbal/pull/2614 Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(sqlite): Remove no longer required autoincrement fixJoas Schilling2023-10-061-2/+2
| | | | | | | | | - I installed current master and exported the schema as SQL - Then I went to this branch, removed the content of the run() method (so made it no-op) - I installed again and exported the schema as SQL - The files are exactly the same, so whatever we tried to fix was fixed since 2015 in doctrine dbal Signed-off-by: Joas Schilling <coding@schilljs.com>
* Cleanup plsam issues in DB/ContactsManager and ConsoleCarl Schwan2023-09-051-8/+8
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* fix DBAL exception handling in setValuesArthur Schiwon2023-03-311-7/+11
| | | | | | | | | This seems to be a left over after abstracting DBAL. Nowadays, IQueryBuilder::executeStatement() only throws a \OCP\DB\Exception, where previously original DBAL exceptions where thrown. These are now wrapped, the orignal classes are now mapped to a reason. Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Fix more psalm issues in OC\DBCôme Chilliet2022-11-211-2/+4
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix psalm issues following doctrine/dbal bumpCôme Chilliet2022-11-211-3/+4
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate Repair events to OCP\EventDispatcher\EventCôme Chilliet2022-08-251-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* record backtrace when profiling db requestsRobin Appelman2022-04-041-2/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add a built-in profiler inside NextcloudCarl Schwan2022-04-041-0/+15
| | | | | | The webui is provided by a seperate application named profiler Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Adapt more code to migration to LoggerInterfaceCôme Chilliet2022-03-241-35/+34
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #31235 from nextcloud/techdebt/noid/extract-request-idJoas Schilling2022-03-221-2/+8
|\ | | | | Extract request id handling to dedicated class so it can be injected without DB dependency
| * Allow to prefix the Query log with the request idJoas Schilling2022-02-231-2/+8
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Add event logging for db and redis connectionJulius Härtl2022-02-281-1/+11
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Add --dry-run option for db:add-missing-* cmdLouis Chemineau2022-02-241-2/+10
|/ | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Check if directoy is writable instead of possibly missing fileCarl Schwan2021-12-201-1/+1
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Allow to log DB, redis and LDAP requests into filesJoas Schilling2021-12-011-0/+14
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Allow NULL as well for limit, not integer onlyJoas Schilling2021-11-151-3/+8
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Cleanup unneeded code around database.xmlMorris Jobke2021-03-241-4/+24
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* remove ReconnectWrapperRobin Appelman2021-02-091-1/+4
| | | | | | dbal now handles it's own reconnections: https://github.com/doctrine/dbal/blob/3.0.x/UPGRADE.md#the-pingableconnection-interface-is-removed Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add our own DB exception abstractionChristoph Wurst2021-01-121-1/+24
| | | | | | | | | | | | | | | | | | Right now our API exports the Doctrine/dbal exception. As we've seen with the dbal 3 upgrade, the leakage of 3rdparty types is problematic as a dependency update means lots of work in apps, due to the direct dependency of what Nextcloud ships. This breaks this dependency so that apps only need to depend on our public API. That API can then be vendor (db lib) agnostic and we can work around future deprecations/removals in dbal more easily. Right now the type of exception thrown is transported as "reason". For the more popular types of errors we can extend the new exception class and allow apps to catch specific errors only. Right now they have to catch-check-rethrow. This is not ideal, but better than the dependnecy on dbal. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-081-24/+34
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Don't try to update on NotNullConstraintViolationException, only on unique ↵Joas Schilling2020-11-101-0/+3
| | | | | | or foreign key Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix comparing the empty string for global credentialsJoas Schilling2020-11-101-5/+11
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Replace prefix in executeUpdateJulius Härtl2020-11-031-0/+3
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Psalm fixesRoeland Jago Douma2020-10-301-10/+14
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update internal connection classRoeland Jago Douma2020-10-301-2/+2
| | | | | | | executeUpdate is deprecated in favor of executeStatement. We overwrote the old one hence the prefix was no longer replaced. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fetch the logger and system config once for all query builder instancesMorris Jobke2020-10-291-8/+15
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Log the number of queries built and executedJoas Schilling2020-09-251-0/+18
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove @suppress SqlInjectionCheckerMorris Jobke2020-09-161-1/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-7/+4
| | | | | | | | | | | | | | | 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>
* Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove trailing and in between spacesChristoph Wurst2020-04-091-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>