Azure / Azure/data-api-builder
[Enh]: For auto-config entities support `@db()`
- 主要言語
- C#
- スター
- 1.5k
- フォーク
- 370
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 9
説明
## What
Today, `autoentities.template` does not include newer metadata-driven properties, such as `description`.
This enhancement allows `autoentities.template` to use `@db()` so generated entities, fields, and parameters can pull values from SQL Server extended properties.
This enhancement depends on:
* #2949
* #2940
## Behavior
`@db()` expressions inside `autoentities.template` follow the parent `@db()` specification.
The only special behavior is timing: template-based `@db()` expressions are resolved after auto-entity expansion because template macros are not available until generation time.
## Supported template macros
`@db()` expressions may use existing auto-entity template macros:
```text
{schema}
{object}
{column}
{parameter}
{type}
```
## Template example
```json
{
"template": {
"description": "@db('{schema}.{object}:MS_Description', '{type}')",
"source": {
"parameters": {
"description": "@db('{schema}.{object}.@{parameter}:MS_Description', '{type}')"
}
},
"fields": {
"description": "@db('{schema}.{object}.{column}:MS_Description', '{type}')"
}
}
}
```
## Requirements
* Auto-entity expansion must complete before resolving template-based `@db()` expressions.
* Template macros must be replaced before `@db()` parsing.
* Unresolved macros inside an `@db()` expression fail validation.
* Contextual shorthand is not supported inside `autoentities.template`.
* The parent `@db()` spec remains authoritative for parsing, validation, resolution, and error behavior.
コントリビューションガイド
調査の方向性
autoentities.template と親の @db() 仕様から始め、依存関係 #2949 と #2940 も確認してください。auto-entity の展開、テンプレートマクロの置換、@db() の解決がどの順序で行われるかを追跡します。完了の条件は、サポート対象のマクロが解決され、未解決のマクロで検証が失敗し、コンテキスト依存の短縮記法は引き続きサポートされず、親のパースとエラー動作が維持されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, sql
- 領域
- backend-api-design, databases
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100