You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new collection with a string attribute with required = true and give a max size of 255.
Try to update only the max size of this attribute using dart-sdk.
Sample code:
import'package:dart_appwrite/dart_appwrite.dart';
import'package:televolution_sync/appwrite/appwrite.dart';
voidmain() async {
final client =Client()
..setEndpoint(constants.endpoint)
..setProject(constants.projectId)
..setKey(constants.apiKey)
..setSelfSigned(status:true);
final databases =Databases(client);
final nameAttribute =await databases.getAttribute(
databaseId:'TEST',
collectionId:'TESTCOLLECTION',
key:'name',
);
print('nameAttribute = $nameAttribute');
// Output of above line:// nameAttribute = {key: name, type: string, status: available, error: , required: true, array: false, size: 255, default: null}/// Now, I will try to update the size to 1000 (previously 255)final updatedAttribute =await databases.updateStringAttribute(
databaseId:'TEST',
collectionId:'TESTCOLLECTION',
key:'name',
size:1000,
xdefault:null, // I also tried these values here: ("", "no name", null), but I get errors on all of them.
xrequired:true,
);
print('updatedAttribute = $updatedAttribute'); // Never reached this line
}
👍 Expected behavior
The attribute should be updated with the new size.
👎 Actual Behavior
Get an error related to default value:
If you try to keep null as the default value:
If you try to give some other default value (which shouldn't be the case, because the attribute is required by nature):
👟 Reproduction steps
string
attribute withrequired
= true and give a max size of 255.Sample code:
👍 Expected behavior
The attribute should be updated with the new size.
👎 Actual Behavior
Get an error related to default value:
If you try to keep
null
as the default value:If you try to give some other default value (which shouldn't be the case, because the attribute is required by nature):
🎲 Appwrite version
Different version (specify in environment)
💻 Operating system
Something else
🧱 Your Environment
Appwrite Cloud Version: 1.6.0
Dart Version:
3.1.5
Dart SDK Version:
dart_appwrite 12.1.0
The code doesn't work, neither from my local machine nor from an appwrite function.
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: