> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# List Databases

> List all databases with optional filtering and pagination

# List Databases

List all databases with optional filtering and pagination.

## Query Parameters

<ParamField query="service" type="string">
  Filter by service fully qualified name.
</ParamField>

<ParamField query="domain" type="string">
  Filter by domain fully qualified name.
</ParamField>

<ParamField query="limit" type="integer" default="10">
  Maximum number of results to return (max: 1000000).
</ParamField>

<ParamField query="before" type="string">
  Cursor for backward pagination.
</ParamField>

<ParamField query="after" type="string">
  Cursor for forward pagination.
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated list of fields to include. Valid fields: `owners`, `databaseSchemas`, `usageSummary`, `location`, `tags`, `certification`, `extension`, `domains`, `sourceHash`, `followers`.
</ParamField>

<ParamField query="include" type="string" default="non-deleted">
  Include `all`, `deleted`, or `non-deleted` entities.
</ParamField>

<RequestExample dropdown>
  ```python GET /v1/databases theme={null}
  from metadata.sdk import configure
  from metadata.sdk.entities import Databases

  configure(
      host="https://your-company.open-metadata.org/api",
      jwt_token="your-jwt-token"
  )

  # List with pagination
  page = Databases.list(limit=50, fields=["owners", "tags"])
  for db in page.entities:
      print(f"{db.fullyQualifiedName}")
      if db.owners:
          print(f"  Owners: {[o.name for o in db.owners]}")

  # List all with auto-pagination
  all_databases = Databases.list_all(batch_size=100)
  for database in all_databases:
      print(f"{database.fullyQualifiedName}")
  ```

  ```java GET /v1/databases theme={null}
  import static org.openmetadata.sdk.fluent.Databases.*;

  // Retrieve by ID
  Database database = Databases.retrieve(databaseId);

  // List databases
  var result = Databases.list()
      .fields("owners", "tags")
      .limit(50)
      .execute();

  for (Database db : result.getData()) {
      System.out.println(db.getFullyQualifiedName());
  }
  ```

  ```bash GET /v1/databases theme={null}
  # List all
  curl "{base_url}/api/v1/databases?limit=50" \
    -H "Authorization: Bearer {access_token}"

  # Filter by service
  curl "{base_url}/api/v1/databases?service=mysql_sample&limit=50" \
    -H "Authorization: Bearer {access_token}"

  # With fields
  curl "{base_url}/api/v1/databases?service=mysql_sample&fields=owners,databaseSchemas&limit=50" \
    -H "Authorization: Bearer {access_token}"

  # With multiple fields
  curl "{base_url}/api/v1/databases?service=mysql_sample&fields=owners,tags,domains,usageSummary&limit=50" \
    -H "Authorization: Bearer {access_token}"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "id": "1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
        "name": "default",
        "fullyQualifiedName": "mysql_sample.default",
        "tags": [],
        "version": 0.1,
        "updatedAt": 1769982658682,
        "updatedBy": "admin",
        "href": "http://localhost:8585/api/v1/databases/1d08c2c6-cea7-4adf-9043-0f6a6aaf9721",
        "owners": [],
        "service": {
          "id": "4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3",
          "type": "databaseService",
          "name": "mysql_sample",
          "fullyQualifiedName": "mysql_sample",
          "displayName": "mysql_sample",
          "deleted": false,
          "href": "http://localhost:8585/api/v1/services/databaseServices/4724c3cb-d4b8-4ac0-aa55-e8bb66f01ac3"
        },
        "serviceType": "Mysql",
        "databaseSchemas": [
          {
            "id": "ea2cfeb5-8daa-434d-ae22-1f56c688aa86",
            "type": "databaseSchema",
            "name": "posts_db",
            "fullyQualifiedName": "mysql_sample.default.posts_db",
            "displayName": "posts_db",
            "deleted": false,
            "href": "http://localhost:8585/api/v1/databaseSchemas/ea2cfeb5-8daa-434d-ae22-1f56c688aa86"
          }
        ],
        "default": false,
        "deleted": false,
        "sourceUrl": "https://localhost:3306/posts_db",
        "domains": [],
        "entityStatus": "Unprocessed"
      }
    ],
    "paging": {
      "after": "eyJsYXN0SWQiOiIxZDA4YzJjNi1jZWE3LTRhZGYtOTA0My0wZjZhNmFhZjk3MjEifQ==",
      "total": 8
    }
  }
  ```
</ResponseExample>

***

## Returns

Returns a paginated list of database objects. By default, only basic fields are included. Use the `fields` parameter to request additional data.

## Response

<ResponseField name="data" type="array">
  Array of database objects.

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Unique identifier for the database (UUID format).
    </ResponseField>

    <ResponseField name="name" type="string">
      Database name.
    </ResponseField>

    <ResponseField name="fullyQualifiedName" type="string">
      Fully qualified name in format `service.database`.
    </ResponseField>

    <ResponseField name="displayName" type="string">
      Human-readable display name.
    </ResponseField>

    <ResponseField name="service" type="object">
      Reference to the parent database service.
    </ResponseField>

    <ResponseField name="serviceType" type="string">
      Type of database service (e.g., Snowflake, BigQuery, PostgreSQL).
    </ResponseField>

    <ResponseField name="owners" type="array" optional>
      List of owners (teams and users) assigned to the database. Only included when `fields` contains `owners`.
    </ResponseField>

    <ResponseField name="tags" type="array" optional>
      Classification tags applied to the database. Only included when `fields` contains `tags`.
    </ResponseField>

    <ResponseField name="domain" type="object" optional>
      Domain assignment for governance. Only included when `fields` contains `domain`.
    </ResponseField>

    <ResponseField name="databaseSchemas" type="array" optional>
      Child schemas within this database. Only included when `fields` contains `databaseSchemas`.
    </ResponseField>

    <ResponseField name="usageSummary" type="object" optional>
      Usage statistics and query counts. Only included when `fields` contains `usageSummary`.
    </ResponseField>

    <ResponseField name="location" type="object" optional>
      Storage location information. Only included when `fields` contains `location`.
    </ResponseField>

    <ResponseField name="extension" type="object" optional>
      Custom properties defined on this database. Only included when `fields` contains `extension`.
    </ResponseField>

    <ResponseField name="sourceHash" type="string" optional>
      Hash of the source metadata for change detection. Only included when `fields` contains `sourceHash`.
    </ResponseField>

    <ResponseField name="certification" type="object" optional>
      Certification status for the database. Only included when `fields` contains `certification`.
    </ResponseField>

    <ResponseField name="followers" type="array" optional>
      Users following this database for updates. Only included when `fields` contains `followers`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="paging" type="object">
  Pagination information.

  <Expandable title="properties">
    <ResponseField name="total" type="integer">
      Total count of databases matching the query.
    </ResponseField>

    <ResponseField name="after" type="string" optional>
      Cursor for the next page of results. Null if this is the last page.
    </ResponseField>

    <ResponseField name="before" type="string" optional>
      Cursor for the previous page of results. Null if this is the first page.
    </ResponseField>
  </Expandable>
</ResponseField>
