Skip to content

Commit

Permalink
changelog: add how to detect o2o rels on v10.0.0 (#3312)
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-chavez committed Mar 7, 2024
1 parent 2f91853 commit 58999f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- #2312, Using `Prefer: return=representation` no longer returns a `Location` header - @laurenceisla
- #1984, For the cases where one to one relationships are detected, json objects will be returned instead of json arrays of length 1
+ If you wish to override this behavior, you can use computed relationships to return arrays again
+ You can get the newly detected one-to-one relationships by using the `--dump-schema` option and filtering with [jq](https://github.com/jqlang/jq).
```
./postgrest --dump-schema \
| jq '[.dbRelationships | .[] | .[1] | .[] | select(.relCardinality.tag == "O2O" and .relFTableIsView == false and .relTableIsView == false) | del(.relFTableIsView,.relTableIsView,.tag,.relIsSelf)]'
```

## [9.0.1] - 2022-06-03

Expand Down

0 comments on commit 58999f5

Please sign in to comment.