summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
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>
* | Merge pull request #43357 from nextcloud/enh/41253/fix-occ-upgradeSimon L2024-02-081-10/+49
| | | | | | fix(migration): Make naming constraint fail softer on updates
* | Revert "Merge branch 'master' of github.com:nextcloud/server"Louis Chemineau2024-02-081-49/+10
| | | | | | | | | | This reverts commit d9d60238c7aaab9c61bf2d50c15aa59bc88c8975, reversing changes made to ba3fdb0cdcfbb84f0080a2146a4ba2f01569915d.
* | fix(migration): Make naming constraint fail softer on updatesJoas Schilling2024-02-071-10/+49
|/ | | | | | | | | | | | | | Only on installation we want to break hard, so that all developers notice the bugs when installing the app on any database or CI, and can work on fixing their migrations before releasing a version incompatible with Postgres. In case of updates we might be running on production instances and the administrators being faced with the error would not know how to resolve it anyway. This can also happen with instances, that had the issue before the current update, so we don't want to make their life more complicated than needed. Signed-off-by: Joas Schilling <coding@schilljs.com>
* 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>
* Cast datetime columns in sqlite before comparingJulius Härtl2023-12-293-86/+59
| | | | | | | Move the logic to prepare a column to the parent ExpressionBuilder so that it can be reused for OCI and sqlite Signed-off-by: Julius Härtl <jus@bitgrid.net>
* enh: Implement PrimaryReadReplicaConnectionJulius Härtl2023-12-163-12/+35
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Migrate missing primary key database check to new APICôme Chilliet2023-11-271-2/+2
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate missing index database check to new APICôme Chilliet2023-11-271-5/+5
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Migrate missing column database check to new APICôme Chilliet2023-11-271-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-232-5/+5
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* fix(workflowengine): use andWhere() not second where()Arthur Schiwon2023-11-131-1/+1
| | | | | | | - 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>
* fix(install): Make installing more verboseJoas Schilling2023-11-031-0/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(dbal): Fix types in query builder methods for parametersJoas Schilling2023-10-181-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(DB): Update comment to state why we still use the max 4k limitJoas Schilling2023-10-061-1/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(sqlite): Remove some old SQLite cheatsJoas Schilling2023-10-061-11/+0
| | | | | | | - Doctrine correctly forces integer for autoincrement by now - Doctrine correctly maintains integer types by now Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(oracle): Move away from internal and deprecated SchemaDiff APIJoas Schilling2023-10-061-149/+90
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(dbal): Move migrator away from deprecated callsJoas Schilling2023-10-061-11/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(mysql): Remove custom MySQL workaround from 2015Joas Schilling2023-10-062-52/+0
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(postgres): Remove old Postgres 9.4 workaroundJoas Schilling2023-10-062-58/+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>
* Convert isset ternary to null coalescing operatorHamid Dehnavi2023-09-281-1/+1
| | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* refactor: Use DBAL's executeQuery instead of query (deprecated)Christoph Wurst2023-09-271-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #39216 from shdehnavi/replace_substr_calls_in_lib_privateRobin Appelman2023-09-211-1/+1
|\ | | | | Refactor "substr" calls in lib/private to improve code readability
| * Refactor "substr" calls to improve code readabilityHamid Dehnavi2023-07-071-1/+1
| | | | | | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* | enh(db): provide database providers via APIAnna Larch2023-09-191-0/+19
| | | | | | | | | | | | | | | | | | To avoid leaking internals (OC), wrap the getDatabasePlatform and provide the associated constants fixes https://github.com/nextcloud/server/issues/30877 Signed-off-by: Anna Larch <anna@nextcloud.com>
* | Fix Exception catching in OC\DB\AdapterCôme Chilliet2023-09-051-2/+6
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Cleanup plsam issues in DB/ContactsManager and ConsoleCarl Schwan2023-09-055-48/+32
| | | | | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | feat(db): Ensure that index names are unique across the databaseJoas Schilling2023-07-201-0/+55
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* chore: Replace \OC::$server->query with \OCP\Server::get in /libChristoph Wurst2023-07-061-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fixed quotesdartcafe2023-06-201-1/+1
| | | | Signed-off-by: dartcafe <github@dartcafe.de>
* add type #38909dartcafe2023-06-201-1/+1
| | | | Signed-off-by: dartcafe <github@dartcafe.de>
* Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-153-4/+4
| | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* fix: Check for wrapped retriable exceptionsJulius Härtl2023-05-021-0/+5
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Use typed version of IConfig::getSystemValue as much as possibleCôme Chilliet2023-04-053-3/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* 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(DB): Remove not supported column comments when using SQLiteFerdinand Thiessen2023-02-221-1/+5
| | | | Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
* log start time of queries for profilerRobin Appelman2023-02-141-0/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #36261 from ↵Joas Schilling2023-01-231-0/+6
|\ | | | | | | | | nextcloud/techdebt/noid/warn-devs-about-potential-bugs fix(querybuilder): Log a warning if where() is called again on a quer…
| * fix(querybuilder): Log a warning if where() is called again on a query ↵Joas Schilling2023-01-201-0/+6
| | | | | | | | | | | | builder object Signed-off-by: Joas Schilling <coding@schilljs.com>