tags:

views:

110

answers:

1

It seems like the default select for Sequel is "select *", which causes all kinds of problems when you add some joins. At the very least you end up with the wrong ids in your objects (because there will then be more than one "id" column returned). Doing something like

.select("people.*")

would seem to work, but that treats the string passed in as a column and quotes it. So far I've had to revert back to bare SQL to solve this, but I know there has to be a better way.

+1  A: 

The default behavior for Sequel is to select all columns, but it is easy to override. If you want to select only all columns from a single table:

.select(:people.*)

If you want to use a literal SQL string:

.select('people.*'.lit)

Jeremy Evans