Back

[SOLVED] Can I start the database by functions?

  • 0
  • Self Hosted
  • Flutter
  • Databases
  • Functions
Nathanael Ferreira
22 Mar, 2024, 19:17

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(); } }

TL;DR
Developers were unsure if they could start the database via functions. The solution was found.
VincentGe
22 Mar, 2024, 19:27

You can use an Appwrite Function, but you can also just run this script locally using a server SDK

Nathanael Ferreira
22 Mar, 2024, 19:33

Thank you. I will try just run locally.

Nathanael Ferreira
23 Mar, 2024, 20:00

[SOLVED] Can I start the database by functions?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more