Since the string type is deprecated I tried using varchar and text in some newer tables, but when running appwrite pull tables && appwrite types ./src/lib/appwrite/appwrite.ts I get:
ℹ Info: Fetching tables ...
? From which database would you like to pull collections? Skincare Buddy (skincare-buddy)
ℹ Info: Pulling all tables from Skincare Buddy database ...
✓ Success: Successfully pulled 7 tables from 1 tableDBs.
ℹ Info: Detected language: ts
ℹ Info: Found 7 tables: products, units, routines, regiments, steps, wishlist_products, profiles
ℹ Info: Found 35 columns across all tables
ℹ Info: For detailed error pass the --verbose or --report flag
✗ Error: ejs:24
22| <% const propertyName = strict ? toCamelCase(attribute.key) : attribute.key; -%>
23| <% const isValidIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(propertyName); -%>
>> 24| <% if (isValidIdentifier) { %><%- propertyName %><% } else { %>"<%- propertyName %>"<% } %>: <%- getType(attribute, collections, collection.name) %>;
25| <% } -%>
26| }<% if (index < collections.length - 1) { %>
27| <% } %>
Unknown attribute type: varchar
ELIFECYCLE Command failed with exit code 1.```
I have `appwrite@^21.5.0`.
Hey, The appwrite command comes from appwrite-cli npm package. The varchar/text type support in the types command is available from appwrite-cli@13.3.0 Please confirm which version are you using or you can try install to latest cli
You're spot on—the deprecation of the generic string type is part of the new TablesDB rollout! The error you're seeing happens because your current versions don't 'know' how to map the new SQL types (varchar, text, etc.) into TypeScript yet. You're running 21.5.0, but we recently released 23.0.0 and CLI 13.6.1 to handle exactly this. To fix this, you just need to bring everything up to date:
- Update your CLI:
npm install -g appwrite-cli
- Update your Project Dependencies:
npm install appwrite@latest
Once you're on the latest versions, run appwrite pull tables again. The type generator will now recognize varchar and text and map them correctly to TypeScript strings.
Thanks for being an early adopter of the new table structures—it really helps us polish the experience!
This will solve the issue
Oh shoot! I mixed up the appwrite and appwrite-cli packages and assumed upgrading appwrite should bring me on the latest CLI version! Installing appwrite-cli into the project's dev dependencies to get v14 and regenerating the types fixed the issue. Thanks!
Installing the latest CLI to my project's dev dependencies resolved this, thanks for your help! Really liking the tables so far!
On another note: It would be nice to see support for DISTINCT and generally more advanced JOIN queries e.g. to get the latest product unit in my project for example - is there a feature tracker somewhere? Because I couldn't find anything searching for issues with the type "Enhancement" and keywords "join" or "distinct". Would love to describe the use-case.
Hmm, GitHub's search might not be that great after all it looks like there's issues for Query join and Select distinct haha.
That’s awesome to hear! Glad the update got you back on track. TablesDB is definitely a huge step forward, and it's great to know it's working well for your project so far. Regarding DISTINCT and Advanced JOINs: You've hit on two of the most discussed topics in our roadmap right now! Because TablesDB is built to handle relational-style workloads, these features are high on our priority list. Where to track and contribute:
- GitHub Discussions: We use GitHub Discussions for high-level RFCs (Request for Comments) and architectural feedback. This is actually the best place to describe your specific use case for JOINs (like fetching the latest product unit), as it helps our engineers design the API to fit real-world scenarios.
- Feature Requests: If you want to open a formal issue, you can use the Feature Request template on GitHub Issues. Don't worry too much about specific labels like 'Enhancement'—our triaging team will categorise it once you submit! We'd love to hear more about your JOIN use case. The more detail you provide about your schema and the expected output, the better we can advocate for it internally! Looking forward to seeing your thoughts on GitHub!
https://github.com/appwrite/appwrite/discussions/5179 https://github.com/appwrite/appwrite/issues/10552 https://github.com/appwrite/appwrite/discussions/3545
Recommended threads
- sh: vite: Permission denied
When installing the vue starter template as site and then adding DaisyUI, i get the error `sh: vite: Permission denied`. I also got this issue (with a fresh tem...
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.
- All function deployments fail (node 18-2...
Error: bash: /usr/local/server/helpers/build-cache.sh: No such file or directory Sidecar error: Build archive was not created at /mnt/code/code.tar.gz Scope: ...