File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ This is a single file application! Upload "api.php" somewhere and enjoy!
51
51
- Pagination, sorting and column selection
52
52
- Relation detection and filtering on foreign keys
53
53
- Relation "transforms" for PHP and JavaScript
54
+ - Atomic increment and decrement support via PATCH
54
55
- Binary fields supported with base64 encoding
55
56
- Spatial/GIS fields and filters supported with WKT
56
57
- Generate API documentation using Swagger tools
@@ -627,6 +628,25 @@ The code also supports multi-database API's. These have URLs where the first seg
627
628
This can be enabled by NOT specifying a database in the configuration. Also the permissions in the configuration should contain a dot
628
629
character to seperate the database from the table name. The databases 'mysql', 'information_schema' and 'sys' are automatically blocked.
629
630
631
+ ## Atomic increment
632
+
633
+ Incrementing a numeric field of a record is done with the PATCH method.
634
+ Decrementing can be done using a negative increment value.
635
+ The call returns the rows affected.
636
+
637
+ ```
638
+ PATCH http://localhost/api.php/events/1
639
+ visitors=1
640
+ ```
641
+
642
+ Output:
643
+
644
+ ```
645
+ 1
646
+ ```
647
+
648
+ Note that non-numeric fields will not be affected.
649
+
630
650
## Binary data
631
651
632
652
Binary fields are automatically detected and data in those fields is returned using base64 encoding.
You can’t perform that action at this time.
0 commit comments