jeremyevans/sequel — pull request #769 by dividedmind (2014-02-24 10:20:47+00:00)
Title: Allow using schema-qualified names in Dataset#graph

Currently giving a schema-qualified table to Dataset#graph doesn't work — sequel aliases the table as `schema__table` and then gets hopelessly confused:

```ruby
@ds1.graph(:schema__lines, :x=>:id).sql # => SELECT points.id, points.x, points.y,
# schema.lines.id AS schema__lines_id, schema.lines.x AS schema__lines_x,
# schema.lines.y AS schema__lines_y, schema.lines.graph_id FROM points
# LEFT OUTER JOIN schema.lines AS schema__lines ON (schema.lines.x = points.id)`
```

This change makes it possible to use schema-qualified table names with `#graph`. As a bonus, you can use the symbol shorthand to provide table aliases (`:table___alias`).

NB, note that this issue can currently be worked around by explicitly providing a table alias:
```ruby
@ds1.graph(:schema__lines, {:x=>:id}, table_alias: :lines).sql # => SELECT points.id,
# points.x, points.y, lines.id AS lines_id, lines.x AS lines_x, lines.y AS lines_y,
# lines.graph_id FROM points LEFT OUTER JOIN schema.lines AS lines
# ON (lines.x = points.id)
```

(I've also took the liberty of restructuring the object graph specs a bit to make them more hierarchical.)