Commit Graph

176 Commits

Author SHA1 Message Date
Julius Härtl f49630f48c
Replace prefix in executeUpdate
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-03 11:03:02 +01:00
Roeland Jago Douma fe46149560
Psalm fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-10-30 19:27:53 +01:00
Roeland Jago Douma 28be188fbc
Update internal connection class
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>
2020-10-30 19:27:53 +01:00
Morris Jobke f12e7e0e95
Fetch the logger and system config once for all query builder instances
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-29 22:35:06 +01:00
Morris Jobke c1fd22b025
Merge pull request #23144 from nextcloud/enh/noid/update-param-for-psalm
Less psalm warnings
2020-10-06 22:07:58 +02:00
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +02:00
Daniel Kesselberg 0e3ddf1b27
Add explicit typecast for $value.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-10-03 17:15:14 +02:00
Daniel Kesselberg 64b10f61df
Update signature for set
also ILiteral and IQueryFunction are valid.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-10-02 19:15:34 +02:00
Daniel Kesselberg 8fdb74bdd5
Update signature for in/notIn
$y is always passed to quoteColumnName hence ILiteral|IParameter|IQueryFunction are supported.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-10-02 19:09:28 +02:00
Daniel Kesselberg d14c971ad6
Update signature for like/notLike/in/notIn
$x is always passed to quoteColumnName hence ILiteral|IParameter|IQueryFunction are supported.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-10-02 18:59:53 +02:00
Joas Schilling 3212c074b9
Log the number of queries built and executed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-25 14:55:53 +02:00
Morris Jobke 99c9423766
Remove @suppress SqlInjectionChecker
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-16 15:53:56 +02:00
Joas Schilling 50230847ce
Warn about adding NotNull columns with nullable default
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-07 13:14:49 +02:00
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +02:00
Morris Jobke fedf9c69d9
Use matching parameter names form interfaces and implementations
Found by Psalm 3.14.1

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-19 18:16:35 +02:00
Morris Jobke d7f66c36ac
Fix "misplaced variables" warning of Psalm in PHPDoc statements
Ref #21787

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-17 17:46:57 +02:00
Daniel Kesselberg 10ac844448
Update documentation for QueryBuilder::set
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-08-14 19:55:01 +02:00
Daniel Kesselberg 87dd760a89
Replace TYPE with TYPES
As TYPE::* is deprecated.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-06-30 23:46:22 +02:00
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Roeland Jago Douma cbcf072b23
Revert "Make sure MySQL is not saying 'this' = 'this ' is true" 2020-04-15 23:49:16 +02:00
Joas Schilling 16e9bf2309
Make sure MySQL is not saying 'this' = 'this ' is true
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-15 09:14:12 +02:00
Christoph Wurst 28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +02:00
Christoph Wurst 1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:51:06 +02:00
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>
2020-04-10 14:19:56 +02:00
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +02:00
Christoph Wurst 44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:07:47 +02:00
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02:00
Christoph Wurst 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +02:00
Christoph Wurst 2fbad1ed72
Fix (array) indent style to always use one tab
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 10:16:08 +02:00
Christoph Wurst 85e369cddb
Fix multiline comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-08 22:24:54 +02:00
Joas Schilling bc6a5ef5c4
Merge pull request #19890 from nextcloud/enh/comments-reference-id
Add optional comments reference_id
2020-04-02 11:34:21 +02:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Joas Schilling 720dc4e93d
Add optional column oc_comments.reference_id
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-03-31 10:51:15 +02:00
Christoph Wurst 463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +01:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Christoph Wurst 5fc4c91a76
Fix mismatching doc block parameter types
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-06 16:28:42 +01:00
Daniel Kesselberg 9e699a8d21
Add event subscriber for transaction isolation level
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-02-21 09:59:08 +01:00
Joas Schilling 059968e1c7
Pick a shorter name for the transfer ownership table
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-12-10 11:01:26 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma 76b78edd40
Merge pull request #17833 from nextcloud/propagator-no-negative-sizes
dont set folder size to negative values during propagation
2019-12-04 11:49:26 +01:00
Joas Schilling 19935a6a26
Merge pull request #17949 from nextcloud/debt/deprecated-const
Connection::TRANSACTION_READ_COMMITTED is deprecated
2019-12-04 09:49:41 +01:00
Robin Appelman 9e450d727a
add LEAST and GREATER to db function builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-26 12:05:30 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Daniel Kesselberg 9cb7252880
Connection::TRANSACTION_READ_COMMITTED is deprecated
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2019-11-14 20:17:27 +01:00
Robin Appelman ac209cea52
add count() as shortcut for count('*') in FunctionBuilder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-13 11:30:32 +01:00
Robin Appelman 0e9feeb090
return from QueryBuilder instead of IQueryBuilder
this make the type hints work properly with querybuilder subclasses

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-13 11:30:27 +01:00
Robin Appelman 8ef5a366ec
add MAX and MIN to functionbuilder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-09-06 12:28:17 +02:00
Arthur Schiwon d0409548c6
instead of upsert, fallback to default query on PgSQL <= 9.4
because there is no upsert yet

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-08-14 09:05:11 +02:00
Christoph Wurst 3174012adf Add event dispatcher to OCP
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-06-25 10:02:27 +02:00