advanced-alchemy-litestar by alti3/litestar-skills
npx skills add https://github.com/alti3/litestar-skills --skill advanced-alchemy-litestarSQLAlchemyAsyncConfig 或 SQLAlchemySyncConfig 并注册 SQLAlchemyPlugin。Litestar(...) 中,并通过提供者或依赖注入来提供服务。before_send_handler 和会话依赖键显式声明。db_session 使用控制器或处理程序注入。from advanced_alchemy.extensions.litestar import (
AsyncSessionConfig,
SQLAlchemyAsyncConfig,
SQLAlchemyPlugin,
)
from litestar import Litestar
alchemy_config = SQLAlchemyAsyncConfig(
connection_string="sqlite+aiosqlite:///test.sqlite",
before_send_handler="autocommit",
session_config=AsyncSessionConfig(expire_on_commit=False),
create_all=True,
)
app = Litestar(plugins=[SQLAlchemyPlugin(config=alchemy_config)])
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
db_session 或重命名的依赖项。before_send_handler 匹配。litestar database 命令可用。advanced-alchemy-routing 处理 CRUD 路由结构。advanced-alchemy-services 处理基于服务的控制器。advanced-alchemy-cli 处理通过 Litestar CLI 公开的迁移命令。litestar-app-setup、litestar-dependency-injection 或 litestar-dto。每周安装次数
1
代码仓库
GitHub 星标数
4
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
SQLAlchemyAsyncConfig or SQLAlchemySyncConfig and register SQLAlchemyPlugin.Litestar(...) and let providers or DI supply services.before_send_handler and session dependency keys explicit when changing defaults.db_session only when service injection is unnecessary.from advanced_alchemy.extensions.litestar import (
AsyncSessionConfig,
SQLAlchemyAsyncConfig,
SQLAlchemyPlugin,
)
from litestar import Litestar
alchemy_config = SQLAlchemyAsyncConfig(
connection_string="sqlite+aiosqlite:///test.sqlite",
before_send_handler="autocommit",
session_config=AsyncSessionConfig(expire_on_commit=False),
create_all=True,
)
app = Litestar(plugins=[SQLAlchemyPlugin(config=alchemy_config)])
db_session or renamed dependency.before_send_handler.litestar database commands are available when the plugin is installed.advanced-alchemy-routing for CRUD route structure.advanced-alchemy-services for service-backed controllers.advanced-alchemy-cli for migration commands exposed through Litestar CLI.litestar-app-setup, litestar-dependency-injection, or litestar-dto for deeper Litestar-only concerns.Weekly Installs
1
Repository
GitHub Stars
4
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketFailSnykPass
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装