Azure / Azure/data-api-builder
[Enh]: For auto-config entities support `@db()`
- Ngôn ngữ chính
- C#
- Star
- 1.5k
- Fork
- 370
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
## 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với autoentities.template và đặc tả @db() của phần tử cha, bao gồm các dependency #2949 và #2940. Theo dõi thứ tự của việc mở rộng auto-entity, thay thế macro của template và phân giải @db(); hoàn tất có nghĩa là các macro được hỗ trợ được phân giải, các macro chưa được phân giải khiến validation thất bại, cú pháp viết tắt theo ngữ cảnh vẫn không được hỗ trợ, và việc parse phần tử cha cùng hành vi lỗi được giữ nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, sql
- Lĩnh vực
- backend-api-design, databases
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100