summaryrefslogtreecommitdiffstats
path: root/lib/private/DB
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | Fix comparing the empty string for global credentialsJoas Schilling2020-11-101-5/+11
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Merge pull request #23923 from ↵Roeland Jago Douma2020-11-073-0/+69
|\ \ | | | | | | | | | | | | nextcloud/bugfix/oci/fix-greatest-order-for-oracle Fix greatest/least order for oracle
| * | Update parametersJoas Schilling2020-11-073-2/+28
| | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
| * | Make sure Oracle always casts everything in the best wayJoas Schilling2020-11-061-0/+43
| | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | Fix iLike() falsely turning escaped % and _ into wildcardsJoas Schilling2020-11-061-3/+1
| | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | Fix casting to integer on OracleJoas Schilling2020-11-061-0/+4
|/ / | | | | | | 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-303-25/+29
| | | | | | | | 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>
* | Merge pull request #23144 from nextcloud/enh/noid/update-param-for-psalmMorris Jobke2020-10-062-9/+11
|\ \ | | | | | | Less psalm warnings
| * | Add explicit typecast for $value.Daniel Kesselberg2020-10-031-2/+2
| | | | | | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
| * | Update signature for setDaniel Kesselberg2020-10-021-1/+2
| | | | | | | | | | | | | | | | | | also ILiteral and IQueryFunction are valid. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
| * | Update signature for in/notInDaniel Kesselberg2020-10-021-2/+2
| | | | | | | | | | | | | | | | | | $y is always passed to quoteColumnName hence ILiteral|IParameter|IQueryFunction are supported. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
| * | Update signature for like/notLike/in/notInDaniel Kesselberg2020-10-021-4/+5
| |/ | | | | | | | | | | $x is always passed to quoteColumnName hence ILiteral|IParameter|IQueryFunction are supported. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Format code to a single space around binary operatorsChristoph Wurst2020-10-054-5/+5
| | | | | | | | 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-163-7/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Warn about adding NotNull columns with nullable defaultJoas Schilling2020-09-071-0/+5
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-242-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use matching parameter names form interfaces and implementationsMorris Jobke2020-08-191-8/+8
| | | | | | Found by Psalm 3.14.1 Signed-off-by: Morris Jobke <hey@morrisjobke.de>