aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB
Commit message (Collapse)AuthorAgeFilesLines
* fix: use proper migration sorting when checking if a migration needs to be ↵Robin Appelman2025-04-021-3/+3
| | | | | | executed Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #51073 from nextcloud/dbal-exception-queryRobin Appelman2025-03-042-6/+9
|\ | | | | feat: log query for dbal exceptions
| * feat: log query for dbal exceptionsdbal-exception-queryRobin Appelman2025-02-262-6/+9
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | feat(db): add truncateTable methodpulsejet/truncate-1Varun Patil2025-03-022-0/+21
| | | | | | | | Signed-off-by: Varun Patil <varunpatil@ucla.edu>
* | fix(lint): correct comment identationenh/ldap-clearer-errorsAndy Scherzinger2025-02-251-1/+1
| | | | | | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* | Merge pull request #50764 from p1gp1g/patch-1Andy Scherzinger2025-02-251-0/+2
|\ \ | | | | | | Update doc comment for prefixTableName
| * | Update doc comment for prefixTableNameS1m2025-02-111-0/+2
| | | | | | | | | Signed-off-by: S1m <31284753+p1gp1g@users.noreply.github.com>
* | | feat: support migrating an instance to shardingsharding-existingRobin Appelman2025-02-255-18/+51
| |/ |/| | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: Initialize lastConnectionCheck after first connectionartonge/fix/login_flow_v2_sessionsLouis Chemineau2025-02-191-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | We are checking whether the DB connection is alive once every 30 seconds. But when we are lacking the last check time, we are skipping the check and reconnect logic. This is causing the reconnect logic to never fire in those cases. It seems to me that "those cases", are actually always the case, as upon initialization, we are not using the proper connection name to store the time. In the `connect()` logic, when `$this->_conn` is null, `$this->getConnectionName()` is returning `replica`, so `$this->lastConnectionCheck` will be equal to `['replica' => time()];` https://github.com/nextcloud/server/blob/60711ea4cfde6f53d0b18bcd7e166a34a43056a5/lib/private/DB/Connection.php#L215-L221 https://github.com/nextcloud/server/blob/60711ea4cfde6f53d0b18bcd7e166a34a43056a5/lib/private/DB/Connection.php#L891-L893 https://github.com/nextcloud/3rdparty/blob/2b6d7bf65ff242ea050e736925f752a38d8da220/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php#L136-L139 Then, if the connection name ends up as being 'primary', the reconnect logic is skipped: https://github.com/nextcloud/server/blob/60711ea4cfde6f53d0b18bcd7e166a34a43056a5/lib/private/DB/Connection.php#L874-L880 Follow-up of https://github.com/nextcloud/server/pull/41819 Signed-off-by: Louis Chemineau <louis@chmn.me>
* fix(ConvertType): Read dbtype in createConnectionParams and remove safeguardNils Wenninghoff2025-01-301-7/+5
| | | | Signed-off-by: Nils Wenninghoff <nils@ungemein.cool>
* fix: improve logic for ensuring join columns are selected for partitioned ↵sharding-select-fixesRobin Appelman2024-12-121-3/+21
| | | | | | queries Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: handle calling select on partitioned queries with an array of columnsRobin Appelman2024-12-121-0/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(sharding): typo in addOrderByfix/recently_active_pgsqlBenjamin Gaussorgues2024-10-301-1/+1
| | | | Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* chore(deps): Bump nextcloud/coding-standard in /vendor-bin/cs-fixerdependabot/composer/vendor-bin/cs-fixer/nextcloud/coding-standard-1.3.2dependabot[bot]2024-10-195-13/+13
| | | | | | | | | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v1.3.1...v1.3.2) --- updated-dependencies: - dependency-name: nextcloud/coding-standard dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: provokateurin <kate@provokateurin.de>
* fix: Prevent breaking change in IQueryBuilderFerdinand Thiessen2024-10-171-4/+4
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix: Adjust parameter type usage and add SQLite supportFerdinand Thiessen2024-10-171-4/+20
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(QueryBuilder): Account for aliases in output columnsfix/querybuilder/output-columns-aliasesprovokateurin2024-10-021-8/+4
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* fix(QueryBuilder): Restrict identifier length to 30 characters due to Oracle ↵fix/querybuilder/oracle-indentifier-lengthprovokateurin2024-09-261-0/+17
| | | | | | limitations Signed-off-by: provokateurin <kate@provokateurin.de>
* chore: Add proper deprecation dates where missingFerdinand Thiessen2024-09-201-2/+2
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-1911-14/+14
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* Merge pull request #47852 from nextcloud/sharding-code-fixesJohn Molakvoæ2024-09-163-7/+7
|\
| * fix: misc code fixes around db shardingsharding-code-fixesRobin Appelman2024-09-093-7/+7
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: Adjust types of IQueryBuilder to properly allow joining with sub-queryFerdinand Thiessen2024-09-102-2/+2
|/ | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore: adjust code to adhere to coding standardAnna Larch2024-09-051-2/+2
| | | | Signed-off-by: Anna Larch <anna@nextcloud.com>
* Merge pull request #47675 from nextcloud/adapterQueryOptiJohn Molakvoæ2024-09-041-12/+12
|\
| * fix: psalmGit'Fellow2024-09-021-1/+1
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
| * fix: psalmGit'Fellow2024-09-021-2/+2
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
| * chore(db): Make the query more simpler to readGit'Fellow2024-09-021-14/+14
| | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | Merge pull request #47640 from nextcloud/fix/migrator-replicaJulius Härtl2024-09-021-1/+1
|\ \ | |/ |/| fix: Run migration sql as statement so that the primary db node is used
| * fix: Run migration sql as statement so that the primary db node is usedJulius Härtl2024-08-301-1/+1
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | fix(DB): do not assume sharding is always enabledArthur Schiwon2024-08-291-13/+19
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | fix(DB): set sharding parameters only when intendedArthur Schiwon2024-08-291-5/+10
|/ | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #47515 from nextcloud/bugfix/noid/fix-migration-sortingAndy Scherzinger2024-08-281-13/+21
|\ | | | | fix(migration): Correctly sort migrations by version number
| * fix(migration): Correctly sort migrations by version numberJoas Schilling2024-08-271-13/+21
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | chore: Apply php:cs recommendationsLouis Chemineau2024-08-288-30/+30
| | | | | | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* | fix: implement sharding compatible cleanup for various bitsRobin Appelman2024-08-283-4/+8
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: only allow pre-defined shardsRobin Appelman2024-08-281-8/+30
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | feat: implement distributing partitioned queries over multiple shardsRobin Appelman2024-08-2818-21/+1247
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | feat: add option to automatically partition queries by specific tablesRobin Appelman2024-08-289-2/+970
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | feat: track expected output columns in query builderRobin Appelman2024-08-282-0/+33
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(db): Increase log level for very slow transactionsChristoph Wurst2024-08-271-2/+29
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-2512-47/+47
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* feat: expose escapeLikeParameter trough query builderRobin Appelman2024-08-231-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: fix passing additional db connection parameters in factoryRobin Appelman2024-07-311-25/+20
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #44788 from nextcloud/db-error-loggingStephan Orbaugh2024-07-253-4/+52
|\ | | | | feat: add additional logging for database errors
| * feat: add additional logging for database errorsRobin Appelman2024-07-243-4/+52
| | | | | | | | | | | | including the stack trace of the current database transaction Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix: cast to bigint on postgresqlRobin Appelman2024-07-231-1/+1
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(db): Fix md5 for oracle >= 20Joas Schilling2024-07-194-1/+23
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(db): Manually track if `where()` is called when not empty to avoid recursionJoas Schilling2024-07-191-19/+24
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(db): Deprecate `IExpressionBuilder::or()` and ↵Joas Schilling2024-07-194-28/+30
| | | | | | `IExpressionBuilder::and()` without parameters Signed-off-by: Joas Schilling <coding@schilljs.com>