Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Sequel的默认选择似乎是“select *”,当您添加一些连接时会导致各种问题。至少你最终会在你的对象中得到错误的 id(因为这样会返回一个以上的“id”列)。做类似的事情
.select("people.*")
似乎可行,但这会将传入的字符串视为列并引用它。到目前为止,我不得不恢复到裸 SQL 来解决这个问题,但我知道必须有更好的方法。
Sequel 的默认行为是选择所有列,但很容易覆盖。如果您只想选择单个表中的所有列:
.select(:people.*)
如果要使用文字 SQL 字符串:
.select('people.*'.lit)