SQL Database Support for pREST
prest/prest
Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.
数据库学习与选型技能。面向零基础学习者,系统学习数据结构、事务、索引、查询优化等核心概念,对比 MySQL 与 PostgreSQL 的差异与适用场景。触发词:"数据库学习"、"学数据库"、"数据库入门"、"MySQL vs PostgreSQL"、"数据库索引"、"数据库事务"、"数据库选型"、"数据库查询优化"。
$ npx skills add jiushiwon/wg-skills --skill database-learning-skill -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jiushiwon/wg-skills database-learning-skill --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/vibeCoding/backend/database/database-learning-skill .claude/skills/database-learning-skill && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "database-learning-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/database/database-learning-skill into .claude/skills/database-learning-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-learning-skill", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/database/database-learning-skillType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add jiushiwon/wg-skills --skill database-learning-skill -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jiushiwon/wg-skills database-learning-skill --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/vibeCoding/backend/database/database-learning-skill .agents/skills/database-learning-skill && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "database-learning-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/database/database-learning-skill into .agents/skills/database-learning-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-learning-skill", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiushiwon/wg-skills --skill database-learning-skill -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jiushiwon/wg-skills database-learning-skill --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/vibeCoding/backend/database/database-learning-skill .cursor/skills/database-learning-skill && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "database-learning-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/database/database-learning-skill into .cursor/skills/database-learning-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-learning-skill", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/jiushiwon/wg-skills.git --path vibeCoding/backend/database/database-learning-skill--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add jiushiwon/wg-skills --skill database-learning-skill -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jiushiwon/wg-skills database-learning-skill --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/vibeCoding/backend/database/database-learning-skill .gemini/skills/database-learning-skill && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "database-learning-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/database/database-learning-skill into .gemini/skills/database-learning-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-learning-skill", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jiushiwon/wg-skills database-learning-skillInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jiushiwon/wg-skills --skill database-learning-skill -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/vibeCoding/backend/database/database-learning-skill .github/skills/database-learning-skill && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "database-learning-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/database/database-learning-skill into .github/skills/database-learning-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-learning-skill", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiushiwon/wg-skills --skill database-learning-skill -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jiushiwon/wg-skills database-learning-skill --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jiushiwon/wg-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/vibeCoding/backend/database/database-learning-skill .opencode/skills/database-learning-skill && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "database-learning-skill" agent skill from https://github.com/jiushiwon/wg-skills/tree/main/vibeCoding/backend/database/database-learning-skill into .opencode/skills/database-learning-skill/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "database-learning-skill", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
database-learning-skill数据库学习与选型技能。面向零基础学习者,系统学习数据结构、事务、索引、查询优化等核心概念,对比 MySQL 与 PostgreSQL 的差异与适用场景。触发词:"数据库学习"、"学数据库"、"数据库入门"、"MySQL vs PostgreSQL"、"数据库索引"、"数据库事务"、"数据库选型"、"数据库查询优化"。
Database Learning Skill is an agent skill from jiushiwon/wg-skills. 数据库学习与选型技能。面向零基础学习者,系统学习数据结构、事务、索引、查询优化等核心概念,对比 MySQL 与 PostgreSQL 的差异与适用场景。触发词:"数据库学习"、"学数据库"、"数据库入门"、"MySQL vs PostgreSQL"、"数据库索引"、"数据库事务"、"数据库选型"、"数据库查询优化"。
Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `README.md`, `references/index-guide.md` and `references/mysql-vs-pgsql.md`).
It sits in Databases. It works with PostgreSQL, MySQL and SQL. The licence is Apache-2.0.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit a4a640b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
mysqlFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Database Learning Skill loads about 1k tokens when it runs, and up to ~9.6k if it reads all its reference files. Until then it costs about 46 tokens; SKILL.md has 279 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from jiushiwon/wg-skills at commit a4a640b, republished under its Apache-2.0 licence (© jiushiwon). 279 words, ~1,002 tokens.
.claude/skills/database-learning-skill/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.面向零基础学习者,系统学习数据库核心概念,掌握数据库选型与优化能力。
数据库 = 数据的仓库 + 管理的艺术
学数据库不是背命令,而是理解:
数据库入门
↓
表结构设计(数据结构)
↓
数据查询(SQL 基础)
↓
索引与查询优化
↓
事务与并发控制
↓
MySQL vs PostgreSQL 选型| 概念 | 说明 |
|---|---|
| 表(Table) | 数据的二维表格,像 Excel |
| 字段(Column) | 表的列,如 id、name、age |
| 记录(Row) | 表的行,一条数据 |
| 主键(Primary Key) | 唯一标识一条记录 |
| 外键(Foreign Key) | 表与表的关联 |
| 约束 | 数据的规则(唯一、非空、默认值) |
实战:设计一个用户表、一个订单表
| 操作 | SQL 关键字 |
|---|---|
| 查询 | SELECT |
| 插入 | INSERT |
| 更新 | UPDATE |
| 删除 | DELETE |
| 条件 | WHERE |
| 排序 | ORDER BY |
| 分组 | GROUP BY |
| 聚合 | COUNT/SUM/AVG/MAX/MIN |
为什么需要索引?
无索引:逐行扫描 → 10万行 = 10万次 IO
有索引:B+Tree 定位 → 10万行 ≈ 3次 IO| 索引类型 | 说明 | 适用场景 |
|---|---|---|
| 主键索引 | 自动唯一,非空 | 主键字段 |
| 唯一索引 | 字段值唯一 | username、email |
| 普通索引 | 加速查找 | 常用查询字段 |
| 复合索引 | 多字段组合 | 多条件查询 |
| 全文索引 | 文本搜索 | 文章内容搜索 |
最左前缀原则:复合索引 (a, b, c) 能命中 a、a+b、a+b+c,不能命中 b、c
什么是事务?
事务 = 一组 SQL 操作,要么全部成功,要么全部失败
转账场景:
1. A 账户 -1000
2. B 账户 +1000
必须一起成功或一起失败ACID 特性
| 特性 | 说明 |
|---|---|
| Atomic(原子性) | 不可分割,要么全成功要么全失败 |
| Consistency(一致性) | 事务前后数据状态一致 |
| Isolation(隔离性) | 并发事务互不干扰 |
| Durability(持久性) | 提交后数据永久保存 |
隔离级别
| 级别 | 脏读 | 不可重复读 | 幻读 |
|---|---|---|---|
| 读未提交 | 有 | 有 | 有 |
| 读已提交 | 无 | 有 | 有 |
| 可重复读 | 无 | 无 | 有 |
| 串行化 | 无 | 无 | 无 |
MySQL 默认:可重复读(RR) PostgreSQL 默认:读已提交(RC)
为什么要优化?
慢查询是数据库性能的最大杀手。一个没有索引的查询可能让整个系统变慢。
如何发现慢查询?
-- MySQL:开启慢查询日志
SHOW VARIABLES LIKE 'slow_query_log';
SELECT * FROM slow_log ORDER BY start_time DESC LIMIT 10;
-- PostgreSQL:查看慢查询统计
SELECT * FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
-- 使用 EXPLAIN 分析查询
EXPLAIN SELECT * FROM users WHERE username = 'test';核心优化思路
详细的性能优化规范见
database-design-skill。
| 特性 | MySQL | PostgreSQL |
|---|---|---|
| 定位 | Web 应用 | 企业级/复杂查询 |
| 事务 | 支持 | 支持(更完善) |
| JSON | 支持 | 更强(JSONB) |
| 全文搜索 | 基础 | 强大 |
| 地理信息 | 插件 | 原生支持 |
| 窗口函数 | 支持 | 完整支持 |
| CTEs | 8.0+ 支持 | 原生支持 |
| 主从复制 | MySQL Binlog | PostgreSQL WAL |
| 性能 | 简单查询快 | 复杂查询强 |
| 生态 | 广泛 | 增长快 |
选型建议
| 场景 | 推荐 |
|---|---|
| 博客、CMS、电商 | MySQL |
| 数据分析、报表 | PostgreSQL |
| 需要 JSON 文档 | PostgreSQL |
| 需要 GIS 地理 | PostgreSQL |
| 团队熟悉 MySQL | MySQL |
| 需要事务强一致性 | PostgreSQL |
| 高并发简单查询 | MySQL |
| 复杂查询/联表 | PostgreSQL |
详细的设计规范(命名、字段类型、索引设计、分库分表等)见
database-design-skill。
速查要点:
wg_,单数名词id、status、created_at、updated_at、deleted_at数据库学习:
/database-learning-skill 什么是数据库事务
/database-learning-skill 索引是什么
/database-learning-skill MySQL 和 PostgreSQL 区别
/database-learning-skill 怎么优化慢查询
/database-learning-skill 复合索引怎么用
/database-learning-skill 帮我设计一个用户表| 文件 | 内容 |
|---|---|
references/sql-basics.md | SQL 基础语法速查 |
references/index-guide.md | 索引详解与实战 |
references/transaction-guide.md | 事务与并发控制 |
references/query-optimization.md | 查询优化实战 |
references/mysql-vs-pgsql.md | MySQL vs PG 选型对比 |
database-design-skill:数据库设计规范mysql-guide-skill:MySQL 集成pgsql-guide-skill:PostgreSQL 集成springboot-init-skill:后端骨架(含数据库集成)fastapi-init-skill:后端骨架(含数据库集成)go-gin-init-skill:后端骨架(含数据库集成)© jiushiwon, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 6 other files (references) in vibeCoding/backend/database/database-learning-skill of jiushiwon/wg-skills.
Open the folder on GitHubat commit a4a640b
Database Learning Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Database Learning Skill this skilljiushiwon/wg-skills | 110 | — | ~1k | Automated safety check: Pass | Apache-2.0 | |
| SQL Database Support for pRESTprest/prest | 4.6k | — | ~1.6k | Automated safety check: Pass | MIT | |
| Chdb SQLvemetric/vemetric | 394 | 1 repos | ~1.2k | Automated safety check: Pass | Apache-2.0 | |
| Sql2erystemsrx/sql_to_ER | 188 | — | ~1.1k | Automated safety check: Pass | AGPL-3.0 | |
| Squixeduardofuncao/squix | 273 | — | ~784 | Automated safety check: Pass | MIT | |
| Golang Databaseunxed/f4 | 240 | 2 repos | ~2.9k | Automated safety check: Pass | MIT |
prest/prest
Guides classifying, gap-analyzing and scaffolding support for a new SQL database in pREST, from Postgres-compatible variants to entirely new dialects.
vemetric/vemetric
A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…
ystemsrx/sql_to_ER
A skill your agent uses when the user wants a Chen-model ER diagram from SQL CREATE TABLE statements or DBML, wants to rearrange or clean up an existing sql2er state, wants a skeleton-only overview…
eduardofuncao/squix
Run SQL queries across databases (Postgres, MySQL, SQLite, etc.) via the squix CLI.
unxed/f4
Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…
rmyndharis/antigravity-skills
SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server
jiushiwon/wg-skills
A skill your agent uses when generating UI for a specific scenario (mobile/PC/官网/管理端/营销页/文档/金融/原生/3D), when refactoring an existing HTML/Vue/React project to a unified design system, when extracting…
jiushiwon/wg-skills
A skill your agent uses when 用户想用一句话生成流程图、工作流图解、开发流程图、AI 流程图或任何步骤型图解,支持多风格输出(flat icon / 暖白手账风 / dark / cute),并提供现成模板一键出图。
jiushiwon/wg-skills
This skill should be used when the user wants to create a standardized uni-app project for WeChat mini-program, H5, and App from scratch.
jiushiwon/wg-skills
FastAPI 项目一键初始化技能。面向零基础小白,提供环境探测、自动安装、完整 Web 骨架生成、SSE 流式框架、JWT 鉴权、统一响应封装、文件上传接口、一键启动/重启脚本、Swagger 文档,内置 MySQL(默认)/ PostgreSQL / MongoDB 数据库选择。用户只需说"帮我搭一个 FastAPI 项目"即可一条命令完成从零到跑的完整链路。触发词:"FastAPI…
jiushiwon/wg-skills
FFmpeg 多媒体处理技能 — 将自然语言描述转为正确的 ffmpeg 命令,覆盖视频剪辑、转码、水印、合成、提取、生成等操作。内置一键安装脚本(Windows/Mac/Linux)。触发词:ffmpeg、视频剪辑、视频裁剪、视频转码、视频压缩、去水印、加水印、视频拼接、视频合成、提取音频、视频转…
jiushiwon/wg-skills
A skill your agent uses when designing or reviewing the request layer of a frontend project (web / uni-app / mini-program), including request.ts wrappers, interceptors, deduplication, mocks, error…
Works with
Categories
数据库学习与选型技能。面向零基础学习者,系统学习数据结构、事务、索引、查询优化等核心概念,对比 MySQL 与 PostgreSQL 的差异与适用场景。触发词:"数据库学习"、"学数据库"、"数据库入门"、"MySQL vs PostgreSQL"、"数据库索引"、"数据库事务"、"数据库选型"、"数据库查询优化"。. Database Learning Skill is an agent skill from jiushiwon/wg-skills.
Database Learning Skill fits situations like: databases work in your project.
Run `npx skills add jiushiwon/wg-skills --skill database-learning-skill -a claude-code`. Or copy the skill folder (vibeCoding/backend/database/database-learning-skill in jiushiwon/wg-skills) into .claude/skills/database-learning-skill in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jiushiwon/wg-skills --skill database-learning-skill -a codex`. Or copy the skill folder (vibeCoding/backend/database/database-learning-skill in jiushiwon/wg-skills) into .agents/skills/database-learning-skill in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jiushiwon/wg-skills --skill database-learning-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-learning-skill, .gemini/skills/database-learning-skill, .github/skills/database-learning-skill and .opencode/skills/database-learning-skill in your project.
Going by SKILL.md and its folder, Database Learning Skill needs the command-line tools its instructions call (mysql).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Database Learning Skill is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1k tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 8.6k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Database Learning Skill: SQL Database Support for pREST (prest/prest, 4.6k stars), Chdb SQL (vemetric/vemetric, 394 stars), Sql2er (ystemsrx/sql_to_ER, 188 stars) and Squix (eduardofuncao/squix, 273 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jiushiwon (a GitHub user) maintains it in jiushiwon/wg-skills, which has 110 GitHub stars. The repository holds 121 skills in this directory. The repository was last updated on October 4, 2026.
Source: jiushiwon/wg-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.