Skip to content

🚀 Feature: API to list databases #288

@ApaxPhoenix

Description

@ApaxPhoenix

🔖 Feature description

Please provide a public API route to list all databases, returning each database’s ID, name, and metadata.

🎤 Pitch

This enables apps to dynamically discover database IDs at runtime instead of relying on fragile hard-coded values, so if an administrator deletes a database, the deployed application doesn’t break.

import 'package:appwrite/appwrite.dart';

Future<void> main() async {
  // Appwrite client to communicate with the server
  final client = Client()
    ..setEndpoint("https://cloud.appwrite.io/v1")
    ..setProject("<PROJECT_ID>")
    ..setKey("<APPWRITE_KEY>");

  // Database service instance
  final databases = Databases(client);

  // Example: list all databases
  final list = await databases.list();

  // Find the database you want by name
  final users = list.databases.where(
    (d) => d.name == "users",
    orElse: () => throw Exception("Database 'users' not found"),
  );

  print("Found database:");
  print("Name: ${users.name}");
  print("ID: ${users.$id}");
}

This is just an example of the appwrite flutter SDK I Invision.
But there is no endpoint to make this actually happen, none that I know of.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions