跳至正文内容
TursoDB.cn 独立社区 · MVCC 并发写与每 Agent 独立库实战 阅读解析 →
Turso Cloud API 参考 接口资源 数据库

列出数据库

返回属于该组织或用户的数据库列表。

GET https://api.turso.tech/v1/organizations/{organizationSlug}/databases
curl -L https://api.turso.tech/v1/organizations/{organizationSlug}/databases \
  -H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";

const turso = createClient({
  org: "...",
  token: "",
});

const databases = await turso.databases.list();

OpenAPI

openapi: 3.0.1
info:
  title: Turso Platform API
  description: API description here
  license:
    name: MIT
  version: 0.1.0
servers:
  - url: https://api.turso.tech
    description: Turso's Platform API
security: []
paths:
  /v1/organizations/{organizationSlug}/databases:
    get:
      summary: List Databases
      description: Returns a list of databases belonging to the organization or user.
      operationId: listDatabases
      parameters:
        - $ref: '#/components/parameters/organizationSlug'
        - name: group
          in: query
          schema:
            type: string
          description: 按组名筛选数据库。
        - name: schema
          in: query
          schema:
            type: string
          description: >-
            用于获取属于该父 schema 的数据库的 schema 数据库名称。
          deprecated: true
        - name: parent
          in: query
          schema:
            type: string
          description: 通过父数据库 ID 筛选数据库分支。
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  databases:
                    type: array
                    items:
                      $ref: '#/components/schemas/Database'
components:
  parameters:
    organizationSlug:
      in: path
      name: organizationSlug
      required: true
      schema:
        type: string
      description: 组织或用户账户的 slug。
  schemas:
    Database:
      type: object
      properties:
        Name:
          type: string
          description: 数据库名称,在你的组织内**唯一**。
          example: my-db
        DbId:
          type: string
          description: 数据库通用唯一标识符(UUID)。
          example: 0eb771dd-6906-11ee-8553-eaa7715aeaf2
        Hostname:
          type: string
          description: 用于客户端 libSQL 和 HTTP 连接的 DNS 主机名。
          example: '[databaseName]-[organizationSlug].turso.io'
        block_reads:
          type: boolean
          description: 当前读取阻止状态。
          example: false
        block_writes:
          type: boolean
          description: 当前写入阻止状态。
          example: false
        regions:
          type: array
          items:
            type: string
          description: 数据库所属组的区域列表。
          example:
            - aws-us-east-1
          deprecated: true
        primaryRegion:
          type: string
          description: 数据库所属组的主区域位置代码。
          example: aws-us-east-1
        group:
          type: string
          description: 数据库所属组的名称。
          example: default
        delete_protection:
          type: boolean
          description: >-
            当前的删除保护状态。如果启用,则该数据库无法被删除。
          example: false
        parent:
          type: object
          nullable: true
          properties:
            id:
              type: string
              description: 父数据库标识符。
            name:
              type: string
              description: 父数据库的名称。
            branched_at:
              type: string
              format: date-time
              description: 数据库从父数据库分支出来的时间戳。
              example: '2025-04-15T13:14:34.468213117Z'
同步自官方 Turso 文档仓库 ( tursodatabase/turso-docs · MIT 开源协议) 查看官方原文 ↗
搜索
按 Esc 关闭 · 由 Pagefind 静态索引驱动