summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
Commit message (Collapse)AuthorAgeFilesLines
* Do not check Oracle column constraints in unrelated migrationsChristoph Wurst2021-04-191-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Rename the method to match what it doesJoas Schilling2021-03-311-3/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Don't allow Notnull for boolean columnsJoas Schilling2021-03-311-0/+5
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Document the constraints we test againstJoas Schilling2021-03-311-0/+17
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix exception messages spacingJoas Schilling2021-03-311-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Cleanup unneeded code around database.xmlMorris Jobke2021-03-243-520/+24
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #24384 from nextcloud/cleanup/remove-old-migration-checkMorris Jobke2021-03-174-138/+5
|\ | | | | Remove dead code from checking core/apps before upgrades
| * Skip db migration simulation for core schema changesJulius Härtl2021-03-174-138/+5
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Merge pull request #25924 from ↵Morris Jobke2021-03-171-2/+4
|\ \ | |/ |/| | | | | nextcloud/bugfix/noid/only-mark-migrations-as-installed-after-executing-them-in-case-the-developer-broke-them Only mark migrations as installed after execution
| * Only mark migrations as installed after executionJoas Schilling2021-03-041-2/+4
| | | | | | | | | | | | | | The problem is that if a developer creates a structural error in their migration file, they will already be marked as executed and an not be rerun. Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Merge pull request #25929 from nextcloud/techdept/psalm/25839/redundantcastsRoeland Jago Douma2021-03-051-2/+2
|\ \ | | | | | | Remove Redundantcasts
| * | Remove RedundantcastsRoeland Jago Douma2021-03-041-2/+2
| |/ | | | | | | | | | | For #25839 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Type CompositeExpression and ICompositeExpressionRoeland Jago Douma2021-03-041-5/+5
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Add executeQuery and executeUpdateRoeland Jago Douma2021-03-041-0/+37
|/ | | | | | | | | | | Names shamelessly copied from Doctrine itself. Internally it is still using the same flow. But I added some checks around it. This should make static analysis a bit more happy. Which in turn makes me more happy. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #25656 from nextcloud/enh/type/expressionbuilderJoas Schilling2021-03-035-49/+51
|\ | | | | Type the experssionbuilders
| * Type the experssionbuildersRoeland Jago Douma2021-03-035-49/+51
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Merge pull request #25816 from nextcloud/iquerybuilder-join-conditionsJoas Schilling2021-03-031-5/+6
|\ \ | | | | | | allow non string join conditions in query builder
| * | allow non string join conditions in query builderRobin Appelman2021-03-031-5/+6
| |/ | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* / Filter tables with other table prefixDaniel Kesselberg2021-03-021-4/+4
|/ | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-181-1/+1
| | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [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/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* When it kicks inJoas Schilling2021-02-181-7/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* remove ReconnectWrapperRobin Appelman2021-02-092-56/+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>
* Check for generic errors at last.Daniel Kesselberg2021-02-021-13/+13
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Merge pull request #25091 from ↵Christoph Wurst2021-01-145-24/+272
|\ | | | | | | | | nextcloud/enhancement/ocp-db-exception-abstraction Add our own DB exception abstraction
| * Add our own DB exception abstractionChristoph Wurst2021-01-125-24/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge pull request #25036 from nextcloud/fix/noid/limitied-allowed-items-db-in_2blizzz2021-01-141-0/+30
|\ \ | |/ |/| respect DB restrictions on number of arguments in statements and queries
| * DB: warn on parameter number constraintsArthur Schiwon2021-01-111-0/+30
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | Don't try a transaction for the migrator on MySQLJoas Schilling2021-01-081-2/+7
|/ | | | | | | | | | | | | As per https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html CREATE TABLE statements automatically commit always. The only reason this worked in the past was that PHPs PDO connection didn't check the actual state on commit, but only checked their internal state. But in PHP8 this was fixed: https://github.com/php/php-src/blob/PHP-8.0/UPGRADING#L446-L450 So now commit() fails because the internal PDO connection implicitly commited already. Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove "primary" option from schema builder argument $options as it is not ↵Morris Jobke2021-01-081-1/+9
| | | | | | | | used anymore and triggers an exception See https://github.com/doctrine/dbal/commit/138eb85234a1faeaa2e6a32cd7bcc66bb51c64e8#diff-300f55366adb50a32a40882ebdc95c163b141f64cba5f45f20bda04a907b3eb3L82 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-0821-357/+491
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2020-12-301-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #22916 from J0WI/unifiy-links-to-php.netRoeland Jago Douma2020-12-221-1/+1
|\ | | | | Unify links to php.net
| * Unify links to php.netJ0WI2020-09-171-1/+1
| | | | | | | | | | | | Update all links to https://www.php.net/ Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | Update all license headers for Nextcloud 21Christoph Wurst2020-12-1610-6/+10
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Merge pull request #24631 from ↵Joas Schilling2020-12-141-0/+21
|\ \ | | | | | | | | | | | | nextcloud/bugfix/noid/prevent-select-asterix-and-specifics Prevent * and other things in the same query for Oracle
| * | Prevent * and other things in the same query for OracleJoas Schilling2020-12-141-0/+21
| | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | Make sure the migrations table schema is always checkedJulius Härtl2020-12-091-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net> Revert "Make sure the migrations table schema is always checked" This reverts commit 258955ef738a52d9da2ac2fe59466e6093d7e9bc. Set current vendor during upgrade and perform migrations table change if needed Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Make debugging migration exceptions easierJoas Schilling2020-12-071-1/+8
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Prevent log_query to mess up regular execution flowVincent Petry2020-12-021-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | When the "log_query" debug config parameter is set, SQL queries are logged. However, if an error occurs when converting the values to string, it will abort the request. This fix catches the error and continues instead. Also added handler for DateTime value which is already known to cause aborts here. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* | Merge pull request #24062 from ↵Morris Jobke2020-11-202-0/+47
|\ \ | | | | | | | | | | | | nextcloud/revert-24060-revert-24039-faster-installation Revert "Revert "Installation goes brrrr""
| * | Don't drop the table anymore when we create it againJoas Schilling2020-11-161-0/+1
| | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
| * | Revert "Revert "Installation goes brrrr""Joas Schilling2020-11-111-0/+46
| | |
* | | Merge pull request #24007 from nextcloud/select-distinct-multipleMorris Jobke2020-11-191-1/+7
|\ \ \ | | | | | | | | allow selecting multiple columns with SELECT DISTINCT
| * | | allow selecting multiple columns with SELECT DISTINCTRobin Appelman2020-11-161-1/+7
| |/ / | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* / / Add types to function builderJoas Schilling2020-11-164-43/+20
|/ / | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Revert "Installation goes brrrr"Christoph Wurst2020-11-111-46/+0
| |
* | Don't create a schema to check if the migrations table existsJoas Schilling2020-11-111-0/+5
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Reduce the number of schemas we generate when we just run all migrations anywayJoas Schilling2020-11-111-0/+41
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Create primary keys on all tables and add a command to create the afterwardsJoas Schilling2020-11-101-0/+42
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | 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>