소스 정보
- 저장소
- ffsshhttiikk/opencode-agents-skills
- 최근 소스 활동
- 2026년 2월 28일 22:49
- 감지된 SKILL.md 언어
- 영어
- 스타
- 2
- 포크
- 2
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill mysql명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | mysql |
| description | MySQL database management, replication, and performance optimization |
| category | databases |
I am the world's most popular open-source database, known for my reliability, ease of use, and strong community support. I provide a robust RDBMS with full ACID compliance (with InnoDB), efficient replication capabilities, and excellent performance for web applications. I support stored procedures, triggers, views, and a wide range of storage engines including InnoDB (transactional), MyISAM (non-transactional), and Memory. I am the backbone of countless web applications, content management systems, and e-commerce platforms.
import mysql.connector
from mysql.connector import Error
from contextlib import contextmanager
@contextmanager
def get_connection():
conn = mysql.connector.connect(
host="localhost",
database="app_db",
user="app_user",
password="secure_password",
port=3306
)
try:
yield conn
finally:
if conn.is_connected():
conn.close()
def create_user(email, name, password_hash):
query = """
INSERT INTO users (email, name, password_hash, created_at)
VALUES (%s, %s, %s, NOW())
"""
with get_connection() as conn:
cursor = conn.cursor()
cursor.execute(query, (email, name, password_hash))
conn.commit()
return cursor.lastrowid
def get_user_with_orders(user_id):
query = """
SELECT u.id, u.email, u.name, u.created_at,
o.id as order_id, o.total, o.status, o.created_at as order_date
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.id = %s
ORDER BY o.created_at DESC
"""
with get_connection() as conn:
cursor = conn.cursor(dictionary=True)
cursor.execute(query, (user_id,))
rows = cursor.fetchall()
user = None
orders = []
for row in rows:
if user is None:
user = {"id": row[], : row[],
: row[], : row[]}
row[]:
orders.append({: row[], : row[],
: row[], : row[]})
user[] = orders
user
():
query =
get_connection() conn:
cursor = conn.cursor()
cursor.execute(query, (new_email, user_id))
conn.commit()
cursor.rowcount >
():
query =
get_connection() conn:
cursor = conn.cursor()
cursor.execute(query, (days_inactive,))
conn.commit()
cursor.rowcount
from mysql.connector import Error
def transfer_funds(from_account, to_account, amount):
with get_connection() as conn:
cursor = conn.cursor()
try:
conn.start_transaction()
cursor.execute("SELECT balance FROM accounts WHERE id = %s FOR UPDATE", (from_account,))
result = cursor.fetchone()
if not result or result[0] < amount:
conn.rollback()
raise ValueError("Insufficient funds")
cursor.execute("UPDATE accounts SET balance = balance - %s WHERE id = %s", (amount, from_account))
cursor.execute("UPDATE accounts SET balance = balance + %s WHERE id = %s", (amount, to_account))
cursor.execute("INSERT INTO transactions (from_account, to_account, amount, created_at) VALUES (%s, %s, %s, NOW())",
(from_account, to_account, amount))
conn.commit()
return True
except Error as e:
conn.rollback()
raise e
def batch_create_orders(orders_data):
with get_connection() as conn:
cursor = conn.cursor()
try:
conn.start_transaction()
order_ids = []
for order in orders_data:
cursor.execute("""
INSERT INTO orders (user_id, total, status, shipping_address, created_at)
VALUES (%s, %s, 'pending', %s, NOW())
""", (order["user_id"], order["total"], order[]))
order_id = cursor.lastrowid
item order[]:
cursor.execute(, (order_id, item[], item[], item[]))
order_ids.append(order_id)
conn.commit()
order_ids
Error e:
conn.rollback()
e
import json
def get_sales_analytics(start_date, end_date):
query = """
SELECT
DATE(created_at) as sale_date,
COUNT(*) as total_orders,
SUM(total) as daily_revenue,
AVG(total) as avg_order_value,
RANK() OVER (ORDER BY SUM(total) DESC) as revenue_rank
FROM orders
WHERE created_at BETWEEN %s AND %s
GROUP BY DATE(created_at)
ORDER BY sale_date
"""
with get_connection() as conn:
cursor = conn.cursor(dictionary=True)
cursor.execute(query, (start_date, end_date))
return cursor.fetchall()
def search_products_with_json_filters(filters):
conditions = []
params = []
if "category" in filters:
conditions.append("JSON_EXTRACT(attributes, '$.category') = %s")
params.append(filters["category"])
if "min_price" in filters:
conditions.append("JSON_EXTRACT(attributes, '$.price') >= %s")
params.append(filters["min_price"])
if "in_stock" in filters and filters["in_stock"]:
conditions.append("JSON_EXTRACT(attributes, '$.in_stock') = true")
query = f"""
SELECT id, name, SKU,
JSON_EXTRACT(attributes, '$.price') as price,
JSON_EXTRACT(attributes, '$.category') as category
FROM products
{'WHERE ' + ' AND '.join(conditions) if conditions else ''}
ORDER BY CAST(JSON_EXTRACT(attributes, '$.popularity') AS UNSIGNED) DESC
LIMIT 50
"""
get_connection() conn:
cursor = conn.cursor(dictionary=)
cursor.execute(query, params)
cursor.fetchall()
():
query =
get_connection() conn:
cursor = conn.cursor(dictionary=)
cursor.execute(query)
cursor.fetchall()
from mysql.connector import pooling
connection_pool = pooling.MySQLConnectionPool(
pool_name="app_pool",
pool_size=10,
host="localhost",
database="app_db",
user="app_user",
password="secure_password"
)
def get_user_by_email(email):
conn = connection_pool.get_connection()
cursor = conn.cursor(dictionary=True)
try:
cursor.execute("SELECT * FROM users WHERE email = %s", (email,))
return cursor.fetchone()
finally:
cursor.close()
conn.close()
def bulk_insert_products(products):
conn = connection_pool.get_connection()
cursor = conn.cursor()
try:
query = """
INSERT INTO products (name, SKU, price, category, stock, created_at)
VALUES (%s, %s, %s, %s, %s, NOW())
"""
cursor.executemany(query, products)
conn.commit()
return cursor.rowcount
finally:
cursor.close()
conn.close()
def update_prices_by_category(category, price_multiplier):
conn = connection_pool.get_connection()
cursor = conn.cursor()
try:
cursor.execute("""
UPDATE products
SET price = ROUND(price * %s, 2),
updated_at = NOW()
WHERE category = %s
""", (price_multiplier, category))
conn.commit()
return cursor.rowcount
finally:
cursor.close()
conn.close()
def get_paginated_users(page=1, per_page=50):
offset = (page - ) * per_page
conn = connection_pool.get_connection()
cursor = conn.cursor(dictionary=)
:
cursor.execute()
total = cursor.fetchone()[]
cursor.execute(, (per_page, offset))
{
: cursor.fetchall(),
: total,
: page,
: per_page,
: (total + per_page - ) // per_page
}
:
cursor.close()
conn.close()
def search_products(query, limit=20):
search_query = """
SELECT id, name, description,
MATCH(name, description) AGAINST(%s IN NATURAL LANGUAGE MODE) as relevance
FROM products
WHERE MATCH(name, description) AGAINST(%s IN NATURAL LANGUAGE MODE)
ORDER BY relevance DESC
LIMIT %s
"""
with get_connection() as conn:
cursor = conn.cursor(dictionary=True)
cursor.execute(search_query, (query, query, limit))
return cursor.fetchall()
def search_with_boolean_mode(search_terms):
boolean_query = """
SELECT id, name, description,
MATCH(name, description) AGAINST(%s IN BOOLEAN MODE) as relevance
FROM products
WHERE MATCH(name, description) AGAINST(%s IN BOOLEAN MODE)
ORDER BY relevance DESC
LIMIT 50
"""
with get_connection() as conn:
cursor = conn.cursor(dictionary=True)
formatted_terms = " ".join(f"+{term}*" for term in search_terms.split())
cursor.execute(boolean_query, (formatted_terms, formatted_terms))
return cursor.fetchall()
def call_stored_procedure_get_order_summary(order_id):
with get_connection() as conn:
cursor = conn.cursor(dictionary=True)
cursor.callproc("get_order_summary", [order_id])
for result in cursor.stored_results():
return result.fetchall()
def call_stored_procedure_with_out_params(user_id):
get_connection() conn:
cursor = conn.cursor()
cursor.callproc(, [user_id, , ])
cursor.execute()
result = cursor.fetchone()
{: result[], : result[]}