aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB
Commit message (Collapse)AuthorAgeFilesLines
* feat: add commands for exporting current and expected database schemaRobin Appelman2024-07-022-3/+7
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat(dbal): add proper insert ignore conflict method for SQLiteBenjamin Gaussorgues2024-06-251-0/+15
| | | | Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* feat(dbal): add proper insert ignore conflict method for MySQLBenjamin Gaussorgues2024-06-251-0/+28
| | | | Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* feat(db): remove workaround for pqsql 9.4 and olderDaniel Kesselberg2024-06-031-18/+0
| | | | | | | | The workaround was required because "ON CONFLICT DO NOTHING" was added with pqsql 9.5. PostgreSQL 9.4 is eol since 2020-02-13 and thus everyone should use a version with upsert support nowadays. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Merge branch 'master' into refactor/OC-Server-getSecureRandomJohn Molakvoæ2024-05-3047-1456/+645
|\ | | | | Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
| * feat(db): add mapping for lock wait timeoutDaniel Kesselberg2024-05-291-0/+4
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
| * fix(db): Prevent two connections for single node databasesChristoph Wurst2024-05-281-1/+11
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
| * Merge pull request #39589 from ↵Thomas Citharel2024-05-271-0/+2
| |\ | | | | | | | | | | | | nextcloud/enh/set-nest-transactions-with-savepoints set Doctrine to use nest transactions with savepoints
| | * feat(db): set Doctrine to use nest transactions with savepointsThomas Citharel2024-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using nested transactions without savepoints is actually deprecated by Doctrine: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/transactions.html#transaction-nesting Without savepoints, a nested transaction can be rollbacked but not handled properly in the "real" transaction, leading to the following error: Transaction commit failed because the transaction has been marked for rollback only. Ref https://github.com/nextcloud/server/pull/36528#issuecomment-1639913965 (and possibly) https://github.com/nextcloud/server/issues/38902#issuecomment-1598075391 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
| * | fix(db): Log loong transaction times at debug levelJosh2024-05-251-2/+2
| | | | | | | | | Signed-off-by: Josh <josh.t.richards@gmail.com>
| * | chore: Add SPDX headerAndy Scherzinger2024-05-2445-945/+141
| | | | | | | | | | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
| * | Merge pull request #39247 from nextcloud/query-log-backtraceJohn Molakvoæ2024-05-021-1/+7
| |\ \
| | * | feat: add option to add backtrace to the query loggerRobin Appelman2024-05-011-1/+7
| | | | | | | | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * | | fix(querybuilder): Remove temporary internal method executeUpdate()Joas Schilling2024-04-301-15/+0
| |/ / | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
| * | fix: Remove bogus code from query builder and fix parameter nameCôme Chilliet2024-04-301-6/+2
| | | | | | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * | feat: add request id as comment to all queriesRobin Appelman2024-04-171-8/+20
| | | | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * | chore(db): move to OCP\ServerGit'Fellow2024-04-131-6/+7
| | | | | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
| * | fix: Fix new psalm errors from updateCôme Chilliet2024-04-083-12/+3
| | | | | | | | | | | | | | | | | | | | | Not sure about the SimpleContainer modification, let’s see what CI says about that. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * | fix: Apply new coding standard to all filesCôme Chilliet2024-04-027-10/+10
| | | | | | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * | Merge pull request #44470 from nextcloud/fix/compatibility-replica-splittingBenjamin Gaussorgues2024-03-261-1/+1
| |\ \
| | * | fix: Allow using replica config with split databasesJulius Härtl2024-03-261-1/+1
| | |/ | | | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
| * / fix(DB): Sanitize `host` parameter for postgres databases when IPv6 address ↵Ferdinand Thiessen2024-03-251-0/+9
| |/ | | | | | | | | | | | | | | | | is passed Doctrine is using `pg_connect` with the `host` parameter, this does not allow IPv6 addresses in URI notation. So we need to extract the IP address and pass it directly Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
| * 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>