{"id":34983662,"url":"https://github.com/libredb/libredb-studio","last_synced_at":"2026-04-02T14:06:48.849Z","repository":{"id":330514635,"uuid":"1121989093","full_name":"libredb/libredb-studio","owner":"libredb","description":"A modern, blazing-fast SQL IDE for the cloud era. Query PostgreSQL, MySQL, SQLite \u0026 MongoDB from anywhere — your browser is your new database studio.","archived":false,"fork":false,"pushed_at":"2026-03-23T21:28:14.000Z","size":2612,"stargazers_count":41,"open_issues_count":5,"forks_count":10,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2026-03-24T11:58:29.509Z","etag":null,"topics":["cloud-native","database","docker","k8s","kubernetes","llm","mobile","nextjs","no-installation","query","sql","web","zero-setup"],"latest_commit_sha":null,"homepage":"https://libredb.org/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libredb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-23T23:00:46.000Z","updated_at":"2026-03-23T21:27:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/libredb/libredb-studio","commit_stats":null,"previous_names":["libredb/libredb-studio"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/libredb/libredb-studio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libredb%2Flibredb-studio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libredb%2Flibredb-studio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libredb%2Flibredb-studio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libredb%2Flibredb-studio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libredb","download_url":"https://codeload.github.com/libredb/libredb-studio/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libredb%2Flibredb-studio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-native","database","docker","k8s","kubernetes","llm","mobile","nextjs","no-installation","query","sql","web","zero-setup"],"created_at":"2025-12-27T01:10:48.698Z","updated_at":"2026-04-02T14:06:48.797Z","avatar_url":"https://github.com/libredb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/logo.svg\" width=\"200\" alt=\"LibreDB Studio Logo\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eLibreDB Studio\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eThe Modern, AI-Powered Open-Source SQL IDE for Cloud-Native Teams.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://sonarcloud.io/project/overview?id=libredb_libredb-studio\"\u003e\u003cimg src=\"https://sonarcloud.io/api/project_badges/measure?project=libredb_libredb-studio\u0026metric=alert_status\" alt=\"Quality Gate\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://deepwiki.com/libredb/libredb-studio\"\u003e\u003cimg src=\"https://img.shields.io/badge/Docs-DeepWiki-blue?logo=gitbook\" alt=\"DeepWiki Docs\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://artifacthub.io/packages/search?repo=libredb-studio\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/libredb-studio\" alt=\"Artifact Hub\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://nextjs.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Next.js-16-black?logo=next.js\" alt=\"Next.js 16\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://react.dev/\"\u003e\u003cimg src=\"https://img.shields.io/badge/React-19-61DAFB?logo=react\" alt=\"React 19\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.docker.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker\" alt=\"Docker Support\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://kubernetes.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Kubernetes-Compatible-326CE5?logo=kubernetes\" alt=\"Kubernetes Compatible\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#-live-test\"\u003e\u003cstrong\u003e🚀 Try Live Test\u003c/strong\u003e\u003c/a\u003e •\n  \u003ca href=\"#getting-started\"\u003e\u003cstrong\u003e📖 Documentation\u003c/strong\u003e\u003c/a\u003e •\n  \u003ca href=\"#-one-click-deploy\"\u003e\u003cstrong\u003e⚡ Deploy Your Own\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/screenshots/hero-editor.png\" alt=\"LibreDB Studio - Professional SQL IDE\" width=\"100%\" /\u003e\n\u003c/p\u003e\n\n---\n\n## 🚀 Live Test\n\n\u003e **Try LibreDB Studio instantly without installation!**\n\n| Test | URL | Credentials |\n|------|-----|-------------|\n| **Public Test** | [app.libredb.org](https://app.libredb.org) | `admin@libredb.org` / `LibreDB.2026` |\n\nThe test instance comes with a pre-configured PostgreSQL database via [Seed Connections](#seed-connections-pre-configured-databases). No setup required!\n\n---\n\n## Overview\n\n**LibreDB Studio** is a lightweight, high-performance, and secure web-based SQL editor designed to bridge the gap between heavy desktop applications (like DataGrip/DBeaver) and minimal CLI tools. Built with a \"Mobile-First, Professional-Always\" philosophy, it empowers engineering teams to manage databases anywhere—from a 4K monitor to a mobile screen.\n\n### Why LibreDB Studio?\n- **Zero Install**: Run a professional SQL IDE in your browser or private network.\n- **Multi-Platform**: Native-like experience on both **Web** and **Mobile** browsers.\n  - **AI-Native**: Multi-model support (Gemini, OpenAI, or Local LLMs) for NL2SQL.\n- **DevOps Ready**: Optimized for Kubernetes orchestration and Docker environments.\n- **Enterprise Grade**: Built-in RBAC, SSO (OIDC), query auditing, and live health monitoring.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/screenshots/connection-modal.png\" alt=\"Multi-Database Connection Manager\" width=\"100%\" /\u003e\n  \u003cbr/\u003e\u003cem\u003eConnect to PostgreSQL, MySQL, Oracle, SQL Server, MongoDB, Redis, or SQLite with SSL/TLS and SSH Tunnel support.\u003c/em\u003e\n\u003c/p\u003e\n\n---\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/libredb/libredb-studio)\n\n---\n\n## Key Features\n\n### Professional SQL IDE\n- **Monaco Engine**: Powered by the same core as VS Code.\n- **Smart Autocomplete**: Schema-aware suggestions for tables, columns, and SQL keywords.\n- **Multi-Tab Workspace**: Handle parallel tasks with independent execution states.\n- **Visual EXPLAIN**: Graphical execution plans to identify performance bottlenecks.\n- **Interactive ER Diagrams**: Visual schema graph with real foreign key edges, cardinality labels, MiniMap navigation, table search/filter, compact mode, and PNG/SVG export. Automatic hierarchical layout powered by ELK.js.\n- **Schema Diff \u0026 Migration**: Compare schema snapshots or cross-connection schemas side-by-side. Color-coded diff view (added/removed/modified) with automatic migration SQL generation for PostgreSQL, MySQL, SQLite, Oracle, and SQL Server.\n- **Snapshot Timeline**: Visual horizontal timeline of schema snapshots. Click any two points to instantly compare and track schema evolution over time.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/screenshots/erd-diagram.png\" alt=\"Interactive ER Diagram\" width=\"100%\" /\u003e\n  \u003cbr/\u003e\u003cem\u003eVisual schema explorer with interactive ER diagrams powered by ReactFlow.\u003c/em\u003e\n\u003c/p\u003e\n\n### Multi-Model AI Copilot\n- **Universal LLM Support**: Defaults to Gemini 2.5 Flash, but ready for OpenAI, Claude, or **Local LLMs** (Ollama/LM Studio).\n- **NL2SQL**: Generate complex queries from natural language with schema-aware context.\n- **Query Safety Analysis**: AI-powered pre-execution risk assessment for destructive queries (DELETE, DROP, TRUNCATE).\n- **AI Query Explainer**: EXPLAIN plans translated into plain language with optimization suggestions.\n- **AI Query Autopilot**: Automated slow query analysis with actionable index and rewrite recommendations.\n- **Schema Awareness**: AI understands your specific database structure for pinpoint accuracy.\n- **Plug \u0026 Play**: Works out of the box with zero complex configuration.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/screenshots/nl2sql.png\" alt=\"NL2SQL - Natural Language to SQL\" width=\"100%\" /\u003e\n  \u003cbr/\u003e\u003cem\u003eAsk questions in plain English and get executable SQL queries instantly.\u003c/em\u003e\n\u003c/p\u003e\n\n### Pro Data Management\n- **Universal Data Grid**: Virtualized rendering (TanStack) for millions of rows.\n- **Inline Editing**: Double-click to update values directly in the grid.\n- **Column Filtering**: Per-column text filters on query results for instant data exploration.\n- **Interactive Pivot Table**: Client-side pivoting with 5 aggregation functions (COUNT, SUM, AVG, MIN, MAX) and SQL generation.\n- **Expert Exporter**: Instant CSV and JSON exports for reporting.\n\n### Advanced Data Visualization\n- **8 Chart Types**: Bar, Line, Pie, Area, Scatter, Histogram, Stacked Bar, and Stacked Area charts powered by Recharts.\n- **Data Aggregation**: Group-by with SUM, AVG, COUNT, MIN, MAX aggregation functions. Date grouping by hour, day, week, month, or year.\n- **Chart Persistence**: Save chart configurations and reload them instantly. Manage a library of saved charts.\n- **Chart Dashboard**: Grid view of all saved charts for at-a-glance data overview directly in the bottom panel.\n\n### Data Privacy \u0026 Masking\n- **Automatic Sensitive Column Detection**: 10 built-in patterns (email, phone, credit card, SSN, password, IP, date, financial, and more) with regex-based column name matching.\n- **Configurable Masking Rules**: Admin panel to add, edit, enable/disable masking patterns. Custom patterns with regex support.\n- **RBAC-Enforced Masking**: User role cannot toggle or reveal masked data. Admin role has full control with per-cell temporary reveal (10s auto-hide).\n- **Export Protection**: CSV, JSON, and SQL INSERT exports contain masked values when masking is active — no raw data leakage.\n- **Full Coverage**: Masking applied across desktop grid, mobile card view, mobile table view, row detail sheet, and clipboard operations.\n- **Persistent Configuration**: Masking settings stored in localStorage and survive page reloads.\n\n### Analyst \u0026 Developer Tools\n- **AI Data Profiler**: One-click table profiling with column statistics (null %, cardinality, min/max, sample values) and AI-powered narrative summaries.\n- **ORM Code Generator**: Generate TypeScript interfaces, Zod schemas, Prisma models, Go structs, Python dataclasses, and Java POJOs from live table schemas.\n- **Test Data Generator**: Schema-aware fake data generation with 30+ semantic column inferences (email, phone, name, address, etc.). Produces INSERT statements or MongoDB insertMany JSON.\n- **Database Documentation**: Auto-generated searchable data dictionary from live schema with AI-powered documentation and Markdown export.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/screenshots/data-profiler.png\" alt=\"AI Data Profiler\" width=\"80%\" /\u003e\n  \u003cbr/\u003e\u003cem\u003eOne-click column profiling: null %, cardinality, min/max, and sample values for 300K+ rows.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/screenshots/code-generator.png\" alt=\"ORM Code Generator\" width=\"80%\" /\u003e\n  \u003cbr/\u003e\u003cem\u003eGenerate TypeScript interfaces, Prisma models, Go structs, and more from live schemas.\u003c/em\u003e\n\u003c/p\u003e\n\n### Authentication \u0026 SSO\n- **Dual Auth Modes**: Local email/password login or OpenID Connect (OIDC) Single Sign-On — switchable via environment variable.\n- **Vendor-Agnostic OIDC**: Works with any OIDC-compliant provider — Auth0, Keycloak, Okta, Azure AD, Zitadel, Google, and more.\n- **PKCE Security**: Authorization Code Flow with Proof Key for Code Exchange (S256) for secure authentication.\n- **Auto Role Mapping**: Configurable claim-based role mapping with dot-notation for nested claims (e.g., `realm_access.roles`).\n- **Provider Logout**: Logout clears both local JWT session and identity provider session.\n\n### DBA Maintenance Toolkit (Admin Only)\n- **Live Monitoring Dashboard**: 7-tab monitoring with Overview, Performance, Queries, Sessions, Tables, Storage, and Connection Pool views.\n- **Time-Series Trend Charts**: Real-time metric trends (connections, cache hit ratio, buffer pool, deadlocks) with auto-refreshing ring buffer history.\n- **Configurable Auto-Refresh**: Polling intervals from 5s to 60s with play/pause control.\n- **Threshold Alerting**: Color-coded health indicators (healthy/warning/critical) for cache hit ratio, connection usage, deadlocks, and buffer pool utilization.\n- **Connection Pool Stats**: Live total/active/idle/waiting pool metrics with utilization progress bars.\n- **One-Click Maintenance**: Trigger `VACUUM`, `ANALYZE`, `REINDEX`, `UPDATE STATISTICS`, `DBCC CHECKDB`, and `ALTER INDEX REBUILD` per database engine.\n- **Audit Trail**: Full history of every query executed across the organization.\n\n---\n\n## Supported Databases\n\n| Database | Driver | Features |\n| :--- | :--- | :--- |\n| **PostgreSQL** | `pg` | Full SQL IDE, EXPLAIN plans, transactions, query cancellation (`pg_cancel_backend`), SSL/TLS, SSH tunnel |\n| **MySQL** | `mysql2` | Full SQL IDE, EXPLAIN plans, transactions, query cancellation (`KILL QUERY`), SSL/TLS, SSH tunnel |\n| **Oracle** | `oracledb` (Thin mode) | Full SQL IDE, `FETCH FIRST N ROWS` pagination, `V$` monitoring views, `ANALYZE TABLE`, `ALTER INDEX REBUILD`, transactions |\n| **SQL Server** | `mssql` (tedious) | Full SQL IDE, `TOP N` / `OFFSET FETCH` pagination, `sys.dm_*` DMVs, `UPDATE STATISTICS`, `DBCC CHECKDB`, transactions, Azure SQL auto-detect |\n| **SQLite** | `better-sqlite3` | Full SQL IDE, file-based or in-memory databases |\n| **MongoDB** | `mongodb` | JSON query editor, collection operations (find, aggregate, insert, update, delete) |\n| **Redis** | `ioredis` | Command editor, key browser, INFO-based monitoring |\n\n\u003e All SQL databases share: schema explorer, ER diagrams, schema diff \u0026 migration, data masking, monitoring dashboard, and connection string import.\n\n---\n\n## Tech Stack\n\n| Component | Technology | Target |\n| :--- | :--- | :--- |\n| **Framework** | Next.js 16 (App Router), React 19 | Web, Mobile |\n| **UI Engine** | Tailwind CSS 4, Radix UI, [shadcn/ui](https://ui.shadcn.com/) | Web, Mobile |\n| **Theming** | CSS Variables + `@theme inline` ([Guide](docs/THEMING.md)) | Web, Mobile |\n| **Editor** | Monaco Editor (VS Code Engine) | Web |\n| **AI** | Multi-Model (Gemini, OpenAI, Ollama, Custom) | Web, Mobile |\n| **Auth** | JWT (`jose`) + OIDC (`openid-client`), PKCE, Role Mapping | Web, Mobile |\n| **Database** | PostgreSQL, MySQL, Oracle, SQL Server, SQLite, MongoDB, Redis | Web, Mobile |\n| **Charts** | Recharts (Bar, Line, Pie, Area, Scatter, Histogram, Stacked) | Web, Mobile |\n| **ERD** | React Flow, ELK.js (auto-layout) | Web |\n| **State/Grid** | TanStack Table \u0026 Virtual | Web, Mobile |\n| **Deployment** | Docker, Kubernetes | Web |\n\n---\n\n## Getting Started\n\n  ### Quick Start (Docker)\n\n  Run LibreDB Studio with a single command — no clone, no install, no build:\n\n```bash\ndocker run -d \\\n  --name libredb-studio \\\n  -p 3000:3000 \\\n  -e ADMIN_EMAIL=admin@libredb.org \\\n  -e ADMIN_PASSWORD=LibreDB.2026 \\\n  -e USER_EMAIL=user@libredb.org \\\n  -e USER_PASSWORD=LibreDB.2026 \\\n  -e JWT_SECRET=change-me-to-a-random-32-char-string \\\n  ghcr.io/libredb/libredb-studio:latest\n```\n\n  Open [http://localhost:3000](http://localhost:3000) and login with `admin@libredb.org` / `LibreDB.2026`.\n\n  \u003e **Tip**: Add `-e LLM_PROVIDER=gemini -e LLM_API_KEY=your_key -e LLM_MODEL=gemini-2.5-flash` to enable AI features.\n\n  ### Prerequisites\n  - [Bun](https://bun.sh/) (Recommended) or Node.js 20+\n  - A target database to query (PostgreSQL, MySQL, Oracle, SQL Server, SQLite, MongoDB, or Redis)\n\n  ### Quick Start (Local)\n  1. **Clone \u0026 Install**\n     ```bash\n     git clone https://github.com/libredb/libredb-studio.git\n     cd libredb-studio\n     bun install\n     ```\n\n    2. **Configure Environment**\n       Create a `.env.local` file:\n       ```env\n       # Authentication (email/password)\n       ADMIN_EMAIL=admin@libredb.org\n       ADMIN_PASSWORD=your_admin_password\n       USER_EMAIL=user@libredb.org\n       USER_PASSWORD=your_user_password\n       JWT_SECRET=your_32_character_random_string\n\n       # Optional: OIDC Single Sign-On (Auth0, Keycloak, Okta, Azure AD, etc.)\n       # NEXT_PUBLIC_AUTH_PROVIDER=oidc\n       # OIDC_ISSUER=https://your-provider.com\n       # OIDC_CLIENT_ID=your_client_id\n       # OIDC_CLIENT_SECRET=your_client_secret\n\n       # LLM Configuration\n       LLM_PROVIDER=gemini # options: gemini, openai, ollama, custom\n       LLM_API_KEY=your_api_key\n       LLM_MODEL=gemini-2.5-flash\n       LLM_API_URL=http://localhost:11434/v1 # optional for local LLMs (Ollama)\n       ```\n\n3. **Launch**\n   ```bash\n   bun dev\n   ```\n   Open [http://localhost:3000](http://localhost:3000)\n\n---\n\n## 🗄️ Development Databases\n\nNeed databases to test with? We provide ready-to-use containers for all supported engines:\n\n```bash\n# Start all development databases (PostgreSQL, MySQL, MongoDB, SQL Server, Oracle)\ndocker compose -f database-compose.yml up -d\n\n# Or start a specific database\ndocker compose -f database-compose.yml up -d postgres\ndocker compose -f database-compose.yml up -d mssql\ndocker compose -f database-compose.yml up -d oracle\n\n# Start PostgreSQL with sample e-commerce data\ndocker compose -f docker/postgres.yml up -d\n\n# Stop (keeps data)\ndocker compose -f database-compose.yml down\n\n# Stop and remove all data\ndocker compose -f database-compose.yml down -v\n```\n\n### Connection Details\n\n| Database | Host | Port | User | Password | Database/Service |\n|----------|------|------|------|----------|-----------------|\n| **PostgreSQL** | localhost | 5432 | postgres | postgres | postgres |\n| **MySQL** | localhost | 3306 | root | root | mysql |\n| **SQL Server** | localhost | 1433 | sa | Password123! | master |\n| **Oracle** | localhost | 1521 | system | Password123! | freepdb1 |\n| **MongoDB** | localhost | 27017 | admin | admin | — |\n\n### PostgreSQL Sample Data\n\nThe `docker/postgres.yml` setup includes a pre-loaded e-commerce schema:\n\n| Feature | Description |\n|---------|-------------|\n| **PostgreSQL 17** | Latest Alpine image |\n| **pg_stat_statements** | Pre-enabled for query monitoring |\n| **Sample Schema** | E-commerce database (app schema) |\n| **Sample Data** | 25 customers, 30 products, 100 orders |\n| **Views** | Order summary, product sales, customer LTV |\n\nSample tables: `app.customers`, `app.products`, `app.orders`, `app.order_items`, `app.product_reviews`, `app.categories`, `app.coupons`, `app.audit_log`\n\n\u003e This setup is ideal for testing the **Monitoring Dashboard** features with real `pg_stat_statements` data.\n\n---\n\n## Testing\n\nLibreDB Studio has a comprehensive test suite with **2,500+ unit/integration tests** and **35 E2E tests** across 6 layers, achieving **96%+ line coverage**.\n\n### Quick Commands\n\n```bash\n# Run all tests (unit + API + integration + hooks + components)\nbun run test\n\n# Run by layer\nbun run test:unit          # Pure function tests (800 cases)\nbun run test:api           # API route handler tests (205 cases)\nbun run test:integration   # Database provider tests (294 cases)\nbun run test:hooks         # React hook tests (178 cases)\nbun run test:components    # Component tests with mock isolation (194 cases)\n\n# E2E tests (requires build)\nbun run test:e2e           # Playwright browser tests (35 cases)\n\n# Coverage report (lcov)\nbun run test:coverage\n```\n\n### Test Architecture\n\n| Layer | Directory | Runner | Tests | What it covers |\n|-------|-----------|--------|-------|----------------|\n| **Unit** | `tests/unit/` | `bun:test` | ~800 | Pure functions: SQL parser, connection strings, data masking, query limiter, schema diff, error classes, DB icons, showcase queries |\n| **API** | `tests/api/` | `bun:test` | ~205 | Route handlers: auth, query, transaction, maintenance, AI endpoints, middleware |\n| **Integration** | `tests/integration/` | `bun:test` | ~294 | Database providers: PG, MySQL, SQLite, MongoDB, Redis, Oracle, MSSQL|\n| **Hooks** | `tests/hooks/` | `bun:test` | ~178 | React hooks: auth, connections, tabs, query execution, transactions, inline editing, AI chat, monitoring |\n| **Components** | `tests/components/` | `bun:test` + happy-dom | ~194 | UI components: Studio, Sidebar, QueryEditor, ResultsGrid, Admin Dashboard, Charts, ERD |\n| **E2E** | `e2e/` | Playwright | ~35 | Full browser flows: login, connections, query execution, tabs, export, admin |\n\n### Key Details\n\n- **Test runner**: `bun:test` (built-in, Jest-compatible API) with `happy-dom` for DOM environment\n- **Component isolation**: Component tests run in 6 isolated groups via `tests/run-components.sh` to prevent `mock.module()` cross-contamination\n- **E2E**: Playwright with Chromium, runs against a production build (`bun run build \u0026\u0026 bun start`)\n- **CI**: GitHub Actions runs lint + typecheck + build, unit/integration tests with coverage, E2E tests, and SonarCloud analysis\n- **Coverage**: `bun test --coverage` generates lcov reports for SonarCloud integration\n\n\u003e **Important**: Always use `bun run test` instead of bare `bun test`. The test script handles proper isolation between test groups.\n\n---\n\n## ⚡ One-Click Deploy\n\nDeploy your own instance of LibreDB Studio with a single click and a free account on Koyeb or Render:\n\n [![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](https://app.koyeb.com/deploy?name=libredb-studio\u0026type=docker\u0026image=ghcr.io%2Flibredb%2Flibredb-studio%3Alatest\u0026instance_type=free\u0026regions=fra\u0026instances_min=0\u0026autoscaling_sleep_idle_delay=3900\u0026env%5BADMIN_EMAIL%5D=admin%40libredb.org\u0026env%5BADMIN_PASSWORD%5D=LibreDB.2026\u0026env%5BJWT_SECRET%5D=your_secure_pass%3D\u0026env%5BLLM_API_KEY%5D=your_GEMINI_API_KEY\u0026env%5BLLM_MODEL%5D=gemini-2.5-flash\u0026env%5BLLM_PROVIDER%5D=gemini\u0026env%5BNEXT_PUBLIC_AUTH_PROVIDER%5D=local\u0026env%5BSTORAGE_PROVIDER%5D=postgres\u0026env%5BSTORAGE_POSTGRES_URL%5D=postgresql%3A%2F%2Fdb_user%3Adb_pass%40your_host.eu-central-1.pg.koyeb.app%2Flibredb_storage\u0026env%5BUSER_EMAIL%5D=user%40libredb.org\u0026env%5BUSER_PASSWORD%5D=LibreDB.2026\u0026ports=3000%3Bhttp%3B%2F\u0026hc_protocol%5B3000%5D=tcp\u0026hc_grace_period%5B3000%5D=5\u0026hc_interval%5B3000%5D=30\u0026hc_restart_limit%5B3000%5D=3\u0026hc_timeout%5B3000%5D=5\u0026hc_path%5B3000%5D=%2F\u0026hc_method%5B3000%5D=get)  \n\n [![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/libredb/libredb-studio)  \n\n\n### Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `ADMIN_EMAIL` | ✅ | Admin email (default: `admin@libredb.org`) |\n| `ADMIN_PASSWORD` | ✅ | Admin password |\n| `USER_EMAIL` | ✅ | User email (default: `user@libredb.org`) |\n| `USER_PASSWORD` | ✅ | User password |\n| `JWT_SECRET` | ✅ | Secret for JWT tokens (min 32 chars) |\n| `NEXT_PUBLIC_AUTH_PROVIDER` | ❌ | `local` (default) or `oidc` for SSO |\n| `OIDC_ISSUER` | ❌ | OIDC issuer URL (required when `oidc`) |\n| `OIDC_CLIENT_ID` | ❌ | OIDC client ID (required when `oidc`) |\n| `OIDC_CLIENT_SECRET` | ❌ | OIDC client secret (required when `oidc`) |\n| `OIDC_ADMIN_ROLES` | ❌ | Comma-separated admin role values (default: `admin`) |\n| `OIDC_ROLE_CLAIM` | ❌ | Claim path for role (e.g. `realm_access.roles`) |\n| `OIDC_SCOPE` | ❌ | OIDC scope (default: `openid profile email`) |\n| `LLM_PROVIDER` | ❌ | AI provider: `gemini`, `openai`, `ollama` |\n| `LLM_API_KEY` | ❌ | API key for AI features |\n| `LLM_MODEL` | ❌ | Model name (e.g., `gemini-2.5-flash`) |\n| `STORAGE_PROVIDER` | ❌ | Storage provider: `local` (default), `sqlite`, or `postgres` |\n| `STORAGE_POSTGRES_URL` | ❌ | PostgreSQL connection URL (required when `STORAGE_PROVIDER=postgres`) |\n| `SEED_CONFIG_PATH` | ❌ | Path to seed connections YAML config (see [Seed Connections](#seed-connections-pre-configured-databases)) |\n| `SEED_CACHE_TTL_MS` | ❌ | Seed config cache TTL in ms (default: `60000`) |\n\n\u003e **Tip**: Copy `.env.example` to `.env.local` for local development.\n\n---\n\n## Deployment (DevOps)\n\n### Koyeb (Recommended for cloud deployment)\n\n1. **Fork this repository**\n2. **Connect to Koyeb**: [app.koyeb.com](https://app.koyeb.com) → New → Blueprint\n3. **Select your forked repo** and Koyeb will auto-detect `koyeb.yaml`\n4. **Set Environment Variables** in Koyeb Dashboard:\n5. **Deploy!** 🎉\n\n### Render (Recommended for cloud deployment)\n\nLibreDB Studio includes a `render.yaml` Blueprint for one-click deployment:\n\n1. **Fork this repository**\n2. **Connect to Render**: [dashboard.render.com](https://dashboard.render.com) → New → Blueprint\n3. **Select your forked repo** and Render will auto-detect `render.yaml`\n4. **Set Environment Variables** in Render Dashboard:\n5. **Deploy!** 🎉\n\n### Docker Compose (Self-Hosted)\n\n```bash\ndocker-compose up -d\n```\n\n### Kubernetes (Helm Chart)\n\n```bash\nhelm repo add libredb https://libredb.org/libredb-studio/\nhelm install libredb libredb/libredb-studio \\\n  --set secrets.jwtSecret=$(openssl rand -base64 32) \\\n  --set secrets.adminPassword=MyAdmin123 \\\n  --set secrets.userPassword=MyUser123\n```\n\nOr via OCI registry:\n```bash\nhelm install libredb oci://ghcr.io/libredb/charts/libredb-studio --version 0.1.0 \\\n  --set secrets.jwtSecret=$(openssl rand -base64 32) \\\n  --set secrets.adminPassword=MyAdmin123 \\\n  --set secrets.userPassword=MyUser123\n```\n\nFeatures: PostgreSQL subchart, Ingress/TLS, HPA, PDB, NetworkPolicy, ExternalSecrets support. See [charts/libredb-studio/README.md](charts/libredb-studio/README.md) for full documentation.\n\n### Seed Connections (Pre-Configured Databases)\n\nPre-configure database connections via a YAML config file so users see them immediately after login. Ideal for Platform/SaaS deployments where admins provision databases for teams.\n\n**Features:**\n- Role-based access control (`admin`, `user`, `*` wildcard)\n- Hybrid model: `managed: true` (read-only, admin-controlled) or `managed: false` (editable copy for user)\n- Credentials injected via `${ENV_VAR}` syntax — never stored in config file\n- Hot-reload: config changes apply within 60s without restart\n- Works with Docker, docker-compose, and Kubernetes (Helm)\n\n**1. Create a config file** (`seed-connections.yaml`):\n\n```yaml\nversion: \"1\"\n\ndefaults:\n  managed: true\n  environment: production\n\nconnections:\n  - id: \"prod-analytics\"\n    name: \"Production Analytics\"\n    type: postgres\n    host: analytics-db.internal\n    port: 5432\n    database: analytics\n    user: \"readonly_user\"\n    password: \"${ANALYTICS_DB_PASSWORD}\"\n    roles: [\"admin\"]\n    color: \"#10B981\"\n\n  - id: \"dev-sandbox\"\n    name: \"Dev Sandbox\"\n    type: mysql\n    host: dev-mysql.internal\n    port: 3306\n    database: sandbox\n    user: \"dev_user\"\n    password: \"${DEV_DB_PASSWORD}\"\n    roles: [\"*\"]\n    managed: false\n```\n\n**2. Mount and configure:**\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDocker\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\ndocker run -v ./seed-connections.yaml:/app/config/seed-connections.yaml:ro \\\n  -e SEED_CONFIG_PATH=/app/config/seed-connections.yaml \\\n  -e ANALYTICS_DB_PASSWORD=secret \\\n  -e DEV_DB_PASSWORD=devsecret \\\n  ghcr.io/libredb/libredb-studio:latest\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDocker Compose\u003c/strong\u003e\u003c/summary\u003e\n\n```yaml\nservices:\n  app:\n    image: ghcr.io/libredb/libredb-studio:latest\n    volumes:\n      - ./seed-connections.yaml:/app/config/seed-connections.yaml:ro\n    environment:\n      SEED_CONFIG_PATH: /app/config/seed-connections.yaml\n      ANALYTICS_DB_PASSWORD: ${ANALYTICS_DB_PASSWORD}\n      DEV_DB_PASSWORD: ${DEV_DB_PASSWORD}\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eKubernetes (Helm)\u003c/strong\u003e\u003c/summary\u003e\n\n```yaml\n# values.yaml\nseedConnections:\n  enabled: true\n  config:\n    version: \"1\"\n    connections:\n      - id: \"prod-analytics\"\n        name: \"Production Analytics\"\n        type: postgres\n        host: analytics-db.internal\n        password: \"${ANALYTICS_DB_PASSWORD}\"\n        roles: [\"admin\"]\n\n# Credentials via K8s Secret:\nextraEnvFrom:\n  - secretRef:\n      name: seed-db-credentials\n```\n\u003c/details\u003e\n\n**Config Reference:**\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `version` | Yes | Must be `\"1\"` |\n| `defaults` | No | Default values merged into all connections |\n| `connections[].id` | Yes | Unique slug (`[a-z0-9-]+`, max 64 chars) |\n| `connections[].name` | Yes | Display name in UI |\n| `connections[].type` | Yes | `postgres`, `mysql`, `sqlite`, `mongodb`, `redis`, `oracle`, `mssql` |\n| `connections[].roles` | Yes | `[\"*\"]` (everyone), `[\"admin\"]`, `[\"user\"]`, or `[\"admin\", \"user\"]` |\n| `connections[].managed` | No | `true` = read-only (default), `false` = editable copy for user |\n| `connections[].password` | No | Use `${ENV_VAR}` syntax for secrets |\n| `connections[].environment` | No | `production`, `staging`, `development`, `local`, `other` |\n| `connections[].group` | No | Group label in sidebar |\n| `connections[].color` | No | Hex color for badge (e.g., `#10B981`) |\n\n**Environment Variables:**\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `SEED_CONFIG_PATH` | `/app/config/seed-connections.yaml` | Path to config file |\n| `SEED_CACHE_TTL_MS` | `60000` | Cache TTL in ms (hot-reload interval) |\n\n---\n\n## Roadmap\n\n- [x] **Phase 1**: Monaco SQL IDE \u0026 Multi-Tab Support.\n- [x] **Phase 2**: Multi-Model AI (Gemini, OpenAI, Ollama, Custom) Integration.\n- [x] **Phase 3**: Pro Data Grid \u0026 Virtualization.\n- [x] **Phase 4**: Multi-Database Support (PostgreSQL, MySQL, SQLite, MongoDB, Redis).\n- [x] **Phase 5**: Interactive ER Diagrams (Visual Schema Graph).\n- [x] **Phase 6**: Enterprise Foundation (Connection Testing, SSL/TLS, SSH Tunnel, Transaction Control, Query Cancellation).\n- [x] **Phase 7**: AI Intelligence (NL2SQL, Query Safety Analysis, AI Index Advisor, Multi-Turn Chat, Query Autopilot).\n- [x] **Phase 8**: Analyst \u0026 Developer Tools (Data Profiler, Code Generator, Test Data Generator, Pivot Table, Column Filtering, Database Docs).\n- [x] **Phase 9**: Data Privacy (Automatic Sensitive Column Detection, Configurable Masking Patterns, RBAC-Enforced Masking, Export Protection).\n- [x] **Phase 10**: Advanced ERD (Real FK Edges, ELK.js Auto-Layout, MiniMap, PNG/SVG Export, Compact Mode, Table Search).\n- [x] **Phase 11**: Schema Diff \u0026 Migration (Snapshot Timeline, Cross-Connection Diff, Migration SQL Generation for PG/MySQL/SQLite).\n- [x] **Phase 12**: Advanced Charting (Scatter, Histogram, Stacked Charts, Aggregation, Date Grouping, Chart Save/Load, Chart Dashboard).\n- [x] **Phase 13**: Monitoring Enhancement (Time-Series Trends, Threshold Alerting, Connection Pool Stats, Configurable Polling).\n- [x] **Phase 14**: Enterprise Database Support (Oracle Database via oracledb Thin mode, Microsoft SQL Server via mssql/tedious).\n- [x] **Phase 15**: SSO Integration — Vendor-agnostic OIDC authentication (Auth0, Keycloak, Okta, Azure AD, Zitadel) with PKCE, role mapping, and provider logout.\n- [ ] **Phase 16**: DBA \u0026 Monitoring (Lock Dependency Graph, Vacuum Scheduler, Prometheus Export).\n- [ ] **Phase 17**: Enterprise Collaboration (User Identity, Shared Workspaces, SAML 2.0).\n\n---\n\n## Community \u0026 Quality\n\n| Resource | Description |\n|----------|-------------|\n| [DeepWiki](https://deepwiki.com/libredb/libredb-studio) | AI-powered documentation — always up-to-date with the codebase |\n| [SonarCloud](https://sonarcloud.io/project/overview?id=libredb_libredb-studio) | Code quality, security analysis, and technical debt tracking |\n| [API Docs](docs/API_DOCS.md) | Complete REST API reference |\n| [OIDC Setup Guide](docs/OIDC_SETUP.md) | SSO configuration for Auth0, Keycloak, Okta, Azure AD, Zitadel |\n| [OIDC Architecture](docs/OIDC_ARCH.md) | OIDC subsystem internals, security model, extension points |\n| [Theming Guide](docs/THEMING.md) | CSS theming, dark mode, and styling customization |\n| [Architecture](docs/ARCHITECTURE.md) | System architecture and design patterns |\n\n---\n\n## Contributing\n\nWe welcome contributions from the community! Whether it's a bug fix, a new feature, or documentation improvements:\n1. Fork the Project.\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`).\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`).\n4. Push to the Branch (`git push origin feature/AmazingFeature`).\n5. Open a Pull Request.\n\n---\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n---\n\n\u003cp align=\"center\"\u003e\n  Built for DBAs and Developers.\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibredb%2Flibredb-studio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibredb%2Flibredb-studio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibredb%2Flibredb-studio/lists"}