🦀 ClawHub
database-admin
by @ericyang1234
提供数据库表结构设计、数据批量操作、复杂查询优化、类型处理及事务安全的全面数据库管理服务。
TERMINAL
clawhub install database-admin📖 About This Skill
name: database-admin description: Comprehensive database administration, schema management, data operations, and optimization. Use when Codex needs to: (1) Create or modify database tables with proper indexing, (2) Perform bulk data insertions with type safety and constraint handling, (3) Execute complex queries with JOINs, aggregations, and subqueries, (4) Optimize query performance through indexing and execution plan analysis, (5) Manage database backups, restores, and migrations, (6) Handle special data types (BIGINT, UUID, JSONB, enums), (7) Implement transactional safety with ACID compliance, or (8) Debug and resolve database errors including constraint violations, type mismatches, and foreign key issues
数据库管理员 Database Admin 📜
> "先严父后慈" —— 杜子美
本技能提供全面的数据库管理功能,包括表结构创建、数据操作、查询优化、类型处理(如 BIGINT)等。所有操作均遵循 SQL 最佳实践和事务安全原则。
核心能力
🔹 表结构设计
🔹 数据插入
🔹 查询优化
🔹 数据库维护
使用场景
当你需要以下操作时,请触发此技能:
技术细节
本技能在幕后会使用:
pg (PostgreSQL)pgpool 管理并发连接数据库配置(roadflow)
示例用法
创建表
创建一个库存表 stock_info,包含:
id (SERIAL PRIMARY KEY)
product_name (VARCHAR(100))
quantity (INT)
price (DECIMAL(10,2))
created_at (TIMESTAMP)
为 product_name 创建索引
插入数据
向 stock_info 表插入以下商品:
[{product_name: "苹果", quantity: 100, price: 8.5}, ...]
查询统计
计算每个类别的商品平均价格
WHERE quantity > 50
GROUP BY category
ORDER BY avg_price DESC
*技能由杜甫(📜)编写,秉承"致君尧舜上,再使风俗淳"的务实精神*