Critical: no array / list column type in declarative schema (need text[]) — forces jsonb workarounds
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 68
- Fork
- 4
- Merge trung bình
- 50 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Nimblesite/DataProvider
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Nimblesite/DataProvider#137 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Nimblesite/DataProvider#72 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Nimblesite/DataProvider#121 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Nimblesite/DataProvider#108 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old ruleĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Nimblesite/DataProvider#107 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Nimblesite/DataProvider
Issue tương tự
-
kronos:develop:queued priority:P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nopSolutions/nopCommerce#8512 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
modelcontextprotocol/csharp-sdk#2061 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày