Skip to content

Update astro-db.mdx#7314

Merged
sarah11918 merged 3 commits into
withastro:mainfrom
morinokami:astro-db-0
Mar 12, 2024
Merged

Update astro-db.mdx#7314
sarah11918 merged 3 commits into
withastro:mainfrom
morinokami:astro-db-0

Conversation

@morinokami
Copy link
Copy Markdown
Member

Description (required)

I have reviewed astro-db.md and identified a few areas for improvement:

  • Updated the recommended version of @astrojs/db.
  • Added an import statement to a code example to enhance readability.
  • Added a <label> element to a code example for a11y considerations.
  • Corrected some mistakes and typos.

Related issues & labels (optional)

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Mar 12, 2024 10:17pm

## Installation

Add Astro DB to a new or existing Astro project (requires `astro@4.5` or later) with the [`@astrojs/db` integration](/en/guides/integrations-guide/db/) (`v0.8.0` or later). Astro includes a built-in `astro add` command to automate this setup process for you.
Add Astro DB to a new or existing Astro project (requires `astro@4.5` or later) with the [`@astrojs/db` integration](/en/guides/integrations-guide/db/) (`v0.8.1` or later). Astro includes a built-in `astro add` command to automate this setup process for you.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since v0.8.0 had a problem with exported types, which has been fixed in v0.8.1, I think we should suggest that readers use v0.8.1 or later.

Data in Astro DB is stored using SQL tables. Tables structure your data into rows and columns, where columns enforce the type of each row value. Astro DB supports the following column types:

```ts title="db/config.ts" "column.text()" "column.number()" "column.boolean()" "column.date()" "column.json()"
import { defineTable, column } from 'astro:db';
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought readability could be improved by clearly indicating where defineTable and column are imported from.

Copy link
Copy Markdown
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🚀

@sarah11918 sarah11918 added typo/link/grammar - quick fix! Quick fix for a link, typo, grammar/syntax error etc. Doesn't significantly change meaning of text. code snippet update Updates a code sample: typo, outdated code etc. labels Mar 12, 2024
@sarah11918 sarah11918 added the Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code snippet update Updates a code sample: typo, outdated code etc. Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! typo/link/grammar - quick fix! Quick fix for a link, typo, grammar/syntax error etc. Doesn't significantly change meaning of text.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants