> For the complete documentation index, see [llms.txt](https://cloakedkeys.gitbook.io/ofsc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloakedkeys.gitbook.io/ofsc/page/database-command.md).

# Database Command

Print or export what the database holds, without contacting the site

`ofscraper db` reads the media rows in each selected creator's `user_data.db` and prints them as a table. It makes no API calls for the media itself.

```
ofscraper db --usernames creatorname
```

## Choosing rows

It takes the usual options:

* **Creators:** `-u` and the other user selection options.
* **Areas:** `-o`, for example `-o messages,purchased`.
* **Media filters:** type, size, length, downloaded, locked, preview, protected and dates.
* **`--post-id` and `--media-id`:** one id, or several separated by commas or spaces.
* **Order and limit:** `--db-sort`, `--db-asc` and a hard limit.

See [Command-line options](/ofsc/reference/cli.md#db) for the full list.

## Exporting

`-ep PATH` or `--export PATH` also writes the rows to a `.csv`. With several creators, every creator's rows go into the one file.

## What it changes

Nothing, unless you pass `--unmark-permanent-skips`.

* Databases are opened read-only, so it works on read-only files and network shares (`\\server\share`).
* A creator with no database is skipped with a short message. No empty file or folder is created.
* A database it can't read is named and skipped, and the other creators still show.
* Databases from older versions, missing newer columns, work.
* Over all areas, a database that holds several creators shows only the chosen creator's media.

### Undoing permanent skips

`--unmark-permanent-skips` keeps only the rows that the [skip download script](/ofsc/getting-started/config-options/options/script-options.md#skip-download-script-skip_download_script) skipped for good, prints them, and sets them back to not downloaded. The next normal run asks the script about them again. Narrow it with the creator options, `--post-id` or `--media-id`.

* Real downloads are never touched.
* A media's download state is kept on all of its rows, so its rows in other posts change too.

> ℹ️ **Fork:** the read-only behaviour, the working `--post-id` and `--media-id`, and `--unmark-permanent-skips` came in 3.16.6. See [Fork Changes](/ofsc/fork-changes.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cloakedkeys.gitbook.io/ofsc/page/database-command.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
