Self-hosted · open source · MIT

Your vault for SQL queries.

Store, version and reuse PostgreSQL queries and routines in your own interface. Save straight from VS Code, search with Cmd+K and run everything on your own machine or server.

~/sql-vault/consultasonline
PostgreSQL 17
reference database
AES-256-GCM
AI credentials at rest
JSON · .sql
export and import
pt-BR · en
bilingual interface
01

Features

Queries and tags

Favorites, tags and soft delete. Nothing is erased at once: items go to the trash and can be restored.

Routines with parameters

Functions, procedures, triggers and views kept together with their parameters.

Version history

Every SQL change creates a snapshot. Compare versions side by side in Monaco Editor.

Import and export

Export as JSON (v1 and v2) or .sql, and import them back when you need to.

Command palette

Cmd+K to jump between queries, tags and settings without leaving the keyboard.

AI per provider

OpenAI, Anthropic, Gemini or Ollama, with a searchable model picker. Keys are encrypted at rest.

02

Product

Query list
Query detail
Routines
03

VS Code extension

Search your vault and save SQL straight from the editor, without switching windows. The extension uses a personal API key, shown only once when it is created.

  • Search queries without leaving the editor
  • Save a query directly from the editor
  • Personal token, stored only as a hash
Open on Marketplace
Saving a query from the editor
04

Self-hosted

Docker Compose starts the app and PostgreSQL 17. Migrations run before the app starts. In production, Caddy handles HTTPS.

Keep AI_ENCRYPTION_KEY as safe as AUTH_SECRET. Without it, saved AI credentials cannot be decrypted.

  1. Clone the repository and create .env

    git clone https://github.com/mateusarcedev/sql-vault.git && cd sql-vault && cp .env.example .env
  2. Set AUTH_SECRET and AI_ENCRYPTION_KEY in .env

  3. Start the containers

    docker compose up --build -d
  4. Open http://localhost:3000

05

Security

Per-user isolation

Queries, routines and tags belong to one user, and every read filters by owner.

Hashed API keys

The token is shown only once. The database stores only its hash.

Encrypted AI credentials

Provider keys are encrypted with AES-256-GCM before they reach the database.

Dual authentication

Web sign-in with NextAuth v5 (JWT session) and personal API keys for external integrations.

Command Palette

Search for a command to run...