agentleFS
lightpointventureslightpointventures/claude-code-starter/skills/database/SKILL.md

database

Skill36 starsChanged 8 months agoMITView on GitHub

当用户想连数据库、存数据、建表、做数据模型、配置 SQLite/PostgreSQL/Supabase 时使用 — 配置数据库连接并生成增删改查

  • Reads credentials

24 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use monitoring, ci-cd and 4 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • rogue-dev-studioSkill

    monitoring

    Claude monitoring and usage tracking tools (UV, claude-monitor, claude-usage-cli). Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `monitoring` work when listed in TEAM.yaml or explicitly requested.

    Also in 3 projects that use this

  • JohnJBorenSkill

    ci-cd

    CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    i18n

    Internationalization and localization

    Also in 3 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 5 projects that use this

  • akornmeierSkill

    docker

    Guide for using Docker - a containerization platform for building, running, and deploying applications in isolated containers. Use when containerizing applications, creating Dockerfiles, working with Docker Compose, managing images/containers, configuring networking and storage, optimizing builds, deploying to production, or implementing CI/CD pipelines with Docker.

    Also in 3 projects that use this

  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 3 projects that use this

The file

Files
SKILL.md

连接数据库

帮用户为项目配置数据库,从连接到基本操作一步到位。

步骤

1. 了解需求

问题 1:存什么数据

你需要存储什么数据?比如用户信息、文章、订单、产品。

问题 2:数据库选择

推荐方案:

  • SQLite(最简单,不需要安装,适合入门和小项目)
  • PostgreSQL(生产推荐,功能强大)
  • Supabase(云端 PostgreSQL,免费额度大,自带管理界面) 不确定就用 SQLite,后面随时可以换。

2. 配置连接

根据选择配置数据库:

  • 安装依赖 — 添加对应的数据库驱动
  • 连接配置 — 数据库 URL 放到环境变量,生成 .env.example
  • 连接测试 — 确认能成功连接

3. 创建数据模型

根据用户描述的数据,生成:

  • 模型/Schema 定义 — 字段名、类型、约束(必填、唯一、默认值)
  • 表关系 — 一对多、多对多(如果有)
  • 迁移文件 — 创建表的迁移脚本

4. 生成 CRUD 函数

为每个模型生成基本操作:

  • Create — 创建记录,包含数据验证
  • Read — 查询列表(支持分页)和查询详情
  • Update — 更新记录
  • Delete — 删除记录

5. 验证

运行迁移,创建一条测试数据,查询确认写入成功。

数据库已配置完成。模型和 CRUD 函数已生成。 用 /api 可以把这些操作暴露为 API 接口。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.