Back

Modifying Attribute Size

  • 0
  • Databases
  • Cloud
Sonicviz
10 Jun, 2024, 04:15

I have two questions related to this.

Q1: It says on the web answer https://appwrite.io/threads/1228464082269765633 that redirects to this thread that the solution is "Solution: 1. For flexibility in field size, consider using variable length fields without defining a specific size." However, you can't set strings to be variable length as far as I know? How do you do that?

Q2: Related to Q1, I'm also hitting errors trying to store a string that's bigger than the current attribute size. eg: xxxx.vue:385 AppwriteException: Invalid document structure: Attribute "name" has invalid type. Value must be a valid string and no longer than 20 chars at Client.eval I was assuming this would automatically get truncated but it throws an error instead. Are we supposed to do this checking as part of client side validation/sanitisation before storing? If so, how can you easily retrieve the attribute sizes client side so you don't have to hard code them to keep things synched in case of future changes? Modifying Attribute size - Threads - Appwrite In this support thread for Appwrite, the user is facing issues modifying attribute sizes in a database during the development stage. They are concerned about potentially needing to delete and re-enter attributes in production if the size needs to increase. The user is used to environments where field sizes are variable and wonders if creating la... Modifying Attribute size - Threads - Appwrite

Sonicviz β€” 07/06/2024 18:10 Also, according to this https://github.com/appwrite/appwrite/issues/3328 you should be able to update attributes but key and size are always uneditable, and you can only delete and recreate if you need to modify these. GitHub πŸš€ Feature: Update database attribute Β· Issue #3328 Β· appwrite/appwr... πŸ‘Ÿ Reproduction steps When we put wrong attribute in database section πŸ‘ Expected behavior we should be able to edit the attributes of a database collection. πŸ‘Ž Actual Behavior their is only delete bu...

TL;DR
Developers are having issues modifying attribute sizes in Appwrite. They can't figure out how to set string fields to be variable length and are experiencing errors when trying to store a string larger than the current attribute size. According to a support thread, they might need to handle client-side validation/sanitization themselves and retrieve attribute sizes to avoid hard-coding. The solution provided is to consider using variable length fields without specifying a size. Additionally, while attributes can be updated, key and size are uneditable in Appwrite, requiring developers to delete and recreate them if modification is needed.
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