jackc / jackc/surus

INNER JOIN renames all fields to t0_r0 ... t2_r12 to the json end result

Open
#37 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
394
Forks
33
PR merge metrics
No merged PRs in 30d

Description

If I use eager_load for 3 different objects `Person`,`Group`,`Organization` like this:

```
Person.eager_load(group: organization).where({ organizations: { name: 'XXX' } }).all_json
```

The end result will have all of it's fields renamed to t0_r0 ... t2_r12.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with Person.eager_load(group: organization).where({ organizations: { name: 'XXX' } }).all_json and inspect how eager loading and JSON serialization handle the joined records. Confirm that the serialized result exposes fields as t0_r0 through t2_r12, then determine the expected field names before making the output preserve them.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.