# SQLite — query, change, and back up local databases

> Query, change, and back up a local SQLite database with the sqlite3 CLI — use when the data already lives in a .db file.

SQLite — query, change, and back up local databases is a free AI agent skill on Agensi by Orbital Desk. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Orbital Desk](https://www.agensi.io/creators/orbital-desk)
- Uses: 3
- Version: 1.0
- Last updated: 2026-10-12
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/sqlite-query-change-and-back-up-local-databases
- Tags: data, developer-tools

## About this skill

This skill works on a local SQLite database file with the `sqlite3` CLI — enough for inspection, one-off queries, writes, and backups. When a value comes from outside the command you typed, it switches to Python's stdlib `sqlite3` module and binds the value with a `?` placeholder instead of concatenating text into SQL.

The everyday commands are covered: create a table, insert, and read back with `-json` so rows come out in a shape an agent can parse; `.tables` and `.schema` to see what is in a file; and session pragmas, with the big one called out — `PRAGMA foreign_keys` defaults to 0 in SQLite, so any connection that should enforce foreign keys must turn it on explicitly.

Backups are done properly: the CLI's `.backup` command copies a live database including its WAL pages, verified afterward with `PRAGMA integrity_check` (which prints `ok` on a consistent copy). Copying the file with `cp` can catch a WAL database mid-write, so the skill forbids it as a backup method.

Also covered: `--safe` mode for running an untrusted SQL script so it cannot shell out or load extensions, the rowid behavior of `INTEGER PRIMARY KEY`, and installation (`sqlite3` ships on macOS and many Linux systems; the `sqlite3` package on Debian/Ubuntu, Homebrew for a newer build). Scope is explicit: this covers single-file databases, not client/server databases.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the SQLite — query, change, and back up local databases skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does SQLite — query, change, and back up local databases do?

Query, change, and back up a local SQLite database with the sqlite3 CLI — use when the data already lives in a .db file.

### Which AI agents support SQLite — query, change, and back up local databases?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use SQLite — query, change, and back up local databases?

Connect your AI agent to Agensi through MCP, then ask it to use SQLite — query, change, and back up local databases on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
