Carl Schwan
6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 anni fa
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 anni fa
Christoph Wurst
2c9cdc1cdb
Add our own DB exception abstraction
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>
3 anni fa
Christoph Wurst
8b64e92b92
Bump doctrine/dbal from 2.12.0 to 3.0.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 anni fa
Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 anni fa
Morris Jobke
99c9423766
Remove @suppress SqlInjectionChecker
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 anni fa
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 anni fa
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.
This also removes and empty lines from method/function bodies at the
beginning and end.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 anni fa
Christoph Wurst
5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 anni fa
Morris Jobke
f889beae7e
Fix PHPDoc
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 anni fa
Ole Ostergaard
0d778fcc4e
Code cleanup.
Signed-off-by: Ole Ostergaard <ole.c.ostergaard@gmail.com>
5 anni fa
Ole Ostergaard
d62da82bf9
Add supression of SqlInjectionChecker.
Signed-off-by: Ole Ostergaard <ole.c.ostergaard@gmail.com>
5 anni fa
Ole Ostergaard
a48ea8cffa
Add insertIgnoreConflict to Adapter and use it for for executing the file locking.
Signed-off-by: Ole Ostergaard <ole.c.ostergaard@gmail.com>
5 anni fa
Morris Jobke
5273639d0e
Add deprecation message ofr insertIfNotExist
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 anni fa
Morris Jobke
230e93f575
Catch UniqueConstraintViolationException inside insertIfNotExist
This is the most common case for the usage of this method.
See also https://github.com/nextcloud/server/issues/12369 and the linked tickets.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 anni fa
Morris Jobke
e6efa755c9
Use short for of substr to not need strlen()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 anni fa
Joas Schilling
0215b004da
Update with robin
8 anni fa
Joas Schilling
ba87db3fcc
Fix others
8 anni fa
Joas Schilling
7e3ce83526
Add a method to lock a table
8 anni fa
Roeland Jago Douma
d09f835dca
Move \OC\DB to PSR-4
Besides the statement wrapper that is moved to the legacy folder
(namepsace of shame folder)
8 anni fa
Thomas Müller
682821c71e
Happy new year!
8 anni fa
Jenkins for ownCloud
b585d87d9d
Update license headers
9 anni fa
Joas Schilling
c2a5bd6a01
Also add a note that clob does not work in the compare array
9 anni fa
Joas Schilling
fefcbb966b
Also use all keys for an empty array, just in case
9 anni fa
Joas Schilling
d1511cdbee
Fix doc blocks of insertIfNotExists() method
9 anni fa
Thomas Müller
89be55a672
let insertIfNotExist() throw the native DBALException - no need to hide the real exception
9 anni fa
Joas Schilling
8fa692388b
Allow specifying the compare-array for insertIfNotExists()
9 anni fa
Morris Jobke
06aef4e8b1
Revert "Updating license headers"
This reverts commit 6a1a4880f0
.
9 anni fa
Jenkins for ownCloud
6a1a4880f0
Updating license headers
9 anni fa
Arthur Schiwon
74ffda8261
do not output DB information, and do not set header
9 anni fa
Arthur Schiwon
08205c63f9
errors are already logged
9 anni fa
Arthur Schiwon
7ed678b04d
eliminate OC_Template::printErrorPage in database classes, fixes #12182
9 anni fa
Lukas Reschke
af335a39f1
Add PHPDoc about sanitization of "insertIfNotExist"
Let's document this potential pitfall properly.
9 anni fa
Jonny007-MKD
4161fd2408
Update adapter.php
Modified insertIfNotExist() to support NULL values
11 anni fa
Morris Jobke
dc36d30953
Remove all occurences of @brief and @returns from PHPDoc
* test case added to avoid adding them later
10 anni fa
Thomas Müller
9c9dc276b7
move the private namespace OC into lib/private - OCP will stay in lib/public
Conflicts:
lib/private/vcategories.php
10 anni fa
Bart Visscher
3eb5fff02a
Add documentation to OC\DB\adapter class
11 anni fa
Bart Visscher
be7c613993
Fix errors from unit tests
11 anni fa
Bart Visscher
b66c9098bd
Correct namespace of OC_ classes
11 anni fa
Bart Visscher
19b9c89634
Move insertIfNotExist to Connection wrapper
Real implementation is in DB\Adapter* classes
11 anni fa
Bart Visscher
58991150ab
Move query statement fixup handling to Connection wrapper
11 anni fa
Bart Visscher
e3c5fea989
Move lastInsertId to adapter classes
11 anni fa
Bart Visscher
66a215651b
Create DB Connection wrapper and DB\Adapter* classes
11 anni fa