Changes for beta10 (#5)
- Add In/InArray support - Add ORDER BY support for `Find` functions - Update dependencies - Implement fixes identified via static analysis Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
1 parent
9e0e663811
commit
d067f8983f
66 files changed
+1728
-664
No files matched your search
+9
-9
@@ -18,7 +18,7 @@ class Patch
|
||||
*
|
||||
* @param string $tableName The table in which the document should be patched
|
||||
* @param mixed $docId The ID of the document to be patched
|
||||
* @param array|object $patch The object with which the document should be patched (will be JSON-encoded)
|
||||
* @param mixed[]|object $patch The object with which the document should be patched (will be JSON-encoded)
|
||||
* @throws DocumentException If any is encountered (database mode must be set)
|
||||
*/
|
||||
public static function byId(string $tableName, mixed $docId, array|object $patch): void
|
||||
@@ -31,25 +31,25 @@ class Patch
|
||||
* Patch documents using a comparison on JSON fields
|
||||
*
|
||||
* @param string $tableName The table in which documents should be patched
|
||||
* @param array|Field[] $fields The field comparison to match
|
||||
* @param array|object $patch The object with which the documents should be patched (will be JSON-encoded)
|
||||
* @param Field[] $fields The field comparison to match
|
||||
* @param mixed[]|object $patch The object with which the documents should be patched (will be JSON-encoded)
|
||||
* @param FieldMatch|null $match How to handle multiple conditions (optional; defaults to All)
|
||||
* @throws DocumentException If any is encountered
|
||||
*/
|
||||
public static function byFields(string $tableName, array $fields, array|object $patch,
|
||||
?FieldMatch $match = null): void
|
||||
{
|
||||
$namedFields = Parameters::nameFields($fields);
|
||||
Custom::nonQuery(Query\Patch::byFields($tableName, $namedFields, $match),
|
||||
Parameters::addFields($namedFields, Parameters::json(':data', $patch)));
|
||||
Parameters::nameFields($fields);
|
||||
Custom::nonQuery(Query\Patch::byFields($tableName, $fields, $match),
|
||||
Parameters::addFields($fields, Parameters::json(':data', $patch)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch documents using a JSON containment query (`@>`; PostgreSQL only)
|
||||
*
|
||||
* @param string $tableName The table in which documents should be patched
|
||||
* @param array|object $criteria The JSON containment query values to match
|
||||
* @param array|object $patch The object with which the documents should be patched (will be JSON-encoded)
|
||||
* @param mixed[]|object $criteria The JSON containment query values to match
|
||||
* @param mixed[]|object $patch The object with which the documents should be patched (will be JSON-encoded)
|
||||
* @throws DocumentException If the database mode is not PostgreSQL, or if an error occurs
|
||||
*/
|
||||
public static function byContains(string $tableName, array|object $criteria, array|object $patch): void
|
||||
@@ -63,7 +63,7 @@ class Patch
|
||||
*
|
||||
* @param string $tableName The table in which documents should be patched
|
||||
* @param string $path The JSON Path match string
|
||||
* @param array|object $patch The object with which the documents should be patched (will be JSON-encoded)
|
||||
* @param mixed[]|object $patch The object with which the documents should be patched (will be JSON-encoded)
|
||||
* @throws DocumentException If the database mode is not PostgreSQL, or if an error occurs
|
||||
*/
|
||||
public static function byJsonPath(string $tableName, string $path, array|object $patch): void
|
||||
|
||||
Reference in new issue
Block a user