10000 docs(content)!: update debugging guide with new recommended workflow by nexoscreator Β· Pull Request #3116 Β· nuxt/content Β· GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

docs(content)!: update debugging guide with new recommended workflow #3116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
83 changes: 82 additions & 1 deletion docs/content/docs/7.advanced/4.tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,85 @@ navigation:
title: Debugging tools
---

## SQLite vscode extension
Nuxt Content uses an **SQLite database (`contents.sqlite`)** to store and query content efficiently. If you're running into **missing content, slow queries, or database issues**, debugging your SQLite database can help!

::callout
---
icon: i-simple-icons-visualstudiocode
to: https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite
---
A simple way to inspect it? **Use the SQLite VS Code extension!**
::

## Install SQLite VS Code Extension

1. Open **Visual Studio Code**.
2. Go to the **Extensions** panel (`Ctrl+Shift+X` / `Cmd+Shift+X` on Mac).
3. Search for **"SQLite"** (by `alexcvzz`) and install it.
4. Open your Nuxt Content database (`.data/content/contents.sqlite`).

::tip{icon="i-lucide-lightbulb"}
If you don't see `contents.sqlite`, start your Nuxt app first:

```bash [Terminal]
npx nuxi dev
```
::


## Locate Your SQLite Database
Nuxt Content stores its database here:

```bash
.data/content/contents.sqlite
```

::note{to="https://nuxt.com/docs/getting-started/prerendering"}
This file is automatically generated when you start your Nuxt app. No need to create it manually!
::

## Open & Explore the Database

1. **Right-click** on `contents.sqlite` in VS Code.
2. Select **"Open Database"**.
3. Expand the **Database Explorer** panel to view tables & data.

![SQLite Explorer in VS Code](https://github.com/user-attachments/assets/c9f22c4c-7a95-43e8-ab03-aa76f2e49c8e)


## Fixing Common Issues

### Content Not Showing?

1. **Check if the database exists** (`.data/content/contents.sqlite`).
2. **Run a cleanup & restart Nuxt**:
```bash [Terminal]
npx nuxi cleanup && npx nuxi dev
```
3. **Check if content is inside the database** (run an SQL query).

### Manually Reset the Database
If things seem **really broken**, try resetting it:

1. **Delete the database file**:
```bash [Terminal]
rm -rf .data/content/contents.sqlite
```
2. **Run cleanup** to remove old caches:
```bash [Terminal]
npx nuxi cleanup
```
3. **Restart Nuxt** to generate a fresh database:
```bash [Terminal]
npx nuxi dev
```

::note{icon="i-lucide-triangle-alert"}
Cleaning up will remove cached data. Don't worryβ€”it regenerates automatically!
::

## More Debugging Tools
If VS Code isn’t enough, check out:

- πŸ–₯️ [**DB Browser for SQLite**](https://sqlitebrowser.org/) – A visual tool for inspecting & modifying the database.
- πŸ› οΈ **SQLite Command Line** – Use `sqlite3 contents.sqlite` to run SQL queries from your terminal.
0