dbc-schema
Generate Effect Schema definitions for WoW DBC tables. Use when adding new game data tables or updating existing schemas.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
DBC Schema Generator
Generate Effect Schema definitions for WoW database tables.
Schema Location
packages/wowlab-core/src/internal/schemas/dbc/
Schema Template
// {TableName}Schema.ts
import * as Schema from "effect/Schema";
export class {TableName} extends Schema.Class<{TableName}>("{TableName}")({
ID: Schema.Number,
// Other fields - preserve CSV column order!
Name: Schema.String,
Description: Schema.String,
Flags: Schema.Number,
// ...
}) {}
export const {TableName}Schema = Schema.Array({TableName});
Important Rules
- Preserve CSV column order - perfectionist sorting is disabled for DBC schemas
-
Use Schema primitives -
Schema.Number,Schema.String,Schema.Boolean -
Nullable fields - Use
Schema.NullOr(Schema.Number)for optional numeric fields -
Arrays - Use
Schema.Array(Schema.Number)for array columns
Column Type Mapping
| CSV Type | Effect Schema |
|---|---|
| int | Schema.Number |
| float | Schema.Number |
| string | Schema.String |
| localized string | Schema.String |
| bool | Schema.Boolean |
| foreign key | Schema.Number (reference to another table ID) |
Registration
After creating schema, register in DbcTableRegistry.ts:
import { {TableName} } from "./internal/schemas/dbc/{TableName}Schema.js";
// Add to registry type
export type DbcTableName =
| "Spell"
| "{TableName}" // Add here
| ...;
// Add to row type mapping
export type DbcRow<T extends DbcTableName> =
T extends "{TableName}" ? {TableName} :
...;
Instructions
- Get CSV headers from DBC table
- Map columns to Schema types
- Generate schema class (preserve column order!)
- Register in DbcTableRegistry
- Re-export from Schemas.ts if public API
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-30
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!