一键导入
sqlx
Expert guide for using the SQLx Rust crate (async, pure Rust SQL toolkit). Use this skill when the user is working with SQL databases in Rust using SQLx.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert guide for using the SQLx Rust crate (async, pure Rust SQL toolkit). Use this skill when the user is working with SQL databases in Rust using SQLx.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Best practices for writing clean, maintainable, and robust tests with TUnit.
Use `helium-browser --dump-dom` to inspect the fully rendered DOM after JavaScript execution. For debugging layout/scrolling issues and scraping dynamic pages.
Senior UI/UX Engineer. Architect digital interfaces overriding default LLM biases. Enforces metric-based rules, strict component architecture, CSS hardware acceleration, and balanced design engineering.
CLI tool for AI agents to browse the web, interact with UI elements, and analyze frontend applications. Supports navigation, clicking, typing, and capturing snapshots for accessibility analysis.
Expert guide for creating, configuring, and managing Opencode Agents. Use this skill when the user wants to create a new agent or modify an existing one.
Expert guide and best practices for building production-ready web APIs with Axum 0.8+ in Rust. Use this skill when developing, refactoring, or structuring Axum applications.
| name | sqlx |
| description | Expert guide for using the SQLx Rust crate (async, pure Rust SQL toolkit). Use this skill when the user is working with SQL databases in Rust using SQLx. |
SQLx is an async, pure Rust SQL crate featuring compile-time checked queries without a DSL. It supports PostgreSQL, MySQL, MariaDB, and SQLite. It is not an ORM but a toolkit for running raw SQL queries safely and efficiently.
query!, query_as!).Pool.Add sqlx to Cargo.toml with the necessary features (runtime + database).
# Example: Tokio + Postgres
[dependencies]
sqlx = { version = "0.8", features = [ "runtime-tokio", "tls-native-tls", "postgres" ] }
Create a connection pool (recommended) or a single connection.
use sqlx::postgres::PgPoolOptions;
let pool = PgPoolOptions::new()
.max_connections(5)
.connect("postgres://user:pass@localhost/db").await?;
Use sqlx::query (unprepared/prepared) or sqlx::query! (compile-time checked).
let row: (i64,) = sqlx::query_as("SELECT id FROM users WHERE email = $1")
.bind("user@example.com")
.fetch_one(&pool).await?;
Requires DATABASE_URL environment variable or .env file.
let countries = sqlx::query!(
"SELECT country, count FROM countries WHERE organization = ?",
organization
)
.fetch_all(&pool).await?;
Add migrations with sqlx migrate add -r <description> (use underscores instead of spaces in description). After adding, update the SQL code in migrations/<timestamp>_<description>.up.sql and migrations/<timestamp>_<description>.down.sql. Run migrations with sqlx migrate run. See sqlx --help and sqlx migrate --help for more options.
sqlx::migrate!("./migrations").run(&pool).await?;
examples/ directory in the repository for patterns.