I'm migrating a Fastify/TypeScript backend to AppWrite.
I would like to know if it is a good practice to use functions to create the database structure.
Currently I'm not having a good experience with the Console. So I would like to know if it would be possible to use something like the image and then do the creation loop in main.
Future<dynamic> main(final context) async { final client = Client() .setEndpoint(Platform.environment['_APP_DOMAIN']!) .setProject(Platform.environment['PROJECT_ID']) .setKey(Platform.environment['API_KEY']);
final plans = Plans(Databases(client)); if (await plans.needCreate()) { await plans.create(); } }
You can use an Appwrite Function, but you can also just run this script locally using a server SDK
Thank you. I will try just run locally.
[SOLVED] Can I start the database by functions?
Recommended threads
- Query multi-tenant db with $permissions ...
I'm setting up a multi-tenant database with RLS enabled. My users my have permissions set for multiple Teams, and as such when they query the database with the ...
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...