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
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- [SOLVED] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...