Skip to content

Commit

Permalink
i18n(zh-cn): Update astro-db.mdx (#9438)
Browse files Browse the repository at this point in the history
Co-authored-by: liruifengv <[email protected]>
Co-authored-by: Yan <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2024
1 parent d348757 commit 363b5be
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/content/docs/zh-cn/guides/astro-db.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ export default async function () {
## Astro Studio
</StudioHeading>
:::caution
我们 [即将关闭 Astro Studio](https://astro.build/blog/goodbye-astro-studio/)。因此,2024 年 10 月 1 日之后,用户将无法再创建数据库。
我们建议 [将现有 Studio 数据库迁移到 Turso](#从-astro-studio-迁移到-turso),或 [将 Astro DB 连接到任何 libSQL 服务器](#libsql) 来代替。
:::
Astro DB 可以连接到 Astro Studio 平台,快速为你的项目添加一个托管数据库。你可以从 Astro Studio 仪表盘上查看、管理和部署新的托管数据库。
[Astro Studio 网页门户](http://studio.astro.build) 允许你通过网页界面或使用 [CLI 命令](/zh-cn/reference/cli-reference/#astro-studio-cli) 连接并管理你的远程托管的 [Astro DB 数据库](/zh-cn/guides/astro-db/)。
Expand Down Expand Up @@ -654,6 +660,34 @@ astro dev --remote
</ReadMore>
### 从 Astro Studio 迁移到 Turso
<Steps>
1. 在 [Studio 仪表板](https://studio.astro.build/) 中,导航到你要迁移的项目。在设置选项卡中,使用 “Export Database(导出数据库)” 按钮下载数据库的转储。
2. 按照官方说明 [安装 Turso CLI](https://docs.turso.tech/cli/installation) 并 [注册或登录](https://docs.turso.tech/cli/authentication) 你的 Turso 帐户。
3. 使用你在步骤 1 中下载的 `.sql` 转储创建一个新数据库。
```sh
turso db create [database-name] --from-dump ./path/to/dump.sql
```
4. 使用 Turso CLI 获取数据库 URL,并将其配置为环境变量 `ASTRO_DB_REMOTE_URL`
```sh
turso db show [database-name]
```
```env
ASTRO_DB_REMOTE_URL=[your-database-url]
```
5. 创建一个令牌来访问你的数据库,并将其配置为环境变量 `ASTRO_DB_APP_TOKEN`
```sh
turso db tokens create [database-name]
```
```env
ASTRO_DB_APP_TOKEN=[your-app-token]
```
6. 一旦确认你的项目连接到新数据库,你就可以安全地从 Astro Studio 中删除该项目了。
</Steps>
## libSQL
<p><Since pkg="@astrojs/db" v="0.14.0" /></p>
Expand Down

0 comments on commit 363b5be

Please sign in to comment.