Critical: no array / list column type in declarative schema (need text[]) — forces jsonb workarounds
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with migrations/schema.yaml and the DataProviderMigrate entry point, then trace how the existing declarative column types are converted into migration operations. Define how an array type and its element type are represented, and verify that a text[] declaration is migrated in one pass without raw SQL or a separate post-migration step.
由索引模型根据 Issue 内容生成。
描述
Summary
The declarative migration schema (migrations/schema.yaml, applied via DataProviderMigrate) has no array / list column type. There is no way to declare a Postgres text[] (or any T[]) column. This forces a jsonb workaround for every naturally-array-shaped column, which loses array typing, element constraints, and the ability to use Postgres array operators / GIN indexing.
Severity: critical for any schema that needs first-class array columns — it changes the data model (jsonb instead of text[]) and pushes validation that the DB could enforce up into application code.
Where this bit us (real case)
NAP's BYO-IdP end-user auth needs a per-tenant allow-list of permitted JWT signing algorithms — naturally a text[]. There is no array type, so we modelled it as Json (jsonb):
# migrations/schema.yaml
- name: allowed_algs
type: Json # WANTED: a text[] / array type
isNullable: false
defaultValue: "'[]'::jsonb"
We could only make this safe because no RLS predicate parses the column — the verifier reads it in Python. If we had needed a DB-side constraint or an array containment check in a policy ('RS256' = ANY(allowed_algs)), jsonb would not have been sufficient and we'd have been stuck.
Types currently available
From a real production schema, the declarative types in use are: BigInt, Boolean, Date, DateTimeOffset, Decimal, Int, Json, Text, Uuid. None expresses an array.
Requested fix
Add a declarative array column type so text[] (and ideally uuid[], int[], etc.) can be expressed without dropping to jsonb. Strawman shape:
- name: allowed_algs
type: Array
elementType: Text
isNullable: false
defaultValue: "'{}'"
or an inline form such as type: "Text[]". Either is fine — the requirement is simply: a first-class array column type in the declarative schema, migrated the same one-pass way as every other column (no raw SQL / no separate post-migration step, since the consumer's hard rule is "no SQL/DDL in schema.yaml").
Why not just keep using jsonb
- jsonb arrays can't be used with native array operators (
= ANY(...),@>on typed arrays) the waytext[]can, including inside RLS policies. - jsonb loses element typing —
["RS256", 7, null]is a valid jsonb array;text[]rejects it. - It's a silent modelling compromise on every array-shaped column, not a one-off.
Context
Related docs gap: #72 (the documented column-type list is already known to be incomplete). This issue is about the missing capability, not just the docs.
- 主要语言
- C#
- 星标
- 68
- 派生
- 4
- 平均合并
- 50 分钟
- 30 天内合并 PR
- 2
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Nimblesite/DataProvider 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 92/100
Nimblesite/DataProvider#137 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
Nimblesite/DataProvider#72 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
Nimblesite/DataProvider#121 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
Nimblesite/DataProvider#108 ·
维护者通常 1 天内回复
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old rule未关闭
难度 4/5 3-5 天 新手友好度 48/100
Nimblesite/DataProvider#107 ·
维护者通常 1 天内回复
查看 Nimblesite/DataProvider 的全部 Issue
相似的 Issue
-
kronos:develop:queued priority:P0
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
nopSolutions/nopCommerce#8512 ·
维护者通常 4 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
modelcontextprotocol/csharp-sdk#2061 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复