Back

String size limitation

  • 0
  • Databases
  • Flutter
Karthik
4 Sep, 2023, 12:25

How to create a string attribute without specifying size. If i want to store an article when i try to enter size 4000 i am getting an error about attribute size while creating. This error goes when i reduce the size of other attribute.

TL;DR
Issue: The user is encountering an error when adding a string attribute with a size longer than 768 characters in Appwrite. Solution: The maximum index size for string attributes in MariaDB is 768 characters, so if the attribute size exceeds this limit, only the 'fulltext' index can be added. To edit the size after creating the attribute without losing values, high values such as '> 65535' or '> 16777215' can be used. If an error occurs while adding an attribute, reducing the size of other attributes may resolve it.
Binyamin
4 Sep, 2023, 15:33

Go for really high values

  • > 65535
  • > 16777215

As you can see here from certain values Appwrite will use specify MariaDB type, so in your case aims toward LONGTEXT

Karthik
4 Sep, 2023, 17:09

Is there any way to edit size after creating attribute without losing values ?.

Binyamin
4 Sep, 2023, 17:10

Not currently You can track and upvote this issue

Karthik
5 Sep, 2023, 05:06

ok, any idea about the error i faced during adding attribute size ? .

Drake
5 Sep, 2023, 21:56

what was the exact error?

Karthik
6 Sep, 2023, 16:42

Actually i use appwrite cli to create collection. But during that time i deleted that collections multiple times. so after a few attempts i started getting this error while creating attribute it was something like attribute max exceed. Now i am not able to recreate that error i can save any size.

Drake
6 Sep, 2023, 17:46

could have been too many big attributes. since you're not facing this anymore, can this be closed?

Karthik
7 Sep, 2023, 08:01

what is mean by this error "Index length is longer than the maximum: 768" ?

Binyamin
7 Sep, 2023, 12:46

This is when you're trying to cerate index other then fulltext on a string attribute that is longer than 768 characters. Meaning when your string attribute is too long the only index you can add for it is the fulltext one As adding indexes longer than that aren't support by MariaDB and probably won't help performance wise.

Karthik
8 Sep, 2023, 09:12

ok thanks

Infinil
10 Sep, 2023, 05:26
Infinil
10 Sep, 2023, 05:27

i am getting that for 128 size array of strings attribute

Infinil
10 Sep, 2023, 06:34

but this is a big issue for me because I have been using Query.search() on a lot of array attributes

Infinil
10 Sep, 2023, 06:34

and that too because Query.equal() just doesnt work for arrays of ids

Drake
10 Sep, 2023, 06:41

You should πŸ‘ and comment in https://github.com/appwrite/appwrite/issues/6129

Keep in mind though, searching on array attributes was always a hack

Infinil
10 Sep, 2023, 07:31

okay

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more