# SQLite 客户端仅支持 `better-sqlite3` 包

> Source: https://strapi.nodejs.cn/cms/migration/v4-to-v5/breaking-changes/only-better-sqlite3-for-sqlite

🌐 Only the `better-sqlite3` package is supported for the SQLite client

在 Strapi 5 中，SQLite 数据库必须使用 `better-sqlite3` 包，并且数据库客户端配置设置为 `sqlite`，而不是其他选项如 `sqlite3` 或 `sqlite-legacy`。

🌐 In Strapi 5, SQLite databases must use the `better-sqlite3` package with the database client configuration set to `sqlite` instead of other options like `sqlite3` or `sqlite-legacy`.

Strapi 5 只能对 SQLite 数据库使用 `better-sqlite3` 包，并且其 `client` 值必须设置为 `sqlite`。

🌐 Strapi 5 can only use the `better-sqlite3` package for SQLite databases, and the `client` value for it must be set to `sqlite`.

此页面是[重大更改数据库](/cms/migration/v4-to-v5/breaking-changes)的一部分，提供关于重大更改的信息以及从 Strapi v4 迁移到 Strapi 5 的附加说明。

🌐 This page is part of the [breaking changes database](/cms/migration/v4-to-v5/breaking-changes) and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

- Is this breaking change affecting plugins? No
- Is this breaking change automatically handled by a codemod? Yes
  - Codemod: [sqlite3-to-better-sqlite3](https://github.com/strapi/strapi/blob/develop/packages/utils/upgrade/resources/codemods/5.0.0/sqlite3-to-better-sqlite3.json.ts)

## 重大变更描述 {#breaking-change-description}

🌐 Breaking change description

**在 Strapi v4 中**

SQLite 数据库的数据库配置 `client` 选项接受多个值，例如 `sqlite3`、`vscode/sqlite3`、`sqlite-legacy` 和 `better-sqlite3`。

🌐 The database configuration `client` option for SQLite databases accepts several values such as `sqlite3`, `vscode/sqlite3`, `sqlite-legacy`, and `better-sqlite3`.

**在 Strapi 5 中**

SQLite 数据库的数据库配置 `client` 选项仅接受 `sqlite`。

🌐 The database configuration `client` option for SQLite database only accepts `sqlite`.

## 迁移 {#migration}

🌐 Migration

本节重新组合了有关引入的重大更改的有用说明和程序。

🌐 This section regroups useful notes and procedures about the introduced breaking change.

### 注意 {#notes}

🌐 Notes

* Strapi 5 在底层使用 `better-sqlite3` 包处理 SQLite 数据库，并将 Knex 的 `sqlite` 选项重写为 `better-sqlite3`。
* 有关数据库客户端和配置的更多信息，请参阅[数据库配置](/cms/configurations/database)文档。

### 手动操作 {#manual-procedure}

🌐 Manual procedure

不应需要手动迁移，因为来自 [升级工具](/cms/upgrade-tool) 的代码修改工具将处理此更改。

🌐 No manual migration should be required as codemods from the [upgrade tool](/cms/upgrade-tool) will handle this change.

如果你想要手动迁移，请在终端中运行以下命令：

🌐 In case you want to manually migrate, run the following commands in the terminal:

1. 运行 `yarn remove sqlite3` 来移除 sqlite 3 包。
2. 运行 `yarn add better-sqlite3` 来安装 `better-sqlite3` 软件包。
