@GitHub_Daily: When using AI to help write SQL, you first have to copy the table structures to it one by one. When there are many fiel…
Summary
Gridex 是一个开源的跨平台(macOS/Windows/Linux)AI 原生数据库客户端,内置 AI 聊天可直接读取表结构并支持 Claude、GPT、Gemini 和本地 Ollama,同时提供带权限分级与审计日志的 MCP 服务,可同时连接 PostgreSQL、MySQL、SQLite、Redis、MongoDB、SQL Server 和 ClickHouse。
View Cached Full Text
Cached at: 10/05/26, 07:37 PM
When using AI to help write SQL, you first have to copy the table structures to it one by one. When there are many fields, you end up pasting back and forth several rounds and it’s still easy to miss some.
Gridex is an open-source database client that uses the system’s native interface on Mac, Windows, and Linux for writing. The Mac version can connect to 7 types of databases: PostgreSQL, MySQL, SQLite, Redis, MongoDB, SQL Server, and ClickHouse.
The built-in AI can directly read the table structures. It supports Claude, GPT, Gemini, and local Ollama. SQL is written only for the currently selected connection, and it runs read-only queries.
GitHub: http://github.com/gridex/gridex
It also comes with an MCP service. After connecting to Claude Desktop or Cursor, the tools are tiered by permissions—modifying data requires our approval, and every call is logged in the audit log.
Account passwords are stored in the system keychain, without cloud sync, and it doesn’t collect usage data. For backends managing several types of databases, installing this one can save you from opening several extra windows.
gridex/gridex
Source: https://github.com/gridex/gridex
Gridex
AI-native database IDE for macOS, Windows, and Linux.
One app for PostgreSQL, MySQL, SQLite, Redis, MongoDB, SQL Server, and ClickHouse — with a built-in MCP server and AI chat.
Download
macOS — universal DMG (Apple Silicon + Intel), signed & notarized, auto-update via Sparkle · Windows — Velopack installer, Windows 10/11 · Linux — x86_64 AppImage, Qt 6, self-update from JSON feed
Looking for a specific version, delta updates, or checksums? See all releases or the download page.
Supported Databases
Seven drivers in one native binary. All share the same DatabaseAdapter protocol (~50 methods) so every feature — grid, query editor, ER diagram, backup, MCP — works identically across engines.
Why Gridex
- Native. AppKit on macOS, WinUI 3 on Windows, Qt 6 on Linux. No Electron, no web views for the grid.
- Multi-database. Seven drivers on macOS, six on Linux/Windows (ClickHouse macOS-only for now), each with the right primitives (SCAN for Redis, aggregations for MongoDB, stored procedures for SQL Server, sequences for Postgres, MergeTree mutations for ClickHouse).
- AI that sees your schema. Claude, GPT, Gemini, and Ollama can read your tables, run read-only queries, and write SQL scoped to the connection you pick.
- MCP server built in. Plug Gridex into Claude Desktop, Cursor, or any MCP client over stdio — 13 tools with a 3-tier permission model and audit trail.
- Credentials stay local. macOS Keychain / Windows Credential Manager. No cloud sync, no telemetry, no proxy.
Driver Highlights
| Database | Driver | Highlights |
|---|---|---|
| PostgreSQL | PostgresNIO | Parameterized queries, mTLS, sequences, full schema inspection |
| MySQL | MySQLNIO | Charset handling, parameterized queries, TLS, auto-reconnect with keepalive |
| SQLite | System libsqlite3 | File-based, WAL mode, zero config |
| Redis | RediStack | Key browser, SCAN filter, Server INFO dashboard, Slow Log viewer, rediss:// TLS |
| MongoDB | MongoKitten | Document editor, NDJSON backup/restore, aggregation pipeline |
| SQL Server | CosmoSQLClient | TDS 7.4 (no FreeTDS), native BACKUP DATABASE, stored procedures |
| ClickHouse | Pure Swift (URLSession HTTP) | HTTP/HTTPS on ports 8123/8443, full mTLS via PKCS#12, system.* introspection, version-aware fallbacks (CH 20.8+) |
MCP Server
Expose any saved connection to MCP clients (Claude Desktop, Cursor, custom agents). Available on macOS (stdio), Windows (stdio + HTTP), and Linux (stdio). Every tool call runs through a permission gate and is recorded in the audit log.
15 tools across 5 permission tiers:
| Tier | Tools | When it runs |
|---|---|---|
| Schema | list_connections, list_schemas, list_tables, describe_table, list_relationships, get_sample_rows | Always allowed for enabled connections |
| Read | query, explain_query, search_across_tables | Allowed in read_only+ modes; SQL sanitizer rejects write statements |
| Write | insert_rows, update_rows, delete_rows, execute_write_query | Only in read_write mode; row-count estimator flags bulk changes; user approval required |
| DDL | (future schema migration tools) | Requires read_write + explicit user approval |
| Advanced | (future admin tools) | Requires explicit user approval |
Security layers in macos/Services/MCP/Security/:
MCPPermissionEngine— per-connection mode (locked,read_only,read_write)MCPSQLSanitizer— rejects DDL/DML that escape the declared tierMCPIdentifierValidator— guards against SQL injection in identifiersMCPRowCountEstimator— previews how many rows a mutation will touchMCPRateLimiter— caps calls per tool per minuteMCPApprovalGate— prompts the user for destructive actions
MCP window — 5 tabs: Overview, Setup, Connections, Activity, Advanced.
Every tool invocation lands in the activity log with tier, SQL, duration, row count, and approval state — so you can answer “what did the agent do last night?” without guessing.
ER Diagram
- macOS: custom
NSView+ CoreGraphics renderer. Windows: in-process Dagre layout + WebView. No externald2/Graphviz binary on either platform. - Auto-layout, pan, zoom, fit-to-view, FK relationship routing.
- Reads live schema from the active adapter — no separate import step.
- Click a column to jump to its table; double-click to open data.
AI Chat
Built-in chat that understands your schema and writes SQL scoped to the selected connection.
- Anthropic Claude — streaming, tool use, extended thinking
- OpenAI — GPT-4.x / 5.x, function calling
- Google Gemini — Flash and Pro
- Ollama — local LLMs, no API key needed
Requests go direct from your machine to the provider. Gridex never proxies prompts. API keys live in the macOS Keychain / Windows Credential Manager.
Editor & Grid
Data grid
- Inline cell editing with type-aware parsing
- Sort, filter, paginate, column resize, multi-column sort
- Add/delete rows with pending-change tracking — commit as one transaction
- Copy rows, export to CSV / JSON / SQL
Query editor
- Multi-tab with Chrome-style tab bar grouped by database
- Syntax highlighting (keywords, strings, numbers, comments, functions)
- Execute selection or all
- Redis CLI mode for Redis connections
- Query history persisted via SwiftData — searchable, favoritable
Schema tools
- Structure viewer: columns, indexes, foreign keys, constraints
- Function and stored-procedure inspector (source + parameters)
- Create Table / Create Database sheets with type-aware defaults
SSH Tunnel
Password, private-key, or key-with-passphrase auth. Local port forwarding via swift-nio-ssh. Managed by the SSHTunnelService actor — one tunnel per active connection, torn down on disconnect.
mTLS (Teleport-style)
Connections support sslKeyPath + sslCertPath + sslCACertPath for mutual TLS. Works end-to-end for PostgreSQL, MySQL, Redis, and ClickHouse — drop in the certs a tool like Teleport issues and connect as usual. ClickHouse accepts PKCS#12 client bundles with pinned CA (PEM or DER).
Backup & Restore
| Database | Backup |
|---|---|
| PostgreSQL | pg_dump (custom / SQL / tar) + pg_restore |
| MySQL | mysqldump + mysql |
| SQLite | File copy |
| MongoDB | NDJSON (one doc per line, pure Swift) |
| Redis | JSON snapshot via SCAN (pure Swift) |
| SQL Server | Native BACKUP DATABASE |
| ClickHouse | SQL dump (SHOW CREATE TABLE + FORMAT Values, pure Swift) |
Selective table backup, compression, and progress reporting for the CLI-backed formats.
Import
Connections import from TablePlus, Navicat (NCX with Blowfish decrypt), DataGrip, and DBeaver — including SSH configs and keychain-stored passwords.
Requirements
macOS
- macOS 14.0 (Sonoma) or later
- Swift 5.10+ / Xcode 15+
Windows
- Windows 10 or later (64-bit)
- Visual Studio 2022+, .NET 8 SDK, vcpkg
Linux
- Ubuntu 22.04+/24.04, Debian 12, Fedora 40 (or any distro with Qt 6 ≥ 6.4)
- GCC ≥ 11 or Clang ≥ 14, CMake ≥ 3.24, Ninja, Qt 6 dev packages
Build & Run
macOS
git clone https://github.com/gridex/gridex.git
cd gridex
# Debug (ad-hoc signed, fast local testing)
swift build
.build/debug/Gridex
# Or build .app bundle
./scripts/build-app.sh
open dist/Gridex.app
Linux
git clone https://github.com/gridex/gridex.git
cd gridex
cmake -S linux -B linux/build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build linux/build --parallel
./linux/build/gridex
Full Linux build, packaging, and AppImage instructions in linux/README.md.
Windows
See windows/README.md for the full WinUI 3 / vcpkg / Velopack toolchain.
Release
# Apple Silicon
./scripts/release.sh # → dist/Gridex-<version>-arm64.dmg
# Intel
ARCH=x86_64 ./scripts/release.sh # → dist/Gridex-<version>-x86_64.dmg
# Both architectures
./scripts/release-all.sh
Pipeline: swift build → .app bundle → code sign → notarize → staple → DMG → sign DMG → notarize DMG.
| Variable | Description |
|---|---|
ARCH | arm64 or x86_64 (default: host) |
SIGN_IDENTITY | Developer ID certificate SHA-1 (or set in .env) |
NOTARY_PROFILE | notarytool keychain profile (default: gridex-notarize) |
NOTARIZE | Set to 0 to skip notarization |
Auto-update channels:
- macOS — Sparkle, signed/stapled DMGs advertised via appcast.
- Windows — Velopack (
vpk) packaged installer + delta updates. - Linux — AppImage with self-update against a JSON feed hosted on Cloudflare R2.
Architecture
Clean Architecture, 5 layers. Dependencies point inward.
gridex/
├── macos/ macOS app (Swift, AppKit + SwiftUI)
│ ├── App/ Lifecycle, DI container, AppState
│ ├── Core/ Protocols, models, enums — zero deps
│ │ ├── Protocols/ DatabaseAdapter, LLMService, SchemaInspectable, MCPTool
│ │ └── Models/ RowValue, ConnectionConfig, QueryResult, MCPAuditEntry
│ ├── Domain/ Use cases, repository protocols
│ ├── Data/ Adapters + SwiftData persistence + Keychain
│ │ └── Adapters/ SQLite, PostgreSQL, MySQL, MongoDB, Redis, MSSQL, ClickHouse
│ ├── Services/ Cross-cutting
│ │ ├── QueryEngine/ ConnectionManager, QueryEngine, QueryBuilder
│ │ ├── AI/ Anthropic, OpenAI, Gemini, Ollama providers
│ │ ├── MCP/ MCPServer, StdioTransport, Tools (Tier1/2/3), Security
│ │ ├── SSH/ SSHTunnelService (NIOSSH)
│ │ └── Export/ ExportService, BackupService
│ └── Presentation/ AppKit views, SwiftUI settings, ViewModels
├── windows/ Windows app (C++, WinUI 3)
├── linux/ Linux app (C++20, Qt 6) — adapters, MCP, AppImage
├── scripts/ Build and release automation
└── Package.swift SPM manifest
Key protocols
DatabaseAdapter— connection lifecycle, queries, schema, CRUD, transactions, pagination. All 7 adapters conform.LLMService— streaming AI responses viaAsyncThrowingStream. All 4 providers conform.SchemaInspectable— full schema snapshot for the AI context engine and ER diagram.MCPTool— MCP tool contract with tier, input schema, and permission-checked execute.
Concurrency
actorfor thread-safe services:QueryEngine,ConnectionManager,SSHTunnelService,BackupService,MCPServer.async/awaitthroughout — no completion handlers.Sendableon all data models.
Dependency injection
DependencyContainer (singleton) composes services at launch. SwiftData ModelContainer is shared across windows. Services are injected via the SwiftUI environment.
Dependencies
| Package | Version | Purpose |
|---|---|---|
| postgres-nio | 1.21.0+ | PostgreSQL driver |
| mysql-nio | 1.7.0+ | MySQL driver |
| swift-nio-ssl | 2.27.0+ | TLS for NIO-based drivers |
| swift-nio-ssh | 0.8.0+ | SSH tunnel support |
| RediStack | 1.6.0+ | Redis driver |
| MongoKitten | 7.9.0+ | MongoDB driver (pure Swift) |
| CosmoSQLClient-Swift | main | MSSQL via TDS 7.4 |
| Sparkle | 2.6.0+ | macOS auto-update |
System library: libsqlite3 (linked at build time). ClickHouse uses URLSession + Security.framework — no SPM dependency.
Star History
Community
Join the Discord to ask questions, share feedback, or follow release notes: https://discord.gg/UuV2Ktc6.
Contributing
Contributions are welcome. Please open an issue first to discuss what you’d like to change.
See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
License
Licensed under the Apache License, Version 2.0.
Copyright © 2026 Thinh Nguyen.
You may use, modify, and distribute this software — including in commercial or closed-source products — provided you preserve the copyright notice and NOTICE file. See the LICENSE for full terms.
Similar Articles
@tom_doerr: Connects to PostgreSQL, MySQL, SQLite, Redis, MongoDB, SQL Server, and ClickHouse through a single native desktop appli…
Gridex is an AI-native database IDE for macOS, Windows, and Linux that connects to PostgreSQL, MySQL, SQLite, Redis, MongoDB, SQL Server, and ClickHouse through a single native desktop application with a built-in MCP server and AI chat.
@XAMTO_AI: MySQL, PostgreSQL, Oracle, SQL Server, ClickHouse, MongoDB, Redis — one client connects to over thirty databases. You can also use natural language to generate SQL, explain SQL, and optimize SQL; just bring your own model. Chat…
Chat2DB is a client that supports over thirty databases, allowing you to generate, explain, and optimize SQL using natural language, with full platform support and an open-source CLI.
@Huahuazo: Attention, database folks — you no longer need to clutter your desktop with a bunch of clients. I stumbled upon a treasure tool called DBX, a single client that connects all mainstream databases: ① MySQL, PostgreSQL, SQLite ② Redis, MongoDB, ClickHouse ③ Even domestic ones like OceanBase and openGauss are supported.
DBX is a lightweight multi-database client supporting 60+ databases including MySQL, PostgreSQL, Redis, and MongoDB. The installer is only 15MB and comes with an AI assistant that can generate SQL from natural language.
@CycleDecoded: Navicat and DBeaver can really consider uninstalling. This AI database tool made by a Chinese team is absolutely crushing it. OtterMind / Chat2DB is an AI-driven multi-database client that went viral on GitHub, gaining 27,000+ Stars…
Chat2DB is an open-source AI-driven multi-database client launched by OtterMind, supporting 30+ database types. It can generate, explain, and optimize SQL through natural language. It has gained 27,000+ Stars on GitHub.
@gkxspace: Found a crazy open-source tool. You input a sentence describing what data you want, and it deploys a group of AI agents to research on various websites in parallel. After a few minutes, it compiles a structured table for you. In fact, the data is all on the internet, but turning it into a usable table has always been a labor-intensive task. In the past, this was an engineering project: combining searches, writing crawlers...
BigSet is an open-source tool. You input a sentence describing the data you need, and it deploys multiple AI agents to research the web in parallel, automatically inferring schema, deduplicating, verifying, and generating a structured table. It supports scheduled refreshes.