Skip to content
Back

TablesDB can't be used in Appwrite Functions ?

  • 0
  • 2
  • Functions
SylvainJack
14 Mar, 2026, 17:20

I have written a function (DART) and it won't deploy. Here is what I get : 2026-03-14T17:09:41.459693680Z Compiling ... 2026-03-14T17:09:42.915619217Z ../build/lib/main.dart:14:3: Error: 'TablesDB' isn't a type. 2026-03-14T17:09:42.915658150Z TablesDB tablesDB = TablesDB(client); 2026-03-14T17:09:42.915662412Z ^^^^^^^^ 2026-03-14T17:09:42.915666286Z ../build/lib/main.dart:14:23: Error: Method not found: 'TablesDB'. 2026-03-14T17:09:42.915669114Z TablesDB tablesDB = TablesDB(client); 2026-03-14T17:09:42.915673757Z ^^^^^^^^ 2026-03-14T17:09:42.915712899Z Error: AOT compilation failed 2026-03-14T17:09:42.915717369Z Bad state: Generating AOT kernel dill failed!

Anyone has an idea why it won't work ?

TL;DR
The issue is with using an older SDK for Dart that doesn't support TablesDB in Appwrite Functions. Update your Dart SDK version to 13.0.0 or above to access TablesDB features. Manually edit the version in the `pubspec.yaml` file or create an issue on the GitHub repository for further assistance.
14 Mar, 2026, 18:07

It might be happening because you're probably using the older sdk for dart in which TablesDB wasn't available. Try using newer version of the sdk or switch to old Database.

14 Mar, 2026, 18:08

How do I use the new SDK for Dart ? Pb with old Database is that there are plenty of functions which didn't exist, like deleteRows....

14 Mar, 2026, 18:12

Are you using version 19.0.0 ?

14 Mar, 2026, 18:13

In the function ? How do I know that ?

14 Mar, 2026, 18:13

I mean check your sdk version

14 Mar, 2026, 18:13

And tell me

14 Mar, 2026, 18:15

Am sorry... all I see in the Appwrite dunction settings is : RunTime Dart-3.10

14 Mar, 2026, 18:17

Ok ok.. are you able to find pubspec.yaml file in your function's folder?

14 Mar, 2026, 18:18

I have this : name: starter_template version: 1.0.0

environment: sdk: ^2.17.0

dependencies: dart_appwrite: 8.0.0

dev_dependencies: lints: ^2.0.0

14 Mar, 2026, 18:19

But I guess this was created automatically from the appwrite cloud onto my github

14 Mar, 2026, 18:25

Look! The issue is exactly what I thought. Based on this file, you're using an older sdk version (i.e. 8.0.0) here. Upgrade to version 13.0.0 or above for using TablesDB features.

14 Mar, 2026, 18:26

You can manually edit the version in your file for updating if you don't prefer using CLI

14 Mar, 2026, 18:27

That's what I am doing. I changed it in github. What's the latest version I can use ?

14 Mar, 2026, 18:30

Apparently, it's still not working. I believe APPWRITE CLOUD FUNCTION do not support thie version of dart SDK yet

15 Mar, 2026, 02:48

Ok then you can create an issue for this in the github repo and inform about the same in the https://discord.com/channels/564160730845151244/636852860709240842 channel

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