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
- DeploymentStatus enum value `canceled` m...
Hey, Sorry if it has been reported already, I found an issue using the Dart SDK where the `canceled` enum value is missing from `DeploymentStatus`. This causes...
- Synchronous function execution timeout w...
I am calling server functions with xasync = true and I still get this error message. Synchronous function execution timed out. Use asynchronous execution inste...
- Flutter OAuth2 webAuth Bug?
I created with flutter an app where I can login in with my Microsoft Account. When I compile it to Web (WASM) or Android (aab) then there is no problem what so ...