I'm using the node-appwrite SDK to create a table, the column payload looks like this:
[{"key":"email","type":"email","required":true, "size": 512}]
But I'm getting the error Invalid type for attribute 'email': email
Checking the appwrite source code, I see this as supported types: https://github.com/appwrite/appwrite/blob/a6d30130ba04e436ec46b8de4138af523079a8a2/src/Appwrite/Utopia/Database/Validator/Attributes.php#L23-L32
If I try to string as type it creates the table as expected, do we have missing types or I'm doing something wrong?
The docs example do the same as I'm doing
https://appwrite.io/docs/products/databases/tables
node-appwrite SDK: v26.2.0
<@1356535431834898634> can you take a look at this? ๐
Adding more information:
https://appwrite.io/docs/references/cloud/server-nodejs/tablesDB#createTable the documentation says:
Columns
Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
The response model for createTable define the columns with:
Table columns.
Can be one of:
ColumnBoolean model, ColumnInteger model, ColumnFloat model, ColumnEmail model, ColumnEnum model, ColumnURL model, ColumnIP model, ColumnDatetime model, ColumnRelationship model, ColumnPoint model, ColumnLine model, ColumnPolygon model, ColumnString model
Changing the type to string and adding the format param solves the problem, the issue is only in the documentation, as format isn't mentioned
Recommended threads
- Git connection is not working anymore on...
Hello all, I updated from 1.8.1 to 1.9.0 then 1.9.5. All seems to work even the Github connection. In Git configuration I see my Github user but when trying to...
- Self-Hosted and Multi Region support
Hey Appwrite Team, As a test and to expand self-hosted capabilities even more, i was thinking of understanding and testing how to deploy a multi-region instanc...
- Auth not working
guys my appwrite auth isnt working? oauth works (Sign in with google n discord) i have 2 websites deployed where do i get help when i do sign in with email and ...