Back

database error for code listed in SDK

  • 0
  • Databases
  • Cloud
guido
11 Jun, 2024, 15:50

databases = Databases(client)

Im receiving an error for this saying that databases is not defined. this code was taken from the SDK for python.

TL;DR
Developers are encountering a 'databases is not defined' error when using the code provided in the SDK. The issue is due to missing import statements for 'Databases'. To fix this, ensure you import Databases from appwrite.client.
guido
11 Jun, 2024, 15:51

heres the actual code in the SDK

from appwrite.client import Client

client = Client() client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint client.set_project('5df5acd0d48c2') # Your project ID client.set_session('') # The user session to authenticate with

databases = Databases(client)

result = databases.list_documents( database_id = '<DATABASE_ID>', collection_id = '<COLLECTION_ID>', queries = [] # optional

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