Files
dbx/docs/zh-CN/guide/database-export.md
T
t8y2 c1f7349c5c docs: add VitePress documentation site with i18n
Full documentation site with English and Chinese versions:
- Home page with feature cards and screenshots
- 17 guide pages per language covering all features
- Local search, language switcher, sidebar navigation
2026-05-03 16:54:36 +08:00

36 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 数据库导出
DBX 支持将整个数据库导出为 SQL 文件,包含表结构(DDL)和数据,适用于数据库备份和迁移。
## 导出内容
导出的 SQL 文件包含:
- **表结构(DDL)** -- `CREATE TABLE` 语句,包括列定义、主键、索引、约束等
- **表数据** -- 以 `INSERT` 语句的形式导出表中的数据
## 批量 INSERT 语句
为了提高导入效率,DBX 会将数据生成为批量 `INSERT` 语句,每条语句包含多行数据,减少执行次数,加快数据恢复速度。
示例:
```sql
INSERT INTO users (id, name, email) VALUES
(1, '张三', 'zhangsan@example.com'),
(2, '李四', 'lisi@example.com'),
(3, '王五', 'wangwu@example.com');
```
## 配置选项
### 行数限制
你可以配置每张表导出的最大行数。这在以下场景中非常有用:
- 只需要导出表结构和少量示例数据时
- 表中数据量过大,完整导出文件体积过大时
- 需要创建用于开发或测试的精简数据集时
设置为 0 或留空表示导出全部数据。