This commit is contained in:
ArnabChatterjee20k
2026-04-09 17:07:47 +05:30
parent 0ea8379065
commit 4f599fc75c
5 changed files with 101 additions and 25 deletions
Generated
+4 -4
View File
@@ -3854,12 +3854,12 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "17615116013c18b8f4d00246d52268ffbc15b11c"
"reference": "0e43fd44f2190da36cac816a17650d697e034507"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/17615116013c18b8f4d00246d52268ffbc15b11c",
"reference": "17615116013c18b8f4d00246d52268ffbc15b11c",
"url": "https://api.github.com/repos/utopia-php/database/zipball/0e43fd44f2190da36cac816a17650d697e034507",
"reference": "0e43fd44f2190da36cac816a17650d697e034507",
"shasum": ""
},
"require": {
@@ -3905,7 +3905,7 @@
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/big-init"
},
"time": "2026-04-09T05:22:46+00:00"
"time": "2026-04-09T11:05:50+00:00"
},
{
"name": "utopia-php/detector",
@@ -93,13 +93,10 @@ class Create extends Action
throw new Exception($this->getInvalidValueException(), $validator->getDescription());
}
// `bigint` is always stored as a 64-bit integer.
$size = 8;
$attribute = $this->createAttribute($databaseId, $collectionId, new Document([
'key' => $key,
'type' => Database::VAR_BIGINT,
'size' => $size,
'size' => 8,
'required' => $required,
'default' => $default,
'array' => $array,
@@ -276,7 +276,16 @@ class Create extends Action
): array {
$key = $attribute['key'];
$type = $attribute['type'];
$size = $attribute['size'] ?? 0;
switch ($type) {
case Database::VAR_INTEGER:
$size = 4;
break;
case Database::VAR_BIGINT:
$size = 8;
break;
default:
$size = $attribute['size'] ?? 0;
}
$required = $attribute['required'] ?? false;
$signed = $attribute['signed'] ?? true;
$array = $attribute['array'] ?? false;
@@ -4,21 +4,56 @@ namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
class AttributeBigInt extends AttributeInteger
class AttributeBigInt extends Attribute
{
public array $conditions = [
'type' => 'bigint',
'size' => 8,
];
public function __construct()
{
parent::__construct();
// Update example for the `type` field
$this->rules['type']['example'] = 'bigint';
$this
->addRule('key', [
'type' => self::TYPE_STRING,
'description' => 'Attribute Key.',
'default' => '',
'example' => 'count',
])
->addRule('type', [
'type' => self::TYPE_STRING,
'description' => 'Attribute type.',
'default' => '',
'example' => 'bigint',
])
->addRule('min', [
'type' => self::TYPE_INTEGER,
'format' => 'int64',
'description' => 'Minimum value to enforce for new documents.',
'default' => null,
'required' => false,
'example' => 1,
])
->addRule('max', [
'type' => self::TYPE_INTEGER,
'format' => 'int64',
'description' => 'Maximum value to enforce for new documents.',
'default' => null,
'required' => false,
'example' => 10,
])
->addRule('default', [
'type' => self::TYPE_INTEGER,
'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.',
'default' => null,
'required' => false,
'example' => 10,
])
;
}
public array $conditions = [
'type' => 'bigint',
'size' => 8,
];
public function getName(): string
{
return 'AttributeBigInt';
@@ -4,21 +4,56 @@ namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
class ColumnBigInt extends ColumnInteger
class ColumnBigInt extends Column
{
public array $conditions = [
'type' => 'bigint',
'size' => 8,
];
public function __construct()
{
parent::__construct();
// Update example for the `type` field
$this->rules['type']['example'] = 'bigint';
$this
->addRule('key', [
'type' => self::TYPE_STRING,
'description' => 'Column Key.',
'default' => '',
'example' => 'count',
])
->addRule('type', [
'type' => self::TYPE_STRING,
'description' => 'Column type.',
'default' => '',
'example' => 'bigint',
])
->addRule('min', [
'type' => self::TYPE_INTEGER,
'format' => 'int64',
'description' => 'Minimum value to enforce for new documents.',
'default' => null,
'required' => false,
'example' => 1,
])
->addRule('max', [
'type' => self::TYPE_INTEGER,
'format' => 'int64',
'description' => 'Maximum value to enforce for new documents.',
'default' => null,
'required' => false,
'example' => 10,
])
->addRule('default', [
'type' => self::TYPE_INTEGER,
'description' => 'Default value for column when not provided. Cannot be set when column is required.',
'default' => null,
'required' => false,
'example' => 10,
])
;
}
public array $conditions = [
'type' => 'bigint',
'size' => 8,
];
public function getName(): string
{
return 'ColumnBigInt';