You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support primitive collections as JSON (instead of an array) #3122
The default - and natural - way to map a primitive collection (e.g. int[]) in PostgreSQL is to a database array (the PG integer[]) type. This is PG-unique feature; in other database, primitive collections are mapped to a JSON text column in the database.
However, in some cases it may still make sense to map primitive collections to JSON in PG, just like we do in other databases. While we seem to support the mapping itself, most forms of querying won't work (e.g. we need to translate to jsonb_to_recordset instead of unnest).
Since mapping to PG arrays is the recommended way, this isn't likely to be high priority. Putting this in the backlog to gather user feedback.
Note: one reason to do this would be to allow nested collections (once EF itself supports these in relational). PostgreSQL doesn't support arrays of arrays, so it's impossible to support nested collections when mapping to arrays; but JSON would work. Think about whether this should be automatic, or require some sort of opt in to make it clear that it's JSON rather than arrays.
Reacted by Markus, oleksandr-tsyrul-hocoos and Shravan Rajinikanth
Activity
roderickgreen commentedon Apr 23, 2025
roji commentedon Apr 23, 2025
roderickgreen commentedon Apr 24, 2025
Revamp support for primitive collections within JSON
Revamp support for primitive collections within JSON
Revamp support for primitive collections within JSON