mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Replace databasesBatchSize with databasesTransactionSize in database operations
Co-authored-by: jakeb994 <jakeb994@gmail.com>
This commit is contained in:
@@ -31,6 +31,7 @@ const APP_LIMIT_WRITE_RATE_DEFAULT = 60; // Default maximum write rate per rate
|
||||
const APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT = 60; // Default maximum write rate period in seconds
|
||||
const APP_LIMIT_LIST_DEFAULT = 25; // Default maximum number of items to return in list API calls
|
||||
const APP_LIMIT_DATABASE_BATCH = 100; // Default maximum batch size for database operations
|
||||
const APP_LIMIT_DATABASE_TRANSACTION = 100; // Default maximum operations per transaction
|
||||
const APP_KEY_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_USER_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ class Decrement extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + 1) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ class Increment extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + 1) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ class Delete extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + 1) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ class Update extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + 1) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ class Upsert extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + \count($documents)) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ class Create extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + \count($documents)) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ class Delete extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + 1) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ class Update extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + 1) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ class Upsert extends Action
|
||||
}
|
||||
|
||||
// Enforce max operations per transaction
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
if (($existing + 1) > $maxBatch) {
|
||||
throw new Exception(
|
||||
|
||||
@@ -67,7 +67,7 @@ class AddOperations extends Action
|
||||
throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Invalid or non‑pending transaction');
|
||||
}
|
||||
|
||||
$maxBatch = $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH;
|
||||
$maxBatch = $plan['databasesTransactionSize'] ?? APP_LIMIT_DATABASE_TRANSACTION;
|
||||
$existing = $transaction->getAttribute('operations', 0);
|
||||
|
||||
if (($existing + \count($operations)) > $maxBatch) {
|
||||
|
||||
Reference in New Issue
Block a user