每个 table 具有单独哈希的数据集图

Dataset Graph with separate hashes per table

Sequel 文档指出

Dataset graphing changes the dataset to yield hashes where keys are table name symbols and values are hashes representing the columns related to that table. https://github.com/jeremyevans/sequel/blob/master/lib/sequel/dataset/graph.rb#L5

我真的很想使用这种行为,所以当我做类似的事情时;

db[:referrals].graph(:users, :id => :user_id).first

我会得到;

{referrals: {id: 1, name: 'Joe', user_id: 10}, users: {id: 10, name: 'Dave'}}

然而,返回的更像是;

{id: 1, name: 'Joe', user_id: 10, users_name: 'Dave'}

我在文档中看不到任何明显的更改方法。我是否遗漏了一些非常明显的东西(不会是第一次)。

文档需要更新(我会尽快处理)。您现在需要使用 graph_each 扩展来进行拆分。