---
title: 'Databend 产品月报（2025 年 1 月）'
date: 2025-02-05
slug: category-product/monthly-jan2025
cover_url: 'monthly-jan2025.png'
description: '很高兴为您带来 Databend 2025 年 1 月的最新更新、新功能和改进！我们希望这些增强功能对您有所帮助，并期待您的反馈'
tags: [databend, monthly]
category: Product
authors:
  - Eric
---

# Databend 产品月报（2025 年 1 月）

很高兴为您带来 Databend 2025 年 1 月的最新更新、新功能和改进！我们希望这些增强功能对您有所帮助，并期待您的反馈，祝您新春快乐！

{/* truncate */}

## 本地计算集群

现在，您可以使用 SQL 命令管理本地计算集群，从而更轻松地在自托管的 Databend 环境中创建、扩展和提升查询性能。

```SQL
CREATE WAREHOUSE my_warehouse (
ASSIGN 1 NODES
FROM      log_node,
ASSIGN 2 NODES
FROM      infra_node
);
```

要详细了解相关概念和示例，请参阅 [通过 SQL 管理本地查询计算集群](https://docs.databend.cn/guides/deploy/deploy/production/manage-query-warehouse-through-SQL/)。有关计算集群的相关命令，请参阅 [计算集群相关命令](https://docs.databend.cn/sql/sql-commands/ddl/warehouse/)。

![](/img/blog/sync/monthly-jan2025-image01.png)

## 全新 Python 驱动：databend-driver

我们推出了适用于 Databend 的全新 Python 驱动 [databend-driver](https://pypi.org/project/databend-driver/)，支持同步和异步接口，与 Databend 的交互更加流畅。借助该驱动，您可以更高效地执行 SQL 查询和管理数据操作。

- **教程**：[使用 databend-driver 集成 Databend Cloud](https://docs.databend.cn/tutorials/programming/python/integrating-with-databend-cloud-using-databend-driver)
- **重要提醒**：此前的 Python 驱动 **databend-py** 已被弃用。

```Python
from databend_driver import BlockingDatabendClient

# Connecting to Databend Cloud with your credentials (replace PASSWORD, HOST, DATABASE, and WAREHOUSE_NAME)
client = BlockingDatabendClient(f"databend://cloudapp:{PASSWORD}@{HOST}:443/{DATABASE}?warehouse={WAREHOUSE_NAME}")

# Get a cursor from the client to execute queries
cursor = client.cursor()

# Drop the table if it exists
cursor.execute('DROP TABLE IF EXISTS data')

# Create the table if it doesn't exist
cursor.execute('CREATE TABLE IF NOT EXISTS data (x Int32, y String)')

# Insert data into the table
cursor.execute("INSERT INTO data (x, y) VALUES (1, 'yy'), (2, 'xx')")

# Select all data from the table
cursor.execute('SELECT * FROM data')

# Fetch all rows from the result
rows = cursor.fetchall()

# Print the result
for row in rows:
    print(row.values())
```

## 从 MySQL 迁移至 Databend：使用 db-archiver

Databend 推荐使用 [db-archiver](https://github.com/databendcloud/db-archiver) 迁移 MySQL 数据。db-archiver 是 Databend 开发的原生归档工具，提供开箱即用的解决方案，可高效地将数据从数据库或其他来源归档到 Databend。

db-archiver 支持通过 JSON 配置文件定义迁移的源和目标详细信息。有关完整的迁移教程，请参阅 [Migrating from MySQL with db-archiver](https://docs.databend.cn/tutorials/migrate/migrating-from-mysql-with-db-archiver)。

```JSON
{
    // 将占位符替换为您的实际值：
    "sourceHost": "127.0.0.1",
    "sourcePort": 3306,
    "sourceUser": "root",
    "sourcePass": "root",
    "sourceDB": "mydb",
    "sourceTable": "my_table",
    "sourceQuery": "select * from mydb.my_table",
    "sourceSplitKey": "id",
    "sourceWhereCondition": "id < 100",
    "databendDSN": "https://cloudapp:{password}@{host}:443?warehouse={warehouse_name}",
    "databendTable": "{database}.my_table",
    "batchSize": 2,
    "batchMaxInterval": 30,
    "workers": 1,
    "copyPurge": false,
    "copyForce": false,
    "disableVariantCheck": false,
    "deleteAfterSync": false,
    "maxThread": 10
}
```

## 教程：使用 DBeaver 连接到 Databend

[DBeaver](https://dbeaver.com/) 从 **24.3.1** 版本开始支持使用内置驱动连接到 Databend。以下教程已更新：

- [Connecting to Self-Hosted Databend using DBeaver](https://docs.databend.cn/tutorials/connect/connect-to-databend-dbeaver)
- [Connecting to Databend Cloud using DBeaver](https://docs.databend.cn/tutorials/connect/connect-to-databendcloud-dbeaver)
