summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-06-13 11:55:37 +0200
committerGitHub <noreply@github.com>2022-06-13 11:55:37 +0200
commit8809de1eefbfa78998d9379a7040858d8e01e820 (patch)
tree4e58c2153749cb486472efc8bcc220318c0f50a0 /lib/public
parentc26ddf10de489fe86be6232d9d409b3acb930cec (diff)
parent8238582e59b7b6ec03318bcf81bf47cce54af320 (diff)
downloadnextcloud-server-8809de1eefbfa78998d9379a7040858d8e01e820.tar.gz
nextcloud-server-8809de1eefbfa78998d9379a7040858d8e01e820.zip
Merge pull request #31966 from nextcloud/unencrypted-size
store unencrypted size in the unencrypted_size column
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/DB/QueryBuilder/IExpressionBuilder.php64
-rw-r--r--lib/public/DB/QueryBuilder/IFunctionBuilder.php12
-rw-r--r--lib/public/DB/QueryBuilder/IQueryBuilder.php8
-rw-r--r--lib/public/Files/Cache/ICacheEntry.php10
4 files changed, 58 insertions, 36 deletions
diff --git a/lib/public/DB/QueryBuilder/IExpressionBuilder.php b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
index 53dc1fa5a7f..8f7cd10dee5 100644
--- a/lib/public/DB/QueryBuilder/IExpressionBuilder.php
+++ b/lib/public/DB/QueryBuilder/IExpressionBuilder.php
@@ -107,7 +107,7 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
@@ -115,7 +115,7 @@ interface IExpressionBuilder {
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function comparison($x, string $operator, $y, $type = null): string;
+ public function comparison($x, string $operator, $y, $type = null): IQueryFunction;
/**
* Creates an equality comparison expression with the given arguments.
@@ -132,14 +132,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function eq($x, $y, $type = null): string;
+ public function eq($x, $y, $type = null): IQueryFunction;
/**
* Creates a non equality comparison expression with the given arguments.
@@ -155,14 +155,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function neq($x, $y, $type = null): string;
+ public function neq($x, $y, $type = null): IQueryFunction;
/**
* Creates a lower-than comparison expression with the given arguments.
@@ -178,14 +178,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function lt($x, $y, $type = null): string;
+ public function lt($x, $y, $type = null): IQueryFunction;
/**
* Creates a lower-than-equal comparison expression with the given arguments.
@@ -201,14 +201,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function lte($x, $y, $type = null): string;
+ public function lte($x, $y, $type = null): IQueryFunction;
/**
* Creates a greater-than comparison expression with the given arguments.
@@ -224,14 +224,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function gt($x, $y, $type = null): string;
+ public function gt($x, $y, $type = null): IQueryFunction;
/**
* Creates a greater-than-equal comparison expression with the given arguments.
@@ -247,38 +247,38 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function gte($x, $y, $type = null): string;
+ public function gte($x, $y, $type = null): IQueryFunction;
/**
* Creates an IS NULL expression with the given arguments.
*
* @param string|ILiteral|IParameter|IQueryFunction $x The field in string format to be restricted by IS NULL.
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0
*
* @psalm-taint-sink sql $x
*/
- public function isNull($x): string;
+ public function isNull($x): IQueryFunction;
/**
* Creates an IS NOT NULL expression with the given arguments.
*
* @param string|ILiteral|IParameter|IQueryFunction $x The field in string format to be restricted by IS NOT NULL.
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0
*
* @psalm-taint-sink sql $x
*/
- public function isNotNull($x): string;
+ public function isNotNull($x): IQueryFunction;
/**
* Creates a LIKE() comparison expression with the given arguments.
@@ -288,14 +288,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function like($x, $y, $type = null): string;
+ public function like($x, $y, $type = null): IQueryFunction;
/**
* Creates a NOT LIKE() comparison expression with the given arguments.
@@ -305,14 +305,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function notLike($x, $y, $type = null): string;
+ public function notLike($x, $y, $type = null): IQueryFunction;
/**
* Creates a ILIKE() comparison expression with the given arguments.
@@ -322,14 +322,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function iLike($x, $y, $type = null): string;
+ public function iLike($x, $y, $type = null): IQueryFunction;
/**
* Creates a IN () comparison expression with the given arguments.
@@ -339,14 +339,14 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function in($x, $y, $type = null): string;
+ public function in($x, $y, $type = null): IQueryFunction;
/**
* Creates a NOT IN () comparison expression with the given arguments.
@@ -356,36 +356,36 @@ interface IExpressionBuilder {
* @param mixed|null $type one of the IQueryBuilder::PARAM_* constants
* required when comparing text fields for oci compatibility
*
- * @return string
+ * @return IQueryFunction
* @since 8.2.0 - Parameter $type was added in 9.0.0
*
* @psalm-taint-sink sql $x
* @psalm-taint-sink sql $y
* @psalm-taint-sink sql $type
*/
- public function notIn($x, $y, $type = null): string;
+ public function notIn($x, $y, $type = null): IQueryFunction;
/**
* Creates a $x = '' statement, because Oracle needs a different check
*
* @param string|ILiteral|IParameter|IQueryFunction $x The field in string format to be inspected by the comparison.
- * @return string
+ * @return IQueryFunction
* @since 13.0.0
*
* @psalm-taint-sink sql $x
*/
- public function emptyString($x): string;
+ public function emptyString($x): IQueryFunction;
/**
* Creates a `$x <> ''` statement, because Oracle needs a different check
*
* @param string|ILiteral|IParameter|IQueryFunction $x The field in string format to be inspected by the comparison.
- * @return string
+ * @return IQueryFunction
* @since 13.0.0
*
* @psalm-taint-sink sql $x
*/
- public function nonEmptyString($x): string;
+ public function nonEmptyString($x): IQueryFunction;
/**
diff --git a/lib/public/DB/QueryBuilder/IFunctionBuilder.php b/lib/public/DB/QueryBuilder/IFunctionBuilder.php
index d4edc8ea9f8..811e8d06aaf 100644
--- a/lib/public/DB/QueryBuilder/IFunctionBuilder.php
+++ b/lib/public/DB/QueryBuilder/IFunctionBuilder.php
@@ -188,4 +188,16 @@ interface IFunctionBuilder {
* @since 18.0.0
*/
public function least($x, $y): IQueryFunction;
+
+ /**
+ * Takes the minimum of multiple values
+ *
+ * If you want to get the minimum value of all rows in a column, use `min` instead
+ *
+ * @param array<array{"when": string|ILiteral|IParameter|IQueryFunction, "then": string|ILiteral|IParameter|IQueryFunction}> $whens
+ * @param string|ILiteral|IParameter|IQueryFunction $else
+ * @return IQueryFunction
+ * @since 18.0.0
+ */
+ public function case(array $whens, $else): IQueryFunction;
}
diff --git a/lib/public/DB/QueryBuilder/IQueryBuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php
index 218b7d8cb2d..446e9a00b4c 100644
--- a/lib/public/DB/QueryBuilder/IQueryBuilder.php
+++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php
@@ -503,7 +503,7 @@ interface IQueryBuilder {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
- * @param string|ICompositeExpression|null $condition The condition for the join.
+ * @param string|IQueryFunction|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
@@ -528,7 +528,7 @@ interface IQueryBuilder {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
- * @param string|ICompositeExpression|null $condition The condition for the join.
+ * @param string|IQueryFunction|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
@@ -553,7 +553,7 @@ interface IQueryBuilder {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
- * @param string|ICompositeExpression|null $condition The condition for the join.
+ * @param string|IQueryFunction|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
@@ -578,7 +578,7 @@ interface IQueryBuilder {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
- * @param string|ICompositeExpression|null $condition The condition for the join.
+ * @param string|IQueryFunction|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
diff --git a/lib/public/Files/Cache/ICacheEntry.php b/lib/public/Files/Cache/ICacheEntry.php
index 17eecf89ddb..e1e8129394c 100644
--- a/lib/public/Files/Cache/ICacheEntry.php
+++ b/lib/public/Files/Cache/ICacheEntry.php
@@ -162,4 +162,14 @@ interface ICacheEntry extends ArrayAccess {
* @since 18.0.0
*/
public function getUploadTime(): ?int;
+
+ /**
+ * Get the unencrypted size
+ *
+ * This might be different from the result of getSize
+ *
+ * @return int
+ * @since 25.0.0
+ */
+ public function getUnencryptedSize(): int;
}