> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# Querybook

> Querybook 支持对 数据库 的内部数据和外部数据进行查询和可视化处理。

Querybook 支持对 数据库 的内部数据和外部数据进行查询和可视化处理。

## 前提条件

确保您已完成如下准备工作：

1. 克隆并下载 Querybook 库。

   ```SQL theme={null}
   git clone git@github.com:pinterest/querybook.git
   cd querybook
   ```

2. 在项目根目录下的 `requirements` 文件夹里创建一个 `local.txt` 文件。

   ```SQL theme={null}
   touch requirements/local.txt
   ```

3. 添加文件包。

   ```SQL theme={null}
   echo -e "starrocks\nmysqlclient" > requirements/local.txt 
   ```

4. 启动容器。

   ```SQL theme={null}
   make
   ```

## 集成

进入以下页面添加查询引擎。

```Plain theme={null}
https://localhost:10001/admin/query_engine/
```

![Querybook](https://mintcdn.com/mirrorship-docs/PYpCw6ZrekIEuuQL/documents/images/d0a07348fb67719a410c7773.png?fit=max\&auto=format\&n=PYpCw6ZrekIEuuQL\&q=85\&s=7f5a1d3256c48b2cc1562f260265cd34)

* 在 **Language** 里选择 **数据库**。
* 在 **Executor** 里选择 **sqlalchemy**。
* 在 **Connection\_string** 里，按如下 数据库 SQLAlchemy URI 格式来填写 URI：

  ```SQL theme={null}
  starrocks://<User>:<Password>@<Host>:<Port>/<Catalog>.<Database>
  ```

  URI 参数说明如下：

  * `User`：用于登录 集群的用户名，如 `admin`。
  * `Password`：用于登录 集群的用户密码。
  * `Host`：集群的 FE 主机 IP 地址。
  * `Port`：集群的 FE 查询端口，如 `9030`。
  * `Catalog`：集群中的目标 Catalog。Internal Catalog 和 External Catalog 均支持。
  * `Database`：集群中的目标数据库。内部数据库和外部数据库均支持。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.